Shop OBEX P1 Docs P2 Docs Learn Events
Properller ADC0831 Voltmeter — Parallax Forums

Properller ADC0831 Voltmeter

TrevorTrevor Posts: 8
edited 2007-03-13 23:29 in Propeller 1
Hello,

As part of a larger product I am using 7.4V LiPo packs to power a unmanned ground vehicle. Part of the requirements of this project is that the battery voltage be monitored, due to the volatile nature of LiPo's when they drop under voltage. Because of this, I need to be able to read the Voltage level from the batteries and broadcast this information back to a ground station, the communications side however is already complete.

My goal is to employ an ADC0831 A/D converter to read the voltage levels, likely using a voltage divider to scale the voltages going to the Prop down to the correct levels (0-3.3V).

Searching around a bit, I found several examples of this being accomplished on the BS2 platform, employing the BS2 SHIFTIN functionality. Fortunately, thanks to the object exchange and Martin Hebel's BS2 Functions object I am fairly sure I can replicate the BS2 functionality on the Propeller, my goal being to model my voltmeter off of the attached BS2-orginated schematic.

In either case as I continue to tinker I figured I would see if anyone else out there has done this already using the Propeller and could offer any hints or suggestions.
358 x 273 - 5K

Comments

  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-03-12 20:22
    Hello Trevor,

    I just read the AN001 - Propeller Counters v1.0

    There, on page 17 - 18, is a breathtaking design showing how to build a Sigma/Delta A/D converter using a Cog's internal counter, two I/O pins and a few resistors/capacitors. I would try that before anything else. And the code is there. Not much work. Sigma/Deltas used to have lousy DC performance and I have not seen any specs on this one, but I would definitely test it to see if it can be used in your application.
  • BergamotBergamot Posts: 185
    edited 2007-03-12 20:37
    I can't imagine he'd need extreme speed (the voltage would drop pretty slowly) or precision, so sigma-delta ADC should be fine.

    It's a heck of a lot simpler, though, just to get a cheap ADC chip and let it handle all the messy details.
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-03-12 21:08
    I see your point, but I disagree.

    The beauty of the Propeller is (in my eyes) that it contains a set of peripheral controllers that can be made to function as anything you want it to be. Well, almost. The resource most likely to be scarce in a Propeller is the I/O and the three pins used by the ADC0831 is 50 % more than the two pins used by the Sigma/Delta. And the code is there, just to download. Couldn't be simpler or better.

    Speed is not needed, right. But it doesn't hurt either. Especially if it comes for free. Noise filtering can be handled in SW.

    I have only recently been exposed to the Propeller arcitecture and I have no experience using it. But cluttering such a fine design with unnecessary peripherals seems to be a bad choice.
  • T ChapT Chap Posts: 4,223
    edited 2007-03-12 21:31
    Ahh my old friend scosgurra, the man that banned be off the eng tips forum. You haven't even plugged in a Propeller and you are already giving lectures on it's use?

    Post Edited (originator) : 3/13/2007 7:45:21 AM GMT
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-03-12 21:42
    Hello Originator!

    Reading the book says a lot about the Propeller. And I have done quite a lot of reading.

    My first experience with micros was the intel 4004, that has made me very sensitive to bad solutions or, to see it the other way, happy when I see good solutions. Like the Propeller.

    Post Edited (Skogsgurra) : 3/13/2007 11:19:31 AM GMT
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-03-12 23:18
    More important than the speed of the delta-sigma method which is pretty high anyway is the precision. But that said we should not pretend that Lipoly cells can really tell 3v and 2.999v apart.

    One other thing, since when are they volatile when undervoltage? You can damage them yes but you make it sound like over discharging endagers life and limb.

    Graham
  • TrevorTrevor Posts: 8
    edited 2007-03-13 18:21
    A few things,

    The reason that I had intended to use the ADC0831 ADC is because I already have a few of them from using them with LM34 temperature probes. In regards to the danger of the LiPos, the danger is primarily to the battery which is considerable since I am working with a tight budget and can not afford to replace the batteries.

    In either case, the project contains safeguards that will shut down the batteries before they reach a critical voltage, however part of the orginal requirements was that the battery voltage be able to be monitored from the vehicles control station, so even though it is not entirely necessary from a practical standpoint, we have to fulfill the requirement (it's a school project) so it has to be done one way or another.

    In either case, thanks for the tips, I'll definately look into the Sigma/Delta method.
  • SawmillerSawmiller Posts: 276
    edited 2007-03-13 18:56
    one thing to beware of.... make sure that you always use the voltage divider circut if you do the sigma delta....
    i didnt one time ( test,rewire , test,rewire snarl) and blew the prop... intirely my fault, but easy to do if you breadboard as i did.
    now the prop will just blink leds, no extra cogs or difficult functions allowed tongue.gif
    fourtunately i have several
    dan
  • JohnBFJohnBF Posts: 107
    edited 2007-03-13 23:29
    I'm using an ADC0831 with a propeller to read an ADXRS300 rate gyro (which reports rotation as 2.5 volts +/- clockwise or counterclockwise rotation). It took about 5 mnutes to wire it up. Then I used the BS2 code from the chapter of the Parallax book Basic Analog and Digital on making a digital voltmeter, and modified it for Spin, replacing BS2 commands with BS2_Functions calls. That took another 5 minutes. It worked perfectly right off the bat. I have no idea if it's the best solution, but it was certainly easy and it certainly works.

    /John
Sign In or Register to comment.