![]() ![]() ![]() ![]() ![]() Alan numitron clock Clapclap 2313/1386 SNES Pi Webserver USB Volume/USB toys Smokey amp Laser cutter WordClock ardReveil v3 SNES Arcade cabinet Game boy projects cameleon Home Presence Detector ![]() AlanFromJapan ![]() ![]() ![]() Akizukidenshi Elec-lab Rand Nerd Tut EEVblog SpritesMods AvrFreaks Gameboy Dev FLOZz' blog Switch-science Sparkfun Suzusho Datasheet Lib Reddit Elec Ermicro Carnet du maker (fr) |
WhatAWattLast update: Thu Jun 5 22:25:41 2025
Foreword and purpose![]() Idea is to have a small plug that tells you how much power you are currently drawing from the wall. No need of PC interface, no need of crazy design, no need of sub-millisecond precision. It will use the board for 7segments Rapide7seg I made recently (it has on a ATmega xx8), and a current sensor from Seeedstudio (buy / doc wiki). That should do the trick, right ? Result : working not bad at all! According my tests it's slightly underestimating the consumption, but nothing crazy. Didn't found the reason why, but the box is still reprogrammable because of the accessible ISP so in case one day... SchemaNothing formal : just plug the current sensor before the output plug (wire it to GND and ADC5) to the ATmega88, use the formula in the seeedstudio wiki and use the Rapide7seg.h to display. Very straightforward.CodeAll is here : http://code.google.com/p/alanarduinotools/source/browse/trunk/#trunk%2FAtmegaxx8%2FWhatAWatt![]() The main loop just take care of initializing the different parts and then displays the value on the 7seg (using POV, you can drive just one 7 seg at a time). The real interresting job is done with a timer interrupt : TIM0 a 8 bit counter running on a 8MHz CPU with a 256 prescaler will timeout every 8ms or so.
So you have your TIM0 overflow interrupt running at 122 Hz (means triggered every 8ms). According Mr Shannon , that should be enough to find local maximum of a sine at 50-60 Hz AC (according Japan power company). So read a bunch of values, make an average and there you go, you have your max AC over the period. You can then average it with a few other values and you'll have an acceptable estimation of you AC consumption. Use then the seeedstudio wiki to get the current equivalent, multiply by the AC voltage and you get the power (Watt) consumption. Pictures![]() Tada ! ... yes I know the hole for the ISP was a big fail. Once again, blunt force is not the solution. ![]() The box opened with the wallwart internals on the left and the board back on the right. ![]() The box showing 13W consumption Links and inspiration
|
||||||||||||||||
All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated) electrogeek.tokyo ~ Formerly known as Kalshagar.wikispaces.com and electrogeek.cc (AlanFromJapan [2009 - 2025]) |