Voltage checker for Basic Stamp II robot project

Hello, I am working on a outdoor all-terrain robot. The robot is pwered by 6V NiMH batteries that are charged by solar pannels (I guess like the Mars
rovers). Anyway, I need a small 6V... voltage checker circuit to be momitered by the BS2. My idea was if the battery pack voltage dropped below a certain level (say 6V) then the stamp would put the robot to sleep allowing the solar panels to recharge the batteries. The stamp would periodically wake up and take a voltage check. When the voltage got above a certain level the robot would resume it's activities. I would prefer an off the shelf circuit if possible. I could maybe stumble through making a small circuit myself if I had good explanation and examples. Can anyone recommend anything for this?
Thanks so much Richard
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Does the Stamp have an ADC input which accepts 0-5V? Then a simple resistive divider would do. Two resistors (say 10k, it's not that critical, but much lower values will draw appreciable current) in series between the battery +ve and -ve, connect the Stamp's ADC input between them. The stamp will now read half the battery voltage, which can go up to 10V or so without blowing up the Stamp. If you're getting a load of noise add a capacitor between the ADC and one of the battery terminals (perhaps 100n to 1uF) to smooth the readings out.
Tim
--
Did I really still have that sig?

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Tim Auton wrote:

Unfortunately, the last time I checked, the Stamp doesn't have an actual ADC input -- instead, you 'll need to use a simple rc circuit and measure the cap discharge time using pulsein (I think -- it's been a while since I looked at the stamp). Check the stamp docs for details.
You might consider moving up to a BasicX BX-24 or OOPIC for this application. The Stamp can't be beaten as a learning tool, but you outgrow it quite quickly. Both of the former devices can be programmed in a Visual Basic-like dialect, and feature true ADC (among a lot of other features). I think you'll find both the BX-24 and the OOPIC as easy to use as the stamp.
Hope that helps -- tAfkaks
--
(Replies: cleanse my address of the Mark of the Beast!)

Teleoperate a roving mobile robot from the web:
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
One simple solution is to use a comparator chip and reference Zener to pick a point that you deem as "low battery" and treating that as a digital input. One chip, one diode.
Cheers!
Sir Charles W. Shults III, K. B. B. Xenotech Research 321-206-1840
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On 26 May 2006 05:33:54 -0700, "Couldbeflying"

You might make a low voltage detector out of ~eight common diodes in series and a high value resistor to ground. The diodes will pass voltage above 5.6v, but not for lower voltages. Connect the diodes between the battery and a high/low pin on the chip. Below 5.6v no voltage will be applied to the chip pin. Above 5.6v the diodes wii start passing some voltage to the pin.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
shb*NO*SPAM*@comporium.net (Si Ballenger) wrote:

But won't the voltage at the pin be 5.6 volts below the supply? Meaning at a full 6V charge the pin will only be .4 volts? So it will likely register as a zero value in all cases?
Reading my Boe-Bot manual it says the stamp threshold input voltage is 1.4 volts. Anything over that is registered as a one, and anything below that is registered as a zero.
Creating a simple voltage divider with two resisters is likely to be your best answer. Just calculate the values so that the voltage you want to sense gets divided down to 1.4 volts. So if you want to sense 5.5 Volts, and the larger resistor is a 10K resistor then the other must be:
R = 1.4 * 10000 / (5.5 - 1.4)
R = 14000 / 4.1 = 3415
Rounding to a common value, we get 3.3K ohms and calculating back to the voltage with this, 1.4 / 3300 * (10000+3300) = 5.64 V so it's a bit higher than the 5.5 we were look for. You can adjust by using multiple resistors in series to get to the value you want or by using a pot that you adjust for the trigger point you want.
So you use a 10K ohm resistor connected to the positive power battery and to the input pin, and a 3.3K ohm resistor connected from the input pin to ground. It should read as a 1 if the supply voltage is over 5.6 and and 0 if it's below 5.6.
However, the above calculations are based on the assumption that the input pin has a fairly high input impedance and I don't know if that's true or not. It would just mean the resistor values would have to be a bit different if it's not true.
If you have extra inputs, you can use multiple circuits with slightly different resistor values to detect different voltage levels.
Also, it would be good if you could detect the charging current from the solar panels. If the bot isn't in a bright enough light to be charging the batteries, you might not want to stop. :)
You should as someone else suggested, be able to use a capacitor and a few resistors to create an RC delay circuit that you use with the RCTIME basic command. But I wouldn't know how to design that without experimenting.
--
Curt Welch http://CurtWelch.Com /
snipped-for-privacy@kcwc.com http://NewsReader.Com /
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Thanks Kurt, it works quite well. The logic state changes at 5.4V. This is good enough for me. Also, thanks to everyone else who responded.
Richard
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On 27 May 2006 04:59:25 GMT, snipped-for-privacy@kcwc.com (Curt Welch) wrote:

If the chip requires 1.4v to pick up, then try 6 diodes in series instead of 8. Does the voltage divider continue to draw down the batterys after the minimum voltage value is reached?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
My multimeter says the circuit is drawing 1.1 - 1.2 mAh when the Stamps asleep. Considering my solar panels will be producing at least 6W (500mAh), I think there will be no problems with charging.
Thanks again Richard
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Couldbeflying wrote:

Nit-pick: mAh describes a capacity; each mAh should provide one mA for one hour mA is a rate of electrical flow
Thus a circuit drawing 1mA, powered by a 500mAh battery, would run for three weeks.
- Daniel
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Sun, 28 May 2006 11:44:36 -0500, D Herring

I assume that is an "ideal" battery that maintains full output voltage until it is fully exhausted.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.