Shop OBEX P1 Docs P2 Docs Learn Events
Voltage monitor — Parallax Forums

Voltage monitor

ArchonArchon Posts: 2
edited 2009-09-08 23:07 in Propeller 1
Hi, I am part of the Bluefield State College robotics team and we are currently working on integrating a propeller into the our newest robot. This forum and the entire parallax site has been a great help and I think the chip will work very well for us.

There is still some information I haven't found yet. A voltage monitoring system needs to be integrated into our propeller based controller to stop the robot if the batteries get too low and to give us current battery status. While I've found alot about analog outputs on these chips I have found little on inputting an analog signal to a propeller. Is it possible to just tie an input to the battery (with the correct voltage levels) and the propeller convert that to a digital value? Or does there need to be a circuit to convert the analog signal to a digital signal the propeller can understand?

If there is any spin code available that works the same way a link to that would be great too.

Comments

  • 4Alex4Alex Posts: 119
    edited 2009-09-08 14:44
    Good morning Archon,

    If you are using Lithium-Polymer batteries, there's several ICs that monitor the charging and the voltage, most can be queryied for current voltage. If only a defined low voltage level alarm is required then you could use voltage monitoring ICs like the one used as mcu supervisors: they provide an active low (or high) when the set (or preset) voltage is reached. Some are also programmable.

    Cheers,

    Alex
  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-08 15:21
    Download and read the application note on the cog counters (AN001). You can find this on the Propeller Downloads page. Among other things, it discusses how to do analog to digital conversion using just a couple of passive components (2 resistors and 2 capacitors) on a pair of I/O pins.
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-09-08 15:33
    If you need only to know whether the voltage is above or below a certain level, you could use a comparator or even a Schmitt trigger.· If you want to know the actual value, you will need an A/D converter and somewhat greater complexity in the programming.· None of these is particularly difficult, though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • photomankcphotomankc Posts: 943
    edited 2009-09-08 17:15
    An RCTime circuit has been working pretty well for me to do the A/D conversion using the SAMRCtime object in the object exchange. I convert the raw clock ticks for the capacitor to recharge to microseconds and use that to measure the battery voltage. Be aware that while is fairly simple to create a trip-point to shut-down, it gets loads more complex to actually provide a percentage left of the charge. I largely gave up on that since my device powers loads that are unknown to it. The best I have managed to do is sense when a load is greater or less than about 370mA by calculating the voltage drop that occurs when the load is switched on·and move my green/yellow/red/dead indications up or down accourdingly.

    Also take into account that batteries rebound in voltage significantly when they are not under load so you have to make sure your design or program latches to it's tripped state even if the voltage bounces back up by a volt. My NiMH pack of 6AAs will bounce back from 6.05V to over 7.0v when the load is removed from them. After a few hours they will reach 7.2 or more.

    Post Edited (photomankc) : 9/8/2009 5:21:36 PM GMT
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2009-09-08 23:07
    Attached is a schematic of the wiring I use on one of my projects to check the current battery voltage, input charging voltage, and even my 3.3V rail (I have also used it to check my 5V rails). And then use my ADC Object to get a value and setup a threshold value or determine potential remainder or actual voltage.

    I have also, in the past used a very simple RC circuit to get a rough approximation (very rough) of current voltage. It works best (most linearly) with high input voltages.

    The cost of the ADCs are low enough that the precision and support available for them outweighs foreseeable problems with them. Ultimately using ADCs with the Obex-supplied drivers is very easy, and worth while.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!
    1263 x 645 - 81K
    501 x 273 - 13K
Sign In or Register to comment.