Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
United Kingdom
Asked — Edited

Battery Level Sensor

I'm struggling to find any info on how to make/connect a battery level sensor for the EZ-B.

Basically, I want to be able to have the EZ-B know when the battery is getting flat so it can then run the script to make the bot find the charging station and plug itself in. Also, when fully charged to unplug itself and go about it's business as usual.

The programming side I assume is pretty straight forward but what I need to know is how can I get the EZ-B to read the battery charge level?

If it makes a difference I plan to use sealed lead acid batteries (2x6V 12Ah).


Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

AI Support Bot
Related Content
EZ-B has analog inputs for sensors and just converts the input to a number between 0 and 5v. You can use that number to equivocate true battery level. The problem is what do you use to go from the battery to the input (don't want to fry the board). Perhaps a simple battery monitor that sends a signal to an LED to indicate level, then from the outputs to that LED to the input of your AI on the EZ-B You could put a meter on the indicator LED to see what the voltage reading is as it changes color. Just a thought. I am sure there are probably easier ways to do it, but I'm just a jerry rigger and not an electronics whiz.

This is one I am using on my Mini B9 -
battery indicator - 12V
It's pretty cheap.
Ooh! These are cool! I emailed them for a bit more details on 6v. Units.
United Kingdom
If memory serves me correctly (and it may not, I'm digging in to memory that's not been used for over 15 years) the voltage of a 12V SLA battery drops to around 10.5v when nearly dead and up to 15v when charging, so I'd guess a 6V drops to about 5-5.25v when dead and 7.5v charging, so as long as I can get that info from the battery to ARC somehow (via the analogue inputs maybe? I forgot about them) I can monitor the battery.

Auto charging isn't a deal breaker on the bot but it would be a nice feature.
United Kingdom
Out of the blue my electronics knowledge come to me and I remembered how to build a voltage divider, which is needed if the ADC ports can't take more than +5v.

I assume this will work but if anyone can see any problems please feel free to flag them up to me.

A basic voltage divider
User-inserted image

Vo to an ADC port for the signal.

As I plan to use either 6v or 7.2v halving the voltage (3 or 3.6v) should be fine through the ADC ports right?

Then just look at the battery data sheet to see the discharge curve, depending on battery type I choose, and write the script to suit so when Vo drops to a value which indicates it's almost dead it'll run the code to find the charging base and make it's way to it.

Does anyone see an issue doing this?
RICH that was the same idea i posted on MEL'S POST on AI SOFTWARE but missing a zener for protection for A-D AND A-D has a range of 5-0 volts
also you should have 100k going to the a-d to limit the current
So thats the problem i see with it
there is a much better circuit little better accuracy i can design ,but for this robot it will work fine
i also design a automatic gel cell charger with very high current charging 24 volts or less plus with C rate adjust and had a board made for it made for my computer controlled home base design if you or anyone else needs it
United Kingdom
Just out of interest, why would it need a Zener for protection of the ADC? I've not seen any voltage divider circuits use a Zener and can't understand what you would protect the ADC from.

The home base I'll just be using an off the shelf charger with modified connection to the battery but if that changes I may be interested in your circuit.
just a added protection in case of a surge, same idea they for for relays a diode
also incase the battery is hook up wrong,dnt forget you have 12 volts going in and 5 max on adc input anything can happen on the divider
its just good safety practice,
some ADC inputs need a cap in parallel with the 100k current limiter resistor for noise
i know motorolla cpu's use this idea ,

also another idea when charging a robot,not good to charge the robot with a load on like if using a EZB or ITX BOARD,because of a few reasons mostly the charger wont charge the battery correctly
so you need a relay and a small battery to keep power to your boards or have it start up again

ON mine i have a small battery,i first connect the small battery first and then disconnect the second main battery and charge it
size of the battery is how much load and then hours of the charging of the main battery
United Kingdom
I have a 6V supply not 12V.
If a resistor fails on the divider it open circuits so would give Vo 0v.

Good idea or not, I will be charging with the robot on, so charging with a load. It wont cause problems with the battery, practically everything I own that's rechargable is charged while on. I've seen many examples of batteries being charged with a load and no reported issues. I'll be taking that risk.
ok but
just some good advice about how most charging systems work,the have a current circuit (sense resistor)
and is senses the load so battery has some load and your system as another load it wont charge it right,now it wont hurt the battery or your design is having the charger on ,only it takes longer time charging ,like having 2 resistors in parallel or 2 batteries in parallel

I thought you are using a 12 volt battery ,6 VOLT should be fine without a zener
but you said if a resistor fails thats not really true ,bottom leg of the resistor going to ground opens you get full voltage into the ADC
On your 6 volt circuit if your battery fails it gets a full 6 volts ,i am thinking wont hurt it

Second item i dont know if you are using a itx board ,when when you hook up a battery to be charged. it does sometimes causes it to reset,and if only using the EZB IT MAY CAUSE IT TO RESET.

So i would first test it disconnect a charger and then reconnect it,and see if anything resets
that the other reson to have another battery
there are other ways too,like a special cap on the relay contacts another i think its called a azorbing cap or diode.been awhile since i ever used one ,forgot the full name
it fixes spikes

i see you said you are using a 6 volt battery to power your EZB not great idea
I heard DJ said that 7.4 battery is needed
here is the reason regulator is a 5 volt regulator and there is a voltage drop i think its .4V since he change to a LDO (LOW DROP REGULATOR) it might be more ,without looking at the data sheet ,that meens only have about .6 volt left over
plus drop out voltage is 5.2 volts on the battery

here is how to work out drop out voltage on a battery before it needs to be charged
its .2 volts per cell so 6 volt has 4 cells and drop out .8 and on 7.4 volt rc battery its 5 cells at .10 volts drop out
United Kingdom
6V works fine provided my connection issues are bluetooth related, it's something I need to test and using a 7.4 LiPo isn't entirely out of the question yet (battery type & size is something I will be looking in to over the Christmas break)

7.4 is more stable if you have a big load on the EZB, as my hbridge uses a direct battery connection for power to the 2 DC motors all the EZB is powering are 4 or 6 standard servos (depending on how I get on with the elbow servos or if I reuse the original plastic linkage.

No ITX boards are being used. ARC will run in the background on one of the pcs around my house, most probably the HTPC as that's currently where it is and has shown no issues so far. If it does then it'll be on the automation pc which is far too overpowered for it's purpose.

There isn't a lot of space in the robot to fit spare batteries or back up batteries which is why I'm not going to bother with having a change over switch for when charging etc. On future projects that'll probably change though but this one is just a basic project without too much being put in to the finer points.
Ok then that makes good sense now
LIPO is one of the best batteries for robots ,since i use them sometimes it saves on weight,but some drawbacks

On the charging design it is different it CC (constant current) and CV (constant voltage)
on most other chargers only need CV

But still if you do the math for a 6 volt battery and LDO thats used in EZB 6 volts - .4 volt drop out thats 5.6 your battery will work down too,before the board has issues ,like 5.5 volts you will see the regulator wont be regulating.
and low battery is 5.2 volts so only .2 volts of your battery will you design work to till battery goes dead.