Hi
I am working on a project with the Raspberry Pi where I want to read the battery value from MightyBoost. I'm considering using 10bit ADC converter MCP3008/IP
http://www.farnell.com/datasheets/808965.pdf
that I have lying from a previous project instead of using a Moteino.
I have found that port A7 is analog in the source code for MightyBoostControl.
https://github.com/LowPowerLab/RFM69/blob/master/Examples/MightyBoostControl/MightyBoostControl.ino
Is it possible or am I out on the wrong track. :-\
If it's possible are there any consideration I must have in mind.
//Niklas
If I understand this right, you want to read the battery level from the MightyBoost voltage divider pin (A7). This runs through a divider like this: VBat > 4.7K > A7 > 10K > GND. So the VBAt is divided through a 10/14.7 ratio, and that divided voltage is present on A7 for the Moteino to read. Moteino is a 3.3V device so that's why there's a divider, to be able to read voltages greater than 3.3V.
I imagine you have to use some sort of microcontroller with your own ADC converter to read that value?
YES you can certainly do that. So ... I think that answers your question?
Felix thanks for the fast reply.
This will help me allot.
I will use the raspberry py to read the value from the 10bit ADC converter(MCP3008/IP) http://www.farnell.com/datasheets/808965.pdf .
//Niklas
Sure, you should be able to do that since the Pi is also 3.3V just like the Moteino. Just use the ratio to arrive back at the actual real voltage.
I have the need to read the battery voltage for a different reason. Riding through a power bump is great. But what happens if your power bump lasts longer than your battery life for the RPi? Can the ATXRaspi be programmed such that when the battery starts to sag it will issue the shut down message. I am using my RPi at a remote location that looses power for several hours. And of course the reverse is needed. I need to restart the RPi after the power stabilizes say 15 minutes. I hate to put in another micro controller just to monitor power. Any ideas?
Hi I use the MCP3008/IP to messure the voltage and a transistor BC 377 hocked up to the ATXRaspi to simulate a button press, when voltage drop to say <3.5v a python script sends a signal to a GPIO pin hocked up with the transistor and simulate a button pressed for 4 seconds for shutdown. It would be more easy if you could send a shutdown message to the ATXRaspi but i don't think it's possible.
Guys, ATXRaspi is just a switch.
For any advanced stuff use a MightyBoost, which you can mate with a Moteino for ultimate control and do anything you want, also the code is available to tweak and hack to your needs.
Sorry my bad I forget to mention that i use MightyBoost to control the battery, but in my defense, the question was asked in the Mighty Boost category :).
But instead of using Monteino that you have to program I use a ADC converter (MCP3008/IP for the price of 2$) and let the Raspberry Pi measure the voltage direct from that.
And yes I use ATXRaspi only to control the power on off.
This solution is working fine for me, and is a little bit cheaper solution, I don't mean that the Monteino solution is expensive its it is very affordable but i don't like to have one more thing to program and update when i only need a rasperry pi.
//Niklas
Niklas, your setup makes sense and is an interesting variation.
Between ATXRaspi, MightyBoost and Moteino, there's a lot of flexibility.