Tuesday, October 5, 2010

Yarrduino Power Meter

Alright - My first ever Arduino project up and running. Nothing too fancy; I just took an LCD I had lying around (HD44780 chipset) and patched it into the Freeduino board by way of a breadboard. The Arduino software is kind of neat; though it is written in Java (ughhhh), it runs like a hot damn and is well laid out.

I started off with the "Hello World" LCD example code and merged it with the "AnalogInSerial" A2D example code. The result printed out a reading in raw A2D values on the LCD, which, with just a little bit of black magic and some grade-school arithmetic was converted into a 0-5V DC voltage reading. This reading was then used to compute the current in amps (measured by the CT), which was then spit out onto the LCD.

The next step will be finding a way to measure the AC line voltage accurately and safely, and next in line comes the addition of data logging capabilities. At a glance, writing data to an SD/MMC card appears to be fairly straightforward as far as software is concerned, and from a hardware perspective it involves nothing more than a few resistors to eat up the difference between the +5V TTL on the Arduino and +2.7-3.3V the SD card operates on.

As always, comments and suggestions appreciated; source code and schematics free by request.

Also: I owe thanks to Limor and the Adafruit gang - I lifted the LCD connection schematic from her website: http://www.ladyada.net/learn/lcd/charlcd.html

1 comment: