mBuino program that shows how to read VCC using the blink of a LED
mBuino PowerMeter
This program shows how to read the current voltage on the 3V3 (VCC) pin of mBuino using the blink of a LED.
Since mBuino uses the VCC voltage as reference for analog reads, all readings are relative. To get an absolute reading an external reference voltage is needed. An easy way to get an external reference is by using a zener-diode with proper characteristics.
Not having such a zener around made me look for alternatives. I found some on this page: http://www.talkingelectronics.com/projects/200TrCcts/200TrCcts.html#52
Use a LED!
The most interesting method I found was to use the LEDs on mBuino! All needed to use this is an extra connection. I used a 100R resistor as connection between pin 14 and LED6. Pin 14 is the small dot right above the one of the version number. Alternatively you can also use an external LED or (zener)-diode. The picture below shows both the added resistor as well as an external LED/resistor circuit.
Serial USB
The picture above shows a USB cable connected to mBuino. When mBuino is powered via USB and nothing else is connected to VCC, power comes from the 3v3 regulator. The VCC reading will then be around its maximum. USB is used to display the readings on the USB serial console. Note that for this the USB serial driver and a terminal application such as Putty is required. When using the console the spacebar can be hit to switch between pin14+LED6 and pin15 with an external LED/resistor via pin4.
See the code comments for more information.
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
4:853634e0d433 | 2015-08-07 | maxint | added some comments |
3:9e93f14db34d | 2015-08-02 | maxint | small fix of incorrect call |
2:7a501b777146 | 2015-08-01 | maxint | added program homepage-url to comments |
1:0434198567a4 | 2015-08-01 | maxint | Updated comments, cleanup |
0:5ed29b03d6ce | 2015-08-01 | maxint | mBuino PowerMeter.; Measure VCC using flashing LED |