
pacomms
This is really a question aimed at DJ but if anyone else knows the answer please chip in, i want to know how i can use an ADC port to monitor the battery voltage on my 6v battery, my idea is to write a script that will for now just say that the battery voltage is low, by speaking through my laptop, my eventual aim is so that when the roborealm module is done he will sense the battery is low and head for a home base by using the navigation module in roborealm.
Thanks
Kurt
Thanks
Kurt
Then run a script like this
IF (ADC(ADC0) < 3)
The EZ-B will excute the next line if the battery voltage falls below 3 (ie 6volts). Adjust this value to see what works best. The total current drawn off the battery with this arrangement using ohms law would be only 0.0003 amps or 0.3 ma
Please pardon my ignorance as I'm totally new to circuitry. It looks like the ADC port utilizes a 3 wire connection. Your diagram only shows one wire. Which one is it and what did you do to the other two? And just to be clear, this setup is place between the battery and the EZ-B, right?
I'd like to utilize this along with a simple script for an LCD screen which could display a low battery warning.
Thanks in advance!
You are correct the EZ-B has 3 wires to any port +5 volts, ground and the signal wire. Yes and it does go between the battery and the EZ-B
In this case we aren't powering anything like a servo so we don't need the +5v and GND wires, just the input lead sensing the voltage level on the main battery I have called it PSU in my diagram before it gets regulated by the EZ-B board. On the V3 board its the outer pin of any input port A0 to A7 that gets connected to the resistors if you use a servo lead just snip the other 2 off
Thanks
Kurt
Hence the high value of the resistors they won't drain your battery are they are in effect shorting it out
OK now?
For 5A max in/out
For 20A max in/out
For 30A max in/out
Pay attention to the 3-pin connection on these, they're in a different order than on the EZ-B.
For higher amps, I would go non-invasive with one of these guys:
Non-Invasive Hall Effect Current Sensors
so......i want one of those....i see it has a 3 pin connector. can you maybe post up some pics on your set up once you get it going. this would look perfect in front of my wall-e
I am already using the 5v pin to AD0 and using ACD READ to show me what the voltage load is like when I am testing things out.
I would like to do the same thing for the Vin to AD1 and add another ADC READ showing me the incoming voltage to the EZ-B. How would I go about determining the value of the resistors I would use for say 12v-18v?
Or perhaps, someone could tell me what is the technical term for this circuit and I could Google it to check out myself. Thanks
It might even be simpler then this... If someone knows more, please enlighten me... sometimes I know just enough to be dangerous
The 2 resistor circuit is called a potential divider which in your circuit is neatly cascaded into two potential dividers. Although I would expect 18v to be divided by 2 so instead of 7.2v you would get 9volts and then 9 divided by 2 you would get 4.5volts. So within tolerance for the EZ-B. The current flowing through the resistors should be the same though in each arm. Best to build it and see what you get with a voltmeter before you connect it all up. Great way of learning stuff))
EveryCircuit
that will come in very handy
Thanks for checking it out... I need to purchase the resistors and, yes, breadboard them before committing to the EZ-B... must keep the magic smoke in
@pittom It is a handy little app isn't it... so easy to use and visual... I love visual, soaks into the grey matter easier
I rigged up a test curcut using the highest value resistors I had on hand, 510 Ohm, And matched the real world results with the simulated ones.
Then I tied the curcut into the EZ-B on ADC7 and fiddled with the Unit Multiplier untill the resulting value matched my multimeter. I am sure DJ has a formula that is to be used, but I ended up with 0.09693
Now I can monitor my battery level within ARC.
Such a simple thing... but makes me happy to have worked it out
I didnt know there was a unit multiplier on the ADC control thats handy
Interesting to know if the measurement tracks correctly your battery voltage? I guess it must do and you should be ok to safely measure voltages up to 20 volts
Here it is all soldered up and shrink wrapped.
BIG EDIT *blush* I had set the port number to ADC7 when it should be ADC1... now it reads properly all around. But it is interesting that other ports should have such "quasi correct" but fluctuating readings when they aren't even hooked up to anything *confused*