RFID reader module: MFRC522

So, hello to all viewers and welcome back to Gettobyte Platform. In This blog you are going to know about RFID Reader MFRC522, which is designed by NXP Semiconductors. Objective would be to interface this module with Host MCU’s like of NXP Semiconductors, STMicroelectronics or other vendors MCU’s. Will make the driver to interface the RFID Reader with any MCU, not unlike just with Arduino and Arduino IDE environment. To make the driver of RFID reader at first, we need to dig into its datasheet, to understand its various sub parts. And that’s all about this blog is gotten going to be, to make the datasheet understand in easy way-out. Table of Contents Next & Previous Blog Previous Blog: What Is RFID TEchnology RFID Reader MFRC522 Interfacing with Host MCU RFID Technology RFID modules is a wireless sensing technology which is used to track/identify/monitor the objects.  Viewers can refer to this blog to know about RFID technology in detail. or can watch this video which is in animated format to know about RFID technology. MFRC522 RFID Reader/PCD MFRC522 is a highly integrated reader/writer IC for contactless communication at 13.56 MHz. These reader supports the ISO 14443 A protocol for communicating with RFID Tags. They are used to detect the MIFRAME RFID tags. MFRC522 has internal RF transceiver, which provides a robust and efficient implementation for demodulating and decoding signals from MIFRAME compatible cards using ISO 14443 A protocol. The digital module of MFRC522 manages the complete ISO/IEC 14443 A framing and error detection (parity and CRC) functionality. MFRC522 supports 3 tags of MIFRAME family, that are MF1xxS20, MF1xxS70 and MF1S50 products. MFRC522 features MFRC522 though quite old RFID reader and in today’s time many new advance RFID readers have come up. But so as to get started with this technology as a hobbyist/student/DIY project, it is perfect module to lay your hands on this Technology. MFRC522 has highly integrated analog circuitry to demodulate and decode responses when RFID tags are brought in close proximity of these devices. RFID readers are connected with some host MCU, where the processing of data which is received via RFID tags happens according to the application. MFRC522 can connect with host MCU, using SPI, Serial UART and I2C -bus interface. It supports ISO 14443 A protocol and can be used with MIFRAME family of RFID tags. And in MIFRAME family it supports only MF1xxS20, MF1xxS70 and MF1xxS50 products. It has internal CRC-coprocessor. Internal FIFO buffer which can handle 64 bytes of sending and receiving. It uses the Crypto-1 cipher for authenticating. It supports Internal oscillator for connection to 27.12 MHz quartz crytsal. It is low power device, need 2.5 V to 3.3 V power supply. It also has flexible interrupt modes when some RFID tags are detected and trigering events too. In addition to flexible interrupt, it has programmabe I/O pins and timer. It can perform Internal self-test too. MFRC522 Functional description MFRC522 Functional Descriptions MFRC522 Host Interfaces MFRC522 Interrupts MFRC522 Time Unit MFRC522 FIFO MFRC522 CRC Host MCU to MFRC522 Command Set MFRC522 to PICC command set MFRC522 Host Interfaces MFRC522 Host Interfaces MFRC522 can be connected to Host MCU using 3 serial protocols: UART, I2C or SPI. MFRC522 checks the current host interface type. automatically after performing a power-on or hard reset. The MFRC522 IC identifies the hostinterface by sensing the logic levels on the below pins after the reset phase.  The MFRC522 is equipped with a series of registers that allow the Host MCU to access its functional description blocks. To ensure the proper functioning of the MFRC522, the Host MCU must initialize and configure these functional blocks by sending the corresponding register addresses. Each register is essentially an address byte that is transmitted from the Host MCU. Depending on the function described in the register section, read/write operations are performed on the corresponding address byte. It is crucial to properly initialize and configure these functional blocks to ensure the optimal performance of the MFRC522. By understanding the purpose of each register and its corresponding function, the Host MCU can effectively communicate with the MFRC522 and achieve the desired results. –> MFRC522_write_register() –> MFRC522_Read_register() MFRC522 Interrupts MFRC522 Interrupts MFRC522 can trigger the interrupts, when certain events occur. There are 8 events as shown in below table when interrupt can be triggered. When above event occurs, IRQ pin is used to interrupt the host. IRQ pin signal is asserted and host MCU can use its interrupt handling capabilities (basically NVIC if we are talking about ARM based MCU) on what to do when corresponding interrupt has occurred. Status1Reg Register IRq bit is used to indicate if any interrupt source has been triggerered. Status1Reg register IRq bit Which interrupt has been triggered is indicated by ComIrqReg and DivIrqReg Register.  ComIrqReg Register DivIrqReg Which interrupts to be configured and behavior of IRQ pin is configured by ComIEReg and DivIEReg Register. ComIEnReg DivIEnReg MFRC522 Time Unit MFRC522 Time Unit There is a Timer unit in MFRC522, that is used for multiple purposes. Timer unit is essential for maintaing the configuring the clock and analog interfaces. Also timer unit can be used for following features: Timeout counter Watchdog counter Stopwatch Programmable one shot Periodical trigger Timer has an input clock of 13.56 MHz derived from the 27.12 MHz quartz crystal oscillator. The timer consists of 2 stages: prescaler and counter. The prescaler(TPrescaler) is a 12-bit counter. That can be configured using TModeReg register’s TPrescaler_Hi[3:0] and TPrescalerReg register’s TPrescaler[7:0] bits. The Reload value for the counter is defined by 16 bits between 0 & 65535 in the TReloadReg register. The current value of the timer is indicated in the TCounterVAlReg Register.  MFRC522 FIFO MFRC522 FIFO FIFO overview The MFRC522 contains an internal FIFO buffer of 64 bytes, which is equivalent to 8 x 64 bits. This buffer is utilized for both input and output data streams. The host MCU has the capability to perform both Read and Write operations on this FIFO. The host MCU

INTRODUCTION TO MPU6050IC

Most of us are fans of Video Games. We played a lot of games on our mobiles like PUBG, Call Of Duty and my personal favorite Asphalt. In all these games one thing we all notice is that as we rotate or bend our phone, the car also rotates in the same direction.  Have you ever imagined how this would happen? Well their are electronic sensors:  accelerometer and Gyroscope Lets dive into this blog, to know the Ans for this!!! What is an ACCELEROMETER WORKING Let us assume a small ball being placed in a box filled with vacuum and no external force is applied to it (i.e., consider the situation of outer space). Now initially the ball will be at the center of the box. Consider each side of the box as an axis. Suddenly we start moving the box to the left side  with the acceleration of ‘g’ (i.e., 9.8m/s2), the ball will hit the +X side of the box. Since no external force is acting on it, and the entire thing is weightless (vacuum state), hence the force comes out to be ‘g’. Consider another scenario when the box is moved upwards with the same acceleration ‘g’. Now again the ball will hit the downward side of the box i.e. +Z axis with the force equal to ‘g’. This is just a simple explanation on how an accelerometer works but in practical scenario accelerometers are based on MEMS technology built on a silicon wafer with companion CMOS electronics through wafer-level bonding. Taking the above situation in mind, there consists of a silicon wafer having polysilicon springs connected with a suspended plate covered with fixed mass around it on the wafer where in between the space, this fixed plate moves. This entire structure reflects the changes whenever acceleration is applied across the X,Y and Z axis. This reflection is reflected by the capacitance change placed in between the fixed masses as the suspended plate moves thus the sensor records this change in capacitance as the final reading. GYROSCOPE WORKING Since the accelerometer measures the linear acceleration, the gyroscope on the other hand measures the angular rotation which is accomplished by Coriolis Effect. Coriolis Effect The Coriolis Effect states that when a mass (m) moves in a specific direction with a velocity (v) and an external angular rate (Ω) is applied, the Coriolis Effect generates a force (F) that causes the mass to move perpendicularly. The value of this displacement is directly related to the angular rate applied. Consider two masses oscillating in opposite directions at a constant frequency. When an angular rate is applied, the Coriolis effect produced by each mass is in opposite directions, resulting in a proportional change in capacitance between the masses. By measuring this change in capacitance, the angular rate can be calculated. The MEMS sensor consists of a proof mass (i.e., it consists of 4 parts M1, M2, M3. M4) that continuously oscillates inward and outwards in the plane, thus causing a coriolis effect. When the structure is being rotated, the Coriolis Force acts on the moving mass causing oscillations in the plane. There are three modes depending upon the axis along which the angular rotation is applied: Roll Mode: When the angular rate is applied at the X-axis Pitch Mode: When the angular rate is applied at the Y-axis Yaw Mode: When the angular rate is applied at the Z-axis What is A MUST HAVE Motion Interfacing one finds in almost every smartphone and tablet. It is a 3-axis gyroscope and 3-axis accelerometer, in total an integrated 6-axis MotionTracking device all in a single small 4x4x0.9mm package. This package size has been achieved by the MEMS (MicroElectroMechanical System) innovation. Coming to some technical aspect of the IC, It comes with a dedicated I2C sensor bus at 400KHz Features 3 16-bit analog-to-digital converters (ADC) each for digitizing gyroscope and accelerometer outputs. Gyroscope full-scale range of 250,500,1000 and 2000 degree/sec (DPS). Accelerometer full-scale range of 2g,4g,8g,16g and On-chip 1024 Byte FIFO buffer which enables the system to read the sensor data in burst and then enter the low-power mode. Lastly, it operates at a power supply voltage range of 2.375V – 3.46V. Features of ACCELEROMETER in MPU6050IC Features of GYROSCOPE in MPU6050IC Features of ACCELEROMETER in MPU6050IC Features of Accelerometer in MPU6050IC The triple-axis MEMS accelerometer in MPU-60X0 includes a wide range of features:  Digital-output triple-axis accelerometer with a programmable full scale range of ±2g, ±4g, ±8g and ±16g Integrated 16-bit ADCs enable simultaneous sampling of accelerometers while requiring no external multiplexer Accelerometer normal operating current: 500µA  Low power accelerometer mode current: 10µA at 1.25Hz, 20µA at 5Hz, 60µA at 20Hz, 110µA at 40Hz Orientation detection and signaling  Tap detection User-programmable interrupts. Features of GYROSCOPE in MPU6050IC GYROSCOPE FEATURES The triple-axis MEMS gyroscope in the MPU-60X0 includes a wide range of features: Digital-output X-, Y-, and Z-Axis angular rate sensors (gyroscopes) with a user-programmable fullscale range of ±250, ±500, ±1000, and ±2000°/sec  External sync signal connected to the FSYNC pin supports image, video and GPS synchronization Integrated 16-bit ADCs enable simultaneous sampling of gyros Enhanced bias and sensitivity temperature stability reduces the need for user calibration Improved low-frequency noise performance Digitally programmable low-pass filter Gyroscope operating current: 3.6mA Standby current: 5µA  Factory calibrated sensitivity scale factor MPU6050 of MPU6050 Block Diagram of MPU6050 IC Gyroscope sensor Accelerometer sensor Digital Motion Processor (DMP) engine Primary I2C Auxiliary I2C Clock Generation Sensor Data Register FIFO Buffer Interrupts Digital Output Temperature Sensor Bias and LDO Charge Pump Gyroscope sensor Three-axis MEMS rate gyroscope sensor with 16-bit ADCs and signal conditioning It consists of three independent vibratory MEMS gyroscopes, which detect the rotation about the X, Y, Z axis. The capacitive change due to Coriolis Effect is observed whenever a rotation is caused about any of the axes. The corresponding signal is then amplified, demodulated and filtered to the corresponding voltage levels that relate to the angular rate. The sensor has an on chip 16 bit ADC to

STM32 Overview

What is STM32 ? STM32 is a family of 32-bit Microcontrollers and development boards manufactured by ST Microelectronics which offer very high performance for a relatively low price. All STM32 microcontrollers are based on ARM Cortex-M processor which make them much better in terms of computing power than most of the common microcontrollers/microcontroller development boards which are available in the market. These microcontrollers also have been provided with software support by ST for developers for free. If you have experience with microcontrollers like Arduino, this is a great step forward in understanding microcontrollers in depth. The STM32 framework allows you to control all peripherals and allows you to tweak them as per your wish, whereas in Arduino IDE, when you program in C++, it comes with in-built functions and libraries which don’t allow you to understand the backend working behind everything. This is very crucial, as it allows you to use the microcontroller to its full potential. STM32 FAMILY The STM32 family of microcontrollers is vast and expansive, offering a variety of options for the consumer to choose from. The family of microcontrollers is broadly classified into 4 categories- High performance ST offers a series of microcontrollers which have the fastest code execution time, high speed data transfer and relatively higher flash memory. Along with this, the feature the most advance peripherals that ST offers. This makes these controllers very useful for real-time applications such as running an RTOS. STM32H7x The H7 series controllers are based on the ARM Cortex M7 offering very high speeds of upto 550Mhz. The microcontroller series comes in two variants, single core and dual core. Dual core H7 series controllers come with an ARM Cortex M4 core as well as an ARM Cortex M7 core which allows for processing work distribution, very useful for applications requiring many peripherals where response time is critical. The dual Core variants also come with an inbuilt SMPS as well. The single core series comes with an ARM Cortex M7 core with clock speed between 220-550Mhz, depending upon the variant. STM32F7x The F7 series controllers are based on the ARM Cortex M7, Thanks to an L1 (level 1) cache, the series delivers the maximum possible theoretical performance of the Cortex-M7 core. Cache memory temporarily stores instructions frequently accessed by the processor STM32F4x – The F4 series is based on the ARM Cortex M4. These controllers have less processing power then H7 and F7 series but still come with advanced peripherals and high flash memory. A very useful line of microcontrollers which offer a wide variety of features and come at a relatively lower cost than that of an F7/H7 controllers. The F4 series is broadly divided into 3 segments- 1.F4 Advance line- Offers up to 180Mhz of clock speed and a maximum of 2 Mb of dual bank flash memory, with advanced peripherals, consisting of communication buses such as QSPI. 2.F4 foundation line- Offer lower flash memory (between 512Kb-1Mb) , with few controllers offering advance peripherals and features such as camera interface and Ethernet MAC. 3.F4 Access line- This line of F4 controllers consists of entry level controller which can be termed ‘High Performance’. These controllers come with lower clock speeds, lower RAM but feature very good power efficiency, while also not compromising on peripherals. Wireless The main focus of the STM32Wx microcontroller family is wireless connectivity. They cover sub-GHz as well as 2.4Ghz frequency range operation The STM32 wireless MCUs are further divided into 2 categories– STM32WB These MCUs have a dual core processor unit, Cortex M4 & Cortex M0+, which allows for processing distribution, making it a great candidate for real-time processing and execution. The MCU series is based on STM32L4 architecture, which offers dynamic voltage scaling, reducing the power consumption of the device. They also support BLE 5.3, Open Thread and Zigbee protocols, making them a great choice for IOT applications, providing a lot of functionality onboard the chip itself. STM32WL These MCUs also come with a dual core processor unit like the STM32WB series, and some variants also come with a single ARM Cortex M4 as their processing unit. The key highlight of this series of microcontrollers is that not only do they work as a general purpose microcontroller, but also come with an integrated sub GHz radio supporting LoRa WAN which makes it a great choice for smart home applications, utilities, logistics, Industrial IOT etc.   Ultra-Low Power – STM32 ultra-low-power microcontrollers offer designers of energy-efficient embedded systems and applications a balance between performance, power, security and cost effectiveness. The portfolio includes the STM8L (8-bit proprietary core), the STM32L4 (Arm® Cortex®-M4), the STM32L0 (Arm® Cortex®-M0+) and the STM32L1 (Arm® Cortex®-M3). The STM32L5 MCU (Arm® Cortex®-M33) with its enhancedsecurity features is the latest addition to this rich portfolio. The new STM32U5 series combines the latest and most efficient Arm Cortex-M33 core with an innovative 40 nm platform that reduces energy consumption to the bone, while increasing performance. The series also adds the state-of-the-art features which are required in today’s applications,including advanced cyber security with hardware-based protection, and graphics accelerators for rich graphical user interfaces. The STM32L5 series enhanced security features leverage Arm® Cortex®-M33 and its TrustZone® for Armv8-M. Thanks to this new core and a new ST ART Accelerator™ (also supporting external memory), the STM32L5 reaches an 443 CoreMark. The STM32L4 series offers the excellence of ST’s ultra-low power platform with an additional performance dimension by providing 100 DMIPS with DSP instructions and Floating-Point Unit (FPU), more memory (up to 1 Mbyte of Flash memory) and innovative features. The STM32L4+ series extends STM32L4 technology by offering higher performance (120 MHz/409 CoreMark executing from internal Flash memory), larger embedded memories (up to 2 Mbytes of Flash memory and 640 Kbytes of SRAM), and rendering advanced graphics without compromising ultra-low-power consumption. The STM32L0 series offers a genuine energy-saving solution for entry-level applications. Available in tiny packages down to 14 pins and with a wide range of Flash memory densities from 8 to 192 Kbytes, the STM32L0 features ultra-low power consumption in a competitive portfolio. Mainstream– The mainstream microcontrollers are more general-purpose boards

Interview at Texas Instruments

I was in my final year of my graduation (Btech:EEE) and our last semester is getting over. It was 26th of May 2022, I was in my college lab with my friends and Hod teacher discussing our Farewell venue and date, at that moment I just checked my phone and I saw a notification on LinkedIn, got a LinkedIn HR mail from one of the Re recruiters of Texas Instruments. I got very excited and happy at that moment. I got so anxious at that  moment  that I immediately  told my  best friend and gf, after reading the Job Description. My resume got selected for 2 positions in Texas Instruments,  one is of Embedded Application Developer and other is of Field Application Engineer. For the position of Embedded Application Developer, I got the LinkedIn HR mail and from there my profile was selected. For the position of Field Application Engineer, I got a referral from the Alumni of my college, who is Field Application Manager at Texas Instruments. And this happens in a span of 1 week, at first my resume is selected for Embedded Application Developer. The very next day I talked to one of the teachers of my college regarding my selection and then she gave me the reference of Alumni of our college who have been at Texas Instruments for 10 years. On talking to the alumni, he told me that there are positions open in his team for Field Application Engineer. He likes my profile and resume both for that position and he referred to my profile for that position. Though I have called him with an intention to talk about an Embedded Application Developer position, he has referred me for one of the positions open in his team. So my interview process was going on for 2 positions parallel at Texas Instruments. Field Application Engineer Now at first let\’s  start with the interview process and experience of a Field Application Developer position, for which I ultimately get selected too and offered with a final offer letter of 25 LPA CTC. Field Application Engineer is a kind of technical sales job, in which the hired person has to provide technical assistance, development and strategies of Company products to customers. So the hired person should have knowledge related to company products. Should also be good in communication skills and interpersonal skills to make long lasting professional relations with company customers. So in this case, Texas Instruments is the company and its products are mainly concentric to Its Wide number of MCU, MPU, IoT modules and ASIC chips. So FAE should have good understanding and knowledge of microcontrollers, system level knowledge of embedded products, IoT protocols, use cases of different peripherals of the MCU. A person should have knowledge of different sub components that are used in the design of Embedded products, but is not necessary to have in depth knowledge as FAE would not be involved in development but much more acts as interface between company and the customer using the company products. 4 rounds were taken, out of which 3 are in online mode and one(last one) is offline mode. For the position of FAE, interview questions are different from what we all normally used to prepare ourselves. The questions are much more to test one\’s personality, communication skills, conceptual questions related to technology. My first round was for about 45 mins, in which the interviewer asked questions related to my journey so far, how I have learnt things on my own, why I chose to get into the technical field and some basic technical questions related to Embedded. Also about 15-20 mins of my first round went into discussion of the Field Application Engineer job role, in which the interviewer told me what exactly would be my roles and responsibilities. I expected that there would be coding questions or questions related to in depth hardware but nothing much like that. And i analyzed that the interviewer was concentric to my communication skills, how well can i address my self, how i well i can interact with people to 

Getting Started with Firmware Development

See around yourself, we all are surrounded by electronic gadgets around ourselves. The mouse which you are using to navigate through desktop, the Earphones via we all used to listen to music and show off our styles while traveling!!!, the doorbell we ring in homes and see who is outside through video, wireless car keys through which we open our cars, high volume speakers and decks we enjoy dancing on playing the music of our choice when we go to pubs/discos or parties, automation in cars which we see in the forms of lights, automatic systems, high graphics infotainment along with cameras and wireless systems, setup boxes, medical devices like oximeter, sugar, and blood pressure machines. The list will not stop but the size of this blog will get par. All the above examples which I have listed can be termed as Embedded products. Embedded Products are like a silent servants of the modern technological society, as most of the time people are not aware of it but they keep on doing their work Silently and efficiently. One thing in common in all types of Embedded products is the presence of Microcontrollers or Microprocessors. Microcontrollers or Microprocessors are like the brain of embedded products.  Microcontrollers or Microprocessors are digital systems as they only understand binary language that is 0 or 1’s. Now the thing that makes these microcontrollers and microprocessors different from the human brain is that we can program these digital systems. Here comes the Embedded Software/Firmware Development. What is Embedded Software/Firmware Development? Basically, the programming that is done into microcontrollers/microprocessors is termed Embedded Software Development. The term Embedded makes this different from traditional Software Development ( Web/App Development).By the term embedded, it means that their is s Embedded products have a constraint of memory, so programming language has to be there that is of less size and easily be converted to binary language of 0 & 1’s. Programming languages that are widely used: are C and CPP language. Microcontrollers/Microprocessors are physical hardware that can be felt, thus Embedded Software Developers do need some hardware knowledge( like that of Electronics and Computers).  Now the difference in Embedded Software and Embedded Firmware is not much. Both of these are used interchangeably in embedded domain. Embedded Firmware is used when we are developing programs very close to hardware like: Device driver development, Peripheral Interfacing, Sensors and Modules integration. Embedded Software is much more inclined towards Hardware Abstraction Layers(HAL), RTOSes, Wireless protocol stacks, Code portability on different platforms. Need of Embedded Firmware/Software Development. Embedded Software/Firmware development is niche R&D skill in modern world technology whose scope and demand will only increase with growing technologies. All modern world technologies which we see around ourselves:  AR-VR gadgets, Industrial PLC-HMI’s, Next Generation Automotive cars, Internet of Things, Aircrafts, Avionics and many more can only be build by the help of Embedded Software/Firmware Developers. Because it is role of Embedded Software Developers to interact different hardware subsystems interact with each other( through programming and coding) and made the Embedded product work. How to get Started with Embedded Firmware Development. I hope by now you have get bit of clarity and idea about Embedded Firmware Development and its need. Also the kind of industries one can work on after getting this skill. These are very important things to know before actually start learning any skill. As learning a skill is long process and one need good and strong motivation down the line to stay dedicated to learn that skill. Essential things to learn for Embedded Firmware Development. As if now I have talked much about the high end technologies and big flashy words. But now lets get down to basics and actually see how to learn this skill. Essential things to learn for Embedded Software/Firmware Development. C/CPP language–> This is de-facto and most important. As 95 percent of time programming language which is used by embedded developers would be C/CPP language. Both of the languages are more and less same apart from some concepts. Concept of pointers, bit shifting/bit manipulation, functions, types of data types, strings and arrays are the some concepts that should be gone through. Below are some of the books which one can refer for learning basics of C/CPP. Understanding and Using C Pointers: Core Techniques for Memory Management Object-Oriented Programming in Microsoft C++ Pointers on C by Kenneth Reek  Computer Architecture and Organization –> Okay so done with programming part, now hardware knowledge plays equally important role. As Embedded Software/Firmware developers will be programming on Microcontrollers (MCU)/Microprocessors (MPU), so knowledge of them is essential. What exactly is Microcontroller? How do they work? Different kind of architectures in MCU/MPU, difference between MPU&MCU, Boot Process in MPU/MCU, getting familiar with terminologies related to MPU/MCU world are some of the thoughts you can start learning about these. Below are some of the books which one can refer for learning about Computer Architecture and Organization. Computer Organization and Architecture: Designing for Performance Computer system architecture by morris mano One of the best ways to learn these languages is by reading already built in codes. 3. Basic Electronics and Electrical knowledge: Okay so this is the part because of which majority of people after starting initially with Embedded Development left it further in college days. As there is role of hardware also, so alongside with programming language having knowledge of electronics and electrical is required sometimes and can be beneficial. In Electronics knowledge of Resistors, Capacitors, Inductors, Basic Ohm’s law (their use cases in real life application: Current sense amplifiers), Opamps, ADC’s would be good as this would make you understand the Embedded product in better way. In Electrical knowledge of AC-DC voltages, power supplies, Power electronics, basic principles of electricity generation and etc is though not always necessary but would be good to have to make your interactive and interesting DIY projects. Below are the books which one can refer for learning about Basic Electronics and Electricals: Get started with Embedded Firmware Development with Gettobyte (To all

HLW8012 AC Energy metering IC: Part 1

Table of Contents So hello guys, welcome back to Gettobyte Once again. Todays blog is going to be on interfacing the Energy metering IC : HLW8012 which is manufactured by HLW Technology.On previous blogs we have developed the application driver   for W25Q SPI based flash memory’s, is time we are going to develop the Application driver for HLW8012. So first question that must come in your mind is that what is Energy Metering IC. Lets first Understand this term. What are Energy Metering Integrated Chips ? Before Understanding Energy metering IC’s their is one term that i would like to get familiar my viewers that is ASIC’s. ASIC’s are Application Specific Integrated Chips i.e. chips which are designed, developed and fabricated for particular applications.  Energy Metering IC’s are one of the ASIC’s. In this case the specific application is that of Electrical Energy Measurement. By the use and emergence of Energy Metering IC’s we can calculate the Electrical Energy parameters like RMS/Instantaneous Voltage, RMS/Instantaneous Current, Reactive/Active/Apparent Power, Energy Consumed, Power loss/dissipation, Power factor, Frequency digitally. Using this electrical Energy Measurements only our monthly electrical energy bill is calculated. These electrical energy parameters play very important role for monitoring and analyzing of Power consumption in our homes, offices, factories, city’s and all such infrastructures where their is use of electricity. These Ic’s are widely used in Energy Meters, Multifunction Meters, Smart Energy meters, Solar Energy control panels, Factory Automation Panels and etc. Energy metering IC’s are designed using the knowledge of ADC, Opamps, Low pass/High pass filters, use of Analog Electronics with Power Electronics, DSP(Digital Signal processing), Signal Conditioning circuits. All these circuits are designed inside the Energy Metering IC’s using VLSI/VHDL. That is where the concept of Application Specific comes in. So when reading the datasheet of Energy Metering IC’s some overview about these terms and terminologies would be beneficial for understanding the functioning of these IC’s. Voltage and current drive the world in every sense. Using these 2 parameters we can calculate all other electrical energy parameters be it reactive power, active power, energy, frequency, power factor and etc. Energy Metering IC’s primarily measures/senses only Voltage and Current by the use of Signal conditioning circuits, ADC, Opamps, Analog Electronics. Further these IC’s calculates all other Electrical energy parameters using DSP, Low pass/High pass filters and etc. All of these things are designed inside the Energy metering IC’s. Input voltage and current to these IC’s are fed depending upon the principal which we are using for sensing Voltage and current. After feeding the Input to these IC’s via one of the above principals, comes the role of above mentioned circuits/units which are designed inside the chips for their efficient functioning and digital accurate readings. Energy metering IC’s which are widely used are of The above listed metering IC’s and their development boards are very expensive, so for my use case i have found out some cheap/alternative Energy Metering IC’s, but their manufacturer are Chinese companies: STMicroelectronics Metering ICSTMP32/33/34 seriesClick HereTexas Instruments Metering ICsClick HereAnalog DevicesADE seriesClick HereNXP semiconductorsClick Here Previous Next HLW8012( the one we are using this blog) HLW8032 BLO937 PZEM-004T module  CS5460 bi-directional energy meter module This is the First string, Second string, Third string of the sentence. General Description of HLW8012 Energy Metering IC HLW8012 is a single phase energy metering IC, which is based on shunt resistor based principal. The HLW8012 module has on board 1 milli-ohm copper-manganese shunt resistor, which acts as a shunt resistor and used to sense the voltage and current. One of the biggest problem with IC, is its datasheet. The datasheet of this IC is in Chinese language, so likely it would be difficult to understand from it. The IC can measure the RMS Voltage, RMS Current, Active power and Outputs these reading digitally in the form of PWM signals. HLW8012 is a good choice for making small and hobbyist kind of projects which requires the measurement of AC electrical parameters. One such project/product that I found, is made on HLW8012. HLW8012 is inexpensive and good alternative to be used in comparison to  other expensive metering IC’s. The module of HLW8012 is very handy and easy to use. It has 4 input terminals: 2 terminals are connected with AC Load and other 2 terminals are connected with AC Power supply. HLW8012 Outputs the Readings of Voltage, Current and power via PWM signals of 50 percent duty cycle, Their are two pins in HLW8012 CF and CF1 which outputs the voltage, current and power readings in a digital PWM square signal, which host MCU can capture using Timer Input Capture mode. The readings are directly proportional to the Frequency of the PWM signal. Every modern MCU has Timer peripheral, which we can configure in Timer Input capture mode. In this mode Host MCU can capture the PWM signals from external world (here our external world is HLW8012). That’s how HLW8012 will communicate with the Host MCU. Features of HLW8012 Energy Metering IC Based on shunt resistor based principal. Can measure current upto 20Amps and Voltage upto 300 Volts Easy interface to Host MCU sends voltage, current and power readings digitally via PWM square signals. Needs +5 volt to operate the IC. Block Diagram of HLW8012 Metering IC PINOUT of the HLW8012 Energy metering IC Pin Number 1 Pin number 1 is VCC (Chip Select), which is used to operate the power the HLW8012 IC. Connect this pin to +5 Volts of the host MCU. Pin Number 2 & 3 Pin number 2 &3 are V1P/V1N, which are Current differential input pins. These pins are connected in parallel to the shunt resistor(See the application circuit below). This connection is already made on the Module of HLW8012. The maximum voltage that can be input to these pins are 43.75mV. Pin Number 4 Pin number 4 is V2P, which is Voltage differential input pin, this pin is connected to  input AC voltage via resistor network of 47k ohms Pin Number 5 Pin

Stay Updated With Us

Error: Contact form not found.

      Blog