AC Power Monitoring Using BL0937 IC
by Lithium-ion in Circuits > Arduino
1 Views, 0 Favorites, 0 Comments
AC Power Monitoring Using BL0937 IC

A simple circuit to monitor AC power, Breakout board can be plugged anywhere and show voltage, current and power.
Supplies

Components Required:
Test AC load
BL0937 Breakout board from PCBWAY
Arduino UNO
16x2 lcd
Power supply
Story:

AC power monitoring is an amazing feature nowadays in IoT related applications, such as smart fans, switches and boards. Some good company boards implement this tech in their products and continuously monitor the supplied output power. Monitoring power at local device level has its own advantages, like now we have data, if current increases and something goes wrong it can turn off the whole system and can save equipment from burning. Moreover power monitoring in IoT uses ASIC based designs, I got myself one let’s explore the working. This article is sponsored by PCBWAY, they provide a full proof prototyping solution from manufacturing PCBs to CNC. PCBWAY is popular because of its reliable services over the time in the electronics industry. Sign-up now using the link and get free coupons for your first PCB order.
BL0937 and Power Monitoring:

The IC from Shanghai Belling, BL0937B is a wide range of single-phase multi-function energy meter IC for single-phase socket, Smart Appliance, with a low cost and high accuracy. BL0937B integrates two high-accuracy Sigma-Delta ADC, voltage reference, power management and other analog circuit modules, and digital signal processing circuit to calculate active power, IRMS, VRMS etc.
Features:
- High accuracy, less than ±0.5% error over a dynamic range of 2500: 1
- High stability of large signal, in the condition of signal 300mA, less than ± 0.2% error in the output frequency fluctuation (CF).
- High stability of small signal, in the condition of signal 50mA, less than ± 0.3% error in the output frequency fluctuation (CF).
- Current and voltage RMS, current measurement range (8mA ~ 30A) @ 1mohm
- On-Chip anti-creep protection
- On-Chip power supply detector
- On-Chip voltage reference of 1.1V(typical)
- On-chip oscillator as clock source
- Single 3.3V supply, low power (8 mW typical)
Measurements of Voltage, Current and Power:



The IC has one input control pin, named as SEL(select), Two output pins (CF and CF1).
High frequency CF1 is provided for indicating IRMS/VRMS and high frequency CF for energy metering. BL0937B can measure the single-phase active energy, active power, current and voltage RMS and other parameters to fully meet the needs of the socket, power strip, smart appliances and others. Interrelated patents are pending.
IP and IN: These inputs are fully differential voltage inputs with a maximum signal range of ±50 mV. Because of the internal ESD protection circuit, If the voltage exceeds ± 1.5V the IC will not be damaged badly.
VP: Positive Input for Voltage Channel. The Voltage Inputs are differential voltage inputs with a maximum signal range of ±200 mV. Because of the internal ESD protection circuit, If the voltage exceeds ± 1.5V the IC will not be damaged badly.
CF: High frequency pulse output for active power, the pulse width is fixed to 38uS; the frequency is proportional to the active power value. Over-current indication pin; If overcurrent occurs, the pin outputs a 6.78KHz pulse.
CF1: When SEL=0, the output is current RMS, pulse width is fixed to 38uS, The frequency is proportional to the current RMS value. When SEL=1, the output is voltage RMS, pulse width is fixed to 38uS, The frequency is proportional to the voltage RMS value.
BL0937B measures two voltage signals on current channel and voltage channel and then calculates the real power information. This real power information is then converted to a frequency. The frequency information is output on CF in the form of active high pulses. At the same time current RMS and voltage RMS are calculated and converted to a frequency, and output on CF1 in the form of active high pulses.
Downloads
Circuit Diagram:


Typical Application BL0937B Typical application block diagram is shown below. Single 3.3V supply. The current signal is sampled through the alloy resistor connected to the IP and IN pins of BL0937B. The voltage signal is sampled through the resistor divider network connected to the VP pin of BL0937B. CF, CF1, SEL directly access to the MCU pin. CF/CF1 pulse cycle is measured to calculate the power, current RMS and voltage RMS. SEL pins should be pulled high or low using a 10K resistor. If left open the output will be indeterminate.
I have modified the circuit with some onboard protection features to make a breakout board which can be used with any microcontroller. Here is modified schematics given, it is fully tested and working. Chinese energy monitoring ICs do not work without a proper circuit, if anything messes up it will stop working permanently. And to keep the AC section away from the microcontroller on board isolation is provided.
Arduino Code:

PCB Design:


The PCB is designed keeping the power consideration of a device in mind, it is a type of plug board which can be used anywhere to monitor power like a breakout board. The PCB consists of two screw terminals for input and output, A shunt resistor which is responsible for voltage and current calculation. Some capacitors and resistor combinations are placed near the IC as per the layout design rules. To isolate the AC section from the microcontroller unit, optocouplers are used. Some onboard testing points to check the working of IC. The PCB is designed in EasyEDA and fabricated by PCBWAY. You can download all the required files, datasheet and code from here.
Testing and Working:


I have tested the circuit by connecting an external microcontroller and a 16x2 LCD screen, the interfacing circuit is given below. A simple interrupt program is used and paired with Arduino UNO here. The circuit can be modified to work on ESP32 and ESP8266 in order to get the data on a web server. We have to tune the variable values to calibrate the board. The values may differ in your case, depending upon the IC batch and microcontroller timer. I have tested it with 60W and 100W power sources and got 90% accurate power readings.