## gumstix-users

 [Gumstix-users] Voltage monitoring on Robostix From: Jason von Nieda - 2006-12-14 19:42:48 ```Hi all, I'm building a system that is powered by some Lithium Ion packs and which returns some telemetry about itself. One of the datum I'd like to return is the current voltage of the batteries. I'm trying to determine a good way to get this data using the Robostix and my current idea is to use a pair of resistors to drop the voltage of the batteries to 0-2.56v and use that as the input to the ADC using the internal reference. I'm not an EE and I don't even play one on TV, so I'd like some feedback as to whether this is stupid or not. My max input voltage from the batteries is about 14.4v, so I'm interested in measuring voltages from 0-15v. So, I was thinking something like: BATT----[1k Ohm]----[TO ADC]----[5.8k Ohm]----GND With the idea that that would scale my 0-15v to 0-2.56v (approx) for input to the ADC. Does this make any sense, or am I completely off base? Is there a much better way to do this? Jason ```
 Re: [Gumstix-users] Voltage monitoring on Robostix From: Dave Hylands - 2006-12-14 19:53:32 ```Hi Jason, > My max input voltage from the batteries is about 14.4v, so I'm > interested in measuring voltages from 0-15v. > So, I was thinking something like: > > BATT----[1k Ohm]----[TO ADC]----[5.8k Ohm]----GND > > With the idea that that would scale my 0-15v to 0-2.56v (approx) for > input to the ADC. > > Does this make any sense, or am I completely off base? Is there a much > better way to do this? You're on track, but I would drop it to the 0-5v range and not the 0-2.56v range. The internal voltage reference isn't particularly good. It can be anywhere in the range 2.3v to 2.7v and changes with temperature. By going to the 0-5v range, you can use a 3:1 resistor divider. You'll probably want to use 1% resistors. Also, you can only use the 2.56v internal reference on the rev 1131 robostix, unless you ligt the AREF pin (because on the earlier robostix, AREF is tied to AVCC). -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ ```
 Re: [Gumstix-users] Voltage monitoring on Robostix From: Leigh Gawne - 2006-12-14 20:54:13 ```Hi Jason, The potential divider network you will require will scale the input voltage (in this case BATT) by R2/(R1+R2). In the example you have given, R1 is the 1K resistor and R2 the 5.8K resistor. In which case, your scaling would be ~0.85. As you need this the other way around, swap the 1K and 5.8K in your example to give a scaling of ~0.15 (or use other appropriate values for the 3:1 divider mentioned below). Leigh -----Original Message----- From: gumstix-users-bounces@... [mailto:gumstix-users-bounces@...]On Behalf Of Dave Hylands Sent: 14 December 2006 14:53 To: General mailing list for gumstix users. Subject: Re: [Gumstix-users] Voltage monitoring on Robostix Hi Jason, > My max input voltage from the batteries is about 14.4v, so I'm > interested in measuring voltages from 0-15v. > So, I was thinking something like: > > BATT----[1k Ohm]----[TO ADC]----[5.8k Ohm]----GND > > With the idea that that would scale my 0-15v to 0-2.56v (approx) for > input to the ADC. > > Does this make any sense, or am I completely off base? Is there a much > better way to do this? You're on track, but I would drop it to the 0-5v range and not the 0-2.56v range. The internal voltage reference isn't particularly good. It can be anywhere in the range 2.3v to 2.7v and changes with temperature. By going to the 0-5v range, you can use a 3:1 resistor divider. You'll probably want to use 1% resistors. Also, you can only use the 2.56v internal reference on the rev 1131 robostix, unless you ligt the AREF pin (because on the earlier robostix, AREF is tied to AVCC). -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ gumstix-users mailing list gumstix-users@... https://lists.sourceforge.net/lists/listinfo/gumstix-users ```
 Re: [Gumstix-users] Voltage monitoring on Robostix From: Jason von Nieda - 2006-12-14 21:11:07 Attachments: Message as HTML ```Hi Leigh, You are correct, of course. Thank you for the clarification. Jason Leigh Gawne wrote: > Hi Jason, > > The potential divider network you will require will scale the input voltage > (in this case BATT) by R2/(R1+R2). In the example you have given, R1 is the > 1K resistor and R2 the 5.8K resistor. In which case, your scaling would be > ~0.85. As you need this the other way around, swap the 1K and 5.8K in your > example to give a scaling of ~0.15 (or use other appropriate values for the > 3:1 divider mentioned below). > > Leigh > > -----Original Message----- > From: gumstix-users-bounces@... > [mailto:gumstix-users-bounces@...]On Behalf Of Dave > Hylands > Sent: 14 December 2006 14:53 > To: General mailing list for gumstix users. > Subject: Re: [Gumstix-users] Voltage monitoring on Robostix > > > Hi Jason, > > >> My max input voltage from the batteries is about 14.4v, so I'm >> interested in measuring voltages from 0-15v. >> So, I was thinking something like: >> >> BATT----[1k Ohm]----[TO ADC]----[5.8k Ohm]----GND >> >> With the idea that that would scale my 0-15v to 0-2.56v (approx) for >> input to the ADC. >> >> Does this make any sense, or am I completely off base? Is there a much >> better way to do this? >> > > You're on track, but I would drop it to the 0-5v range and not the > 0-2.56v range. The internal voltage reference isn't particularly good. > It can be anywhere in the range 2.3v to 2.7v and changes with > temperature. > > By going to the 0-5v range, you can use a 3:1 resistor divider. You'll > probably want to use 1% resistors. > > Also, you can only use the 2.56v internal reference on the rev 1131 > robostix, unless you ligt the AREF pin (because on the earlier > robostix, AREF is tied to AVCC). > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > gumstix-users mailing list > gumstix-users@... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > gumstix-users mailing list > gumstix-users@... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > ```
 Re: [Gumstix-users] Voltage monitoring on Robostix From: Jason von Nieda - 2006-12-14 21:10:22 Attachments: Message as HTML ```Hi Dave, Thanks for the quick response, as always. I should have added that I also wanted to measure the voltage coming off my regulator board in addition to the battery voltage. We have a regulator that we use between the batteries and the Robostix that drops our 14v down to 5v for the Robostix and Gumstix. The system requires a 5v and a 12-14v power bus. I suppose that the regulator is either working or it's not but I'd still like to be able to keep an eye on it. Although, I guess the point is moot since the Robostix is going to give up the ghost if I give it less than 5v anyway? So, if I scale to 5v I should set up my ADC using ADMUX_REF_AVCC? Or in my case, with my old Robostix, I guess ADMUX_REF_AREF would be the same deal since it's tied to AVCC. And finally, you said "unless you ligt the AREF pin". I hope I'm not being obtuse but what is "ligt"? Thanks, Jason Dave Hylands wrote: > Hi Jason, > > >> My max input voltage from the batteries is about 14.4v, so I'm >> interested in measuring voltages from 0-15v. >> So, I was thinking something like: >> >> BATT----[1k Ohm]----[TO ADC]----[5.8k Ohm]----GND >> >> With the idea that that would scale my 0-15v to 0-2.56v (approx) for >> input to the ADC. >> >> Does this make any sense, or am I completely off base? Is there a much >> better way to do this? >> > > You're on track, but I would drop it to the 0-5v range and not the > 0-2.56v range. The internal voltage reference isn't particularly good. > It can be anywhere in the range 2.3v to 2.7v and changes with > temperature. > > By going to the 0-5v range, you can use a 3:1 resistor divider. You'll > probably want to use 1% resistors. > > Also, you can only use the 2.56v internal reference on the rev 1131 > robostix, unless you ligt the AREF pin (because on the earlier > robostix, AREF is tied to AVCC). > > ```
 Re: [Gumstix-users] Voltage monitoring on Robostix From: Andrei Rylin - 2006-12-14 22:13:08 ```You can't measure VCC using itself as a reference, you should set up ADC to use either internal reference or measure known external reference and from that extrapolate what VCC is. --- Jason von Nieda wrote: > Hi Dave, > > Thanks for the quick response, as always. I > should have added that I > also wanted to measure the voltage coming off my > regulator board in > addition to the battery voltage. We have a regulator > that we use between > the batteries and the Robostix that drops our 14v > down to 5v for the > Robostix and Gumstix. The system requires a 5v and a > 12-14v power bus. I > suppose that the regulator is either working or it's > not but I'd still > like to be able to keep an eye on it. Although, I > guess the point is > moot since the Robostix is going to give up the > ghost if I give it less > than 5v anyway? > > So, if I scale to 5v I should set up my ADC > using ADMUX_REF_AVCC? Or > in my case, with my old Robostix, I guess > ADMUX_REF_AREF would be the > same deal since it's tied to AVCC. > > And finally, you said "unless you ligt the AREF > pin". I hope I'm not > being obtuse but what is "ligt"? > > Thanks, > Jason > > > Dave Hylands wrote: > > Hi Jason, > > > > > >> My max input voltage from the batteries is about > 14.4v, so I'm > >> interested in measuring voltages from 0-15v. > >> So, I was thinking something like: > >> > >> BATT----[1k Ohm]----[TO ADC]----[5.8k Ohm]----GND > >> > >> With the idea that that would scale my 0-15v to > 0-2.56v (approx) for > >> input to the ADC. > >> > >> Does this make any sense, or am I completely off > base? Is there a much > >> better way to do this? > >> > > > > You're on track, but I would drop it to the 0-5v > range and not the > > 0-2.56v range. The internal voltage reference > isn't particularly good. > > It can be anywhere in the range 2.3v to 2.7v and > changes with > > temperature. > > > > By going to the 0-5v range, you can use a 3:1 > resistor divider. You'll > > probably want to use 1% resistors. > > > > Also, you can only use the 2.56v internal > reference on the rev 1131 > > robostix, unless you ligt the AREF pin (because on > the earlier > > robostix, AREF is tied to AVCC). > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get > the chance to share your > opinions on IT & business topics through brief > surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>; _______________________________________________ > gumstix-users mailing list > gumstix-users@... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > ```
 Re: [Gumstix-users] Voltage monitoring on Robostix From: Dave Hylands - 2006-12-14 22:46:12 ```Hi Jason, > Thanks for the quick response, as always. I should have added that I > also wanted to measure the voltage coming off my regulator board in addition > to the battery voltage. We have a regulator that we use between the > batteries and the Robostix that drops our 14v down to 5v for the Robostix > and Gumstix. The system requires a 5v and a 12-14v power bus. I suppose that > the regulator is either working or it's not but I'd still like to be able to > keep an eye on it. Although, I guess the point is moot since the Robostix is > going to give up the ghost if I give it less than 5v anyway? Well, the robostix will run all the way down to 3.3v (but not at 16 MHZ). There is a brown-out detector built into the ATMega128 which can be enabled and there are a couple of different trip voltages you can set. In order to monitor the 5v you'd probably need some type of precision reference voltage (you can get little 3 pin packages that have these in them), or since there is a 3.3v voltage regulator on the robostix board, you could run a wire from it to an ADC line. Then if AVCC drops, you'd see the ADC value increase (cause 3.3/4.5 is bigger than 3.3/5). > So, if I scale to 5v I should set up my ADC using ADMUX_REF_AVCC? Or in > my case, with my old Robostix, I guess ADMUX_REF_AREF would be the same deal > since it's tied to AVCC. On the 1131 robostix, you NEED to use ADMUX_REF_AVCC since AREF is no longer tied to AVCC. > And finally, you said "unless you ligt the AREF pin". I hope I'm not > being obtuse but what is "ligt"? That was supposed to be "lift" -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ ```