Shop OBEX P1 Docs P2 Docs Learn Events
Real Wind Power — Parallax Forums

Real Wind Power

riverdanriverdan Posts: 21
edited 2007-09-24 15:34 in BASIC Stamp
I have built a real wind generator that turns up to 30vdc with solar panels up to 20vdc, I have 4 large 12vdc 92Ah batteries. In the experiments for new energy I can·only read up to 5vdc in the Stamp Plot Ver 3.7. I am not so concerned about the real volts. I just want the chart to read linear in respect to the real volts. Please I need a bs2 code to start on to read these volts in real time. I can use TLC0832 ADC, TLC0834 ADC, or TLC0838 ADC.
·
Thank You for your time.
·
Riverdan jumpin.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-21 14:18
    You need to "step down" the 0-30V range to the 0-5V range since all of these parts (and the Stamp) are designed to work with a 5V power supply and none of them can measure voltages over that directly (and will be damaged / destroyed by directly connecting to any source outside of 0-5V).

    It's very simple ... you need a voltage divider (see en.wikipedia.org/wiki/Voltage_divider). It's just two resistors in series across your power source: +V --- Upper resistor --- Lower resistor --- Ground. The Stamp's circuit or the input of the ADC is connected to the junction of the two resistors. Because you may want to measure different ranges, get a 10-turn potentiometer with a 10K ohm value, connect it across a known voltage source ... like the 5V supply of your Stamp ... and adjust the potentiometer until the voltage at the adjustable terminal (to ground) is 1/6 of the voltage across the potentiometer or whatever ratio you need for your measurements.

    The Basic Analog and Digital text (here: www.parallax.com/detail.asp?product_id=28155) shows you how to use the TLC0831 and also shows you how to measure voltage directly with the Stamp. This website also has examples of this: www.emesystems.com.
  • riverdanriverdan Posts: 21
    edited 2007-09-24 14:40
    Is there a simple bs2 code to plot 0 to 5vdc analog. Thanks to Mike I have all the other input voltages down to the 5 volt range.
    I wold like this to be a direct input not A/D

    Tahnks Riverdan
  • riverdanriverdan Posts: 21
    edited 2007-09-24 15:34
    Here is a code i changed.
    This code works from 0v to 3.37v then it goes back to 0volts on stamp plot, then at 3.37v it plots down to 0v OK.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    pot VAR Word 'Variable for BSAB pot
    PAUSE 500
    DO
    HIGH 7 'Read pot and send value
    PAUSE 10
    RCTIME 7, 3,pot
    DEBUG DEC pot,13
    PAUSE 100
    LOOP 'Repeat
Sign In or Register to comment.