# 3D Printed Arduino OLED Watt Meter

35,394

401

47

Have you ever wanted to know how many watts or how much current an item uses or even its operating voltage? This simple and easy project can provide you with that crucial information while keeping costs under \$7. I primarily designed this to be used in conjunction with common solar charge controllers, that don't have any indication of load power draw. Since making it, I realized it would also be useful on my homemade bench power supply. The fact that you can program a small bitmap image into it is just a bonus and makes you feel great every time you look at it.

## Step 1: Gather Your Parts

1. Arduino Nano \$2.5 on Ebay (or any arduino with 2 anolog inputs and I2C capability)
2. ACS 712 30amp current sensor module \$1 on Ebay
3. I2C OLED Display 5volt \$3 on Ebay
4. 10k and 100k resistors \$.02 (pick up a resistor kit on Ebay if needed)
5. Arduino Code provided in this instructable
6. 3d printed case Stl provided in this instructable (optional)

Things that you probably have laying around the house include.

1. loose wire
2. soldering iron or way of soldering
3. some kind of enclosure
4. usb mini cable for programming
5. computer with arduino software
6. bread board for testing electronic circuits
7. test supply voltage of 7-15
9. multi meter for testing

## Step 2: Prototype It on a Bread Board

I have provided a simple easy to follow diagram showing how all the connections are made. I recommend using a bread board, take your time and make sure your connections are correct before powering up. Take special care in making sure the resistor voltage divider is setup correctly. Measure the voltage at the middle of it before connecting it to the ardunino it should be 1/10 the voltage at the input.

## Step 3: Code and Calibrate

This code is far from perfect but rather rushed and just a proof of concept. Currently is set to cycle through 4 pages updating the information displayed each time. Use your multi meter to measure the source voltage then modify R1 and R2 in the code respectively to calibrate the voltage on the display. Next using the same voltage and source measure the current of a load using the multi meter. Then reference that reading with the current sensor and modify the number 511 either up or down to calibrate. Keep in mind it is not accurate when measuring small currents, I recommend using a load of around 1 amp while calibrating. If your readings are showing in negative swap the sense wires on the current sensor to easily correct that. Also feel free to change the bitmap image in the code with one of your own, to really customize the final look of the meter.

## Step 4: 3D Print a Case

You can enclose your project in many different ways, however if you have a 3d printer why not print an enclosure. I have included the stl files for the 2 part enclosure that I designed that snaps together with a friction fit. It also has 2 mounting holes for screws and a unique stacked layout.

## Step 5: Solder and Assemble

Solder wires to the boards keeping them as short as possible, referencing how they fit in the back of the printed case. The boards and Display have a really nice friction fit, everything is held nice and tight. The final step is to press the front over the whole thing and your done.

Participated in the
Epilog Contest 8

Participated in the
Design Now: 3D Design Contest 2016

## Recommendations

• ### Mold Making & Casting Class

22,344 Enrolled

## 47 Discussions

Awesome, will actually try to make this. However will it work on higher voltages then "7-15V"? like 24-48V?

The voltage limit is determined by the onboard voltage regulator on the nano and the voltage divider resistor values. I used an online voltage divider calculator to determine the values for the resistors in the voltage divider. Keep in mind that the range of voltage going into the analog read pin is 0-5 volts. Use a meter to measure and confirm this before connecting it to the Arduino. As for powering the arduino use a dc to dc regulator that can step down the voltage to within the max of the nano's on board regulator.

Love this! Very quick and easy to assemble, great instructable!

It would help a lot if you could include HOW to change the bitmap you have included, maybe link it to how the display works and how to get stuff to show on it.

I used Microsoft paint to make a bitmap image the size of the display resolution. Then used image to code software to generate the picture code. There is a tutorial showing all of this, I don't remember where it was. The arduino library wiki is also helpful. Google search should pop it up.

Very nice project, been looking for something like this for a long time now. I have the 5 amp and 20 amp sensor and need to change your code amps=((511-amp)*75.75/1023); . Could you tell me please how the part 75.75 / 1023 is build up so I can change it to (5 amp=185mV/amp or 20 amp=100mV/amp) thanks for searing your project.

The number 511 is used to bring the read value from the sensor to 0 from its typical resting midpoint value of around 511. Next you determine the number to put in place of 75.75 by dividing 5 by the scale factor for the version you are using. Example for a 30amp sensor the scale factor is 66mv so divide 5 by .066 to get 75.75. For 100mv it would be 50 and for 185mv it's 27.02.

Nice project! I assume it only measures DC power since you made it for a solar application?

7 replies

the ACS module can sense AC current quite nicely as well. I'm currently using it in a project where the two input leads are simply connected in series with the live wire from a wall outlet.

Can you please share how do you calculate the AC amp value?

the same way you would calculate the DC current...you just end up getting a sinusoid on the output of the ACS rather than a DC signal. you might have to add some DC bias to the signal so as to make sure you are not feeding negative voltage into the ADC pins of your MCU, though.

As far as I know there no negative voltage on the output. With an AC signal, we have an offset of 2.5Vdc. As a result you get 2.5V for a zero current and 5 or 0 V for the maximum.

The theory is that you have to measure the RMS value of several points. Using Shanon, you obtain 2 x 50Hz (or 60Hz for US). That means 100-120 Hz. So if you sample it on the rate bigger than given - it's ok.

Another way vould be to sample it higher and get the max value (Vpeak), after what multiply it by 0.707 and get the RMS value. But the Arduino ADC will not allow you to sample at 1kHz.

you are correct about the offset on the output signalnot sure exactly what you're getting at with the sampling theories. what i'm doing in my project is taking a fixed number of samples where I measure the maximum value of the waveform coming into the MCU. then, using the average value of the max, I calculate the RMS value using max/sqrt(2).

What do you have for sampling rate? It's not eays to surely get the Max value

Thanks, Yes it works with 7-15 volts DC and can measure up to 30 amps of current. The voltage range is determined by the on board voltage regulator on the arduino nano.

I've been thinking about the same concept, but then an AC wattmeter with those IC's. But... They measure the magnetic field inside the IC, so, with AC, the magnetic field switches polarity. 50 times a second... Then you should sync your measurement with the frequency of your line. Since the device is in series with your (household appliance) load, you can't really rectify it. Anyone some ideas about this? Oh... A 2% resolution would be fine...

2 replies

As far as the modifications for an AC version there isn't much.The output from the acs712 never goes negative since at zero current it sits and the halfway point of 2.5 volts. It's really a matter of writing code that will find the highest value from the sensor then use that in the formula to convert to a current value. And to get the given voltage at the time I would rectify the AC then use a voltage divider configured for the voltage range of AC. Then multiply these two values to get watts. Also the power wiring for the arduino would have to be modified to include a DC power supply.

This is the first result in Google when searching for AC current acs712 tutorial. http://henrysbench.capnfatz.com/henrys-bench/arduino-current-measurements/acs712-arduino-ac-current-tutorial/

here is some info about the 1.5% total accuracy of the ACS 712. There is also a link to the datasheet describing how chopper stabilization and ratiometry influence the overall and specific accuracy.

http://embedded-lab.com/blog/a-brief-overview-of-allegro-acs712-current-sensor-part-1/