Problems associated with a multimeter include changing positions of probes while measuring voltage and current, inability to measure voltage and current simultaneously, chances of multimeter getting damaged if voltage is measured in high current mode and others. This circuit solves all these problems by displaying all measured values simultaneously on the OLED.
Circuit and working
The circuit diagram of the miniature VAW meter is shown in Fig. 1. It is built around 5V voltage regulator 7805 (IC1), microcontroller ATtiny85 (IC2), 30A current sensing module ACS712, miniature display (2.4cm, or 0.96-inch, in size) OLED and a few other components.
The circuit can measure maximum voltage up to 30V DC and maximum current up to 30A DC. To avoid damaging the microcontroller (MCU), measurements should be limited to 30V and 30A. If the value exceedes 30V, the display shows OFLO, which indicates overflow of the parameter.
ATtiny85 is an eight-pin MCU sufficiently powerful for the project, with 8kB flash, 512B RAM, 512B EEPROM and 1MHz default clock frequency at the heart of the system. It continuously measures voltage and current through its two ADC channels. ADC values are processed and converted to voltage, current and power values, and then displayed on the OLED.
The current-sensing module uses Allegro’s ACS712 chip, which uses Hall effect to convert current to voltage. Output of the module is fed to one of the ADC channels of the MCU. A 30A module is used for measuring current. Sensitivity of the module is 66mV/A (refer ACS712 data sheet).
It is a small display measuring 2.4 cms with 128×64-pixel resolution, 5V DC supply and I2C connector. It has four pins, out of which one is for serial data (SDA pin), another for clock (SCL pin) and the remaining two for power supply.
To show text on the display, 64 rows of pixels are divided into eight text rows with eight-pixel rows in each text row. To display text clearly, code is set for sixteen-pixel height and eight-pixel width. So, OLED can display text in four rows with 16×8 font size.
Accuracy of ACS712 may slightly vary from module to module. Multiplication factor is initialised as 740 in the source program, which is achieved from 66mV/A (as per Allegro’s data sheet). The value may be varied in the source code (vaw_meter.c), declared as int MF=740.
Then, re-compile the code using AVR studio and upload vaw_meter.hex file to the MCU.
Construction and testing
After assembling the circuit on the PCB or veroboard, burn vaw_meter.hex to ATtiny85 MCU using any AVR programmer. Insert the programmed ATtiny85 to its eight-pin socket/base. Connect the OLED (four-pin) to the circuit at connector CON2. Power on the board with 9V battery (Batt.1) via switch S1.
Power indicator LED1 will be on. LED2 will start blinking, indicating that program initialisation is complete and the circuit is ready for use. Now, the OLED will start displaying volts, amps and watts after a short delay.
Next, connect 12V battery (Batt.2) at DC input pins. Adjust VR1 to display the same voltage on the OLED. Connect jumper wires J2 and J3 externally to positive DC output and ground, respectively. J1 is optional and should be connected to positive DC input only when 8V DC to 20V DC power supply is used.
Connect 12V bulb (used in automobiles) as load or any load at DC output pins. The OLED displays current and power consumption. The + and – symbols in the OLED display prefixed to AMPS indicate the direction of current with respect to ACS712 module terminals (IP+ and IP-), as shown in the circuit.
In case 8V to 20V is used for measurement, connect J1 to positive DC input to get the power supply to the circuit from 12V battery. Remove 9V battery in that case.
Download source folder: click here
Fayaz Hassan is manager at Visakhapatnam Steel Plant, Andhra Pradesh. His interests include MCU projects, mechatronics and robotics