Electronics Help designing circuit for stamp module

Discussion in 'Modding' started by jgrade, 3 Jan 2006.

  1. jgrade

    jgrade What's a Dremel?

    Joined:
    2 Mar 2004
    Posts:
    534
    Likes Received:
    0
    Help designing circuit for stamp module

    I need help designing a circuit that will tell a stamp module to turn or off a pump based on TDS levels in water. What has happened is that the main unit has only on 1 IN left but I need to be able to create a range of TDS to compare.

    Here is the situation: A TDS monitor checks for levels of Total Dissolved Solids in water. The monitors that I am using have an alarm circuit that activates when TDS levels are >= the set parameter. The alarm is a normally open relay. What I need is to use 2 monitors together to create a “range” of TDS that the pump will activate for. I.E. I want to pump to be active only when the TDS is above 50ppm and below 75ppm.

    My novice electronics thinking is that with the correct combination of transistors I can create a circuit that will send 5v to the Stamp when the TDS reaches 75ppm and 0v when the ppm is less than 50ppm but not send 5v until the ppm is greater than 75 again. Therein lies the crux of the problem. Software wise, this is a no brainier, but as stated I have only 1 IN left to use.

    In PseudoBASIC this is how it would look

    TDSLoop

    TDSLowRange = 50
    TDSHighRange = 75
    TDS1ppm = Reading of TDS 1 probe
    TDS2ppm = Reading of TDS 2 probe
    TDS1Alarm = OFF *Boolean for state of alarm
    TDS2Alarm = OFF *Boolean for state of alarm
    Pump = OFF *Boolean for state of pump

    If TDS1ppm >= TDSLowRange then TDS1Alarm = ON
    If TDS2ppm >= TDSHighRange then TDS2Alarm = ON

    If ((TDS1Alarm = ON) and (TDS2Alarm = ON)) then Pump = ON *Send 5v to Stamp IN

    While Pump = ON
    If TDS1ppm < TDSLowRange then Pump= OFF
    End While

    Pump = OFF *Stamp in 0v
    Goto TDSLoop

    End TDSLoop

    Only I need to do this electronically. Please help!
     
  2. Confused Fishcake

    Confused Fishcake Minimodder

    Joined:
    25 Sep 2005
    Posts:
    698
    Likes Received:
    1
    What does the tds sensor output? voltage gradient?
     
  3. jgrade

    jgrade What's a Dremel?

    Joined:
    2 Mar 2004
    Posts:
    534
    Likes Received:
    0
    Neither. The only usable output is the alarm which is a normally open relay. The TDS probe connects to the TDS module which converts the readings and houses the display.
     
  4. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    Are you sure you can't multiplex some of the other inputs and outputs to give you some room for two inputs on the STAMP?
     
  5. jgrade

    jgrade What's a Dremel?

    Joined:
    2 Mar 2004
    Posts:
    534
    Likes Received:
    0
    I don't believe multiplexing is an option. I will look into it. However, I may have made the explanation a bit too complicated.

    The bottom line is this:
    The pump needs to turn on ONLY when both relays are closed ( the TDS level exceeds both set levels) and turn off ONLY when both are open ( the TDS level is below both set levels).
     
  6. theevilelephant

    theevilelephant Minimodder

    Joined:
    5 Jan 2006
    Posts:
    1,334
    Likes Received:
    36
    ive been trying to work out what you want from the circuit. im confused by your first and last posts... do u want to create a range in which the pump should turn on or something else?
     
  7. Rod10k

    Rod10k What's a Dremel?

    Joined:
    2 Jun 2001
    Posts:
    193
    Likes Received:
    0
    From my reading of it you need some logic before you get to the stamp.

    If you put an XOR gate with the two alarms connected as inputs then when the 50ppm sensor goes off the output will become a logic 1. When the 75ppm sensor kicks in too it will turn off the output.
    When both sensors are off the output will also be low.

    You can buy an XOR logic gate from any of the major suppliers.
     
  8. AJB2K3

    AJB2K3 What's a Dremel?

    Joined:
    12 Dec 2005
    Posts:
    1,605
    Likes Received:
    4
    If you look up a manual for staps you notice that they have analoug pins, how does this help?
    On ALL alarm outputs (normally open relays?) place a different value risistor and connect in series so that all alarms are closed only by the risistors.
    NOw heres were it may get confusing
    When an relay is triggered a risistor is bypased by the contacts reducing the overal value.this means that multiple switches can be connected to one pin.
    If im just confusing you ill try to drw out a circuit diagram.
     
  9. JoJo2201

    JoJo2201 What's a Dremel?

    Joined:
    13 Nov 2005
    Posts:
    39
    Likes Received:
    0
    wow i feel just like i did when i opened a book and it was in russian lol. what exactly is a stamp module?
     
  10. Confused Fishcake

    Confused Fishcake Minimodder

    Joined:
    25 Sep 2005
    Posts:
    698
    Likes Received:
    1
    ajb2k3's method would work, a stamp module is a programmable microcontroller package thingy.
     
  11. AJB2K3

    AJB2K3 What's a Dremel?

    Joined:
    12 Dec 2005
    Posts:
    1,605
    Likes Received:
    4
    Thanks for the vote of confidence but its not mine, its printed in the stamp manual.
    Stamp Manual
    Page 157
     
    Last edited: 8 Jan 2006
  12. jgrade

    jgrade What's a Dremel?

    Joined:
    2 Mar 2004
    Posts:
    534
    Likes Received:
    0
    Thanks to all for the help. As it turns out, there were 2 I/O's left, not one, so problem solved. The guy that built the proto did not add the last I/O to the daughter board. So a little soldering and viola problem solved. :rock:
     

Share This Page