Raspberry Pi and a SSR

Discussion in 'The Projects Forum' started by Gregws, Dec 20, 2013.

  1. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Hi there,

    I'm working on a project turning a fridge on and off with a Raspberry Pi.
    The GPIO is 3.3v and is enough to trigger a SSR I have.
    But I'm not sure whether I need to use Diodes or resistors.

    [​IMG]

    If you could please help me out it would be great.
    Thanks,
    Greg
     
  2. #12

    Expert

    Nov 30, 2010
    16,252
    6,749
  3. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Thanks for the info, I'll keep a watchful eye on the "3.5" trigger required and check to make sure the store can confirm if its 3.5 or 3 as it states.
    Although it doesnt answer the question I asked.

    I'm more interested in what resisters etc I need to complete the circuit.
    Do I need to use them at all?
     
  4. #12

    Expert

    Nov 30, 2010
    16,252
    6,749
    Posts 27 and 28 translate into these circuits.
     
  5. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Thanks, I'm terrible with circuitry. I appreciate any help you can give me
    So I have to use the 5V on the pi?
    I cant use the GPIO to send HIGH LOW? to switch the relay?
     
  6. #12

    Expert

    Nov 30, 2010
    16,252
    6,749
    No, the drawings show the Pi containing 0 volts and 3.3 volts. The 5V is supplied separately because we've been seeing troubles getting available SSR's to work with 3.3 volts. The purpose of these circuits is to enable you to use the GPIO to send HIGH and LOW to switch the relay.
     
  7. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    So if I didnt need to use the 5v I could just go GPIO straight into SSR then out to earth without the use of resistors or diodes?
    Or does the SSR need a constant 3.3v from the PI and then have the GPIO high low it?

    I'm taking your circuit into the electronics store and getting the bits required.
     
    Last edited: Dec 21, 2013
  8. #12

    Expert

    Nov 30, 2010
    16,252
    6,749
    What you just described is 2 ways to do exactly the same thing, but the logic is reversed.

    Could somebody else please take this? I'm just working off that thread I reference in post #2. I don't have personal knowledge.
     
  9. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Well I appreciate all the help you have given me.
    I will wire it up the way your diagram shows and let you know how I get on
     
  10. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,771
    1,103
    I've no practical experience of SSRs, but am aware they have different output ratings. Presumably the one you have is rated for inductive loads (at the voltage your fridge requires) with high initial current surges (assuming your fridge is a motorised unit rather than a Peltier type)?
     
  11. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Yes I have made sure that it can withstand the AC power. The fridge uses a compressor.
    I checked my wire diagram on the fridge.
    rated V = 230-240
    50hz
    rated input 150w

    W/V=A
    150w/240v=0.6A
    The SSR output is rated at 3A 240V
     
  12. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Ok, just got this working with a few modifications.

    GPIO 3.3v as source.
    gate and dump as grounds.

    Works toggled off the GPIO pin

    Code ( (Unknown Language)):
    1. while ( True ):
    2.         print str(wortTemp.getCurrentTemp())
    3.         temperature = wortTemp.getCurrentTemp()
    4.         if temperature > 18:
    5.             GPIO.output(17, GPIO.HIGH)
    6.             time.sleep(1)
    7.         elif temperature < 18:
    8.             GPIO.output(17, GPIO.LOW)
    9.             time.sleep(1)
    10.  
     
  13. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Its not letting me edit my last post. So here is the circuit I used incase anyone else is following this
    [​IMG]
     
  14. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,771
    1,103
    ?? I don't see how that can work, since the 2N7000 is permanently turned off by having its gate grounded.
    If the SSR input current requirement is well below the output drive capability of the GPIO pin and the SSR will trigger reliably from 3.3V then you don't need the FET or the resistor.
     
    Last edited: Dec 26, 2013
  15. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Yeah, since the resistor is soldered in, I left it there.
    Well the 2N7000 was completing the circuit when I was using the constant supply from the 5v pin.
    The fridge stayed on all the time. Even if gate was set to LOW or HIGH output from the GPIO.

    With the 3.3v GPIO as source and earth for both gate and dump it works fine.
     
  16. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,771
    1,103
    In that case the FET has failed short circuit !
     
  17. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    So the diode gate has blown?

    I just read your post again
    If that is the case. Would my initial suggestion be correct?

    3.3v GPIO -> SSR 3v Input -> SSR Output -> Earth
    Or should I always use a diode between SSR Output and Earth?
     
    Last edited: Dec 26, 2013
  18. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,771
    1,103
    Yes.
    The FET has shorted drain-to-source.
    No.
     
  19. Gregws

    Thread Starter New Member

    Dec 20, 2013
    12
    0
    Great, so because the FET has shorted closed, I can still use the diode function of the 2N7000 as it will only allow current one way?

    Or would it be worth removing the components and rewire it
     
  20. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,771
    1,103
    You don't want a diode function.
    Yes.
     
Loading...