Battery monitor for arduino nano.

Advice on general approaches or feasibility and discussions about game design

Re: Battery monitor for arduino nano.

Postby rodot » Sun Mar 15, 2015 1:13 pm

Both schematics should work, but I would prefer Myndale's solution as it uses the internal regulator (so it's easier and cheaper).

Note that to measure an analog voltage the input impedance should be 10kR or less. Here you use 1MR which will give you inaccurate readings. That's because to read the value of the voltage applied to the pin, the microcontroller first charges a small internal capacitor, and then measure the voltage of the capacitor by counting how long it takes to discharge it. If the input impedance is too high, the capacitor won't have time to charge completely during the sampling time, and you'll get pretty random values. So there is two different solutions :

- Replace you resistors with 10kR resistors, but it will consume more current. Not good if you run on battery.

- Add a capacitor between the pin and the ground (like on the Gamebuino) so it will charge between analog readings and the provide enough current when you want to read the value. This solution works because the signal doesn't change quickly and you don't read the voltage continuously. That's the solution used on the Gamebuino :
Battery.PNG
Battery.PNG (4.86 KiB) Viewed 2190 times
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Previous

Return to Project Guidance & Game development

Who is online

Users browsing this forum: No registered users and 25 guests

cron