how to interface Relay to microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by abhimanyu143, Oct 18, 2015.

  1. abhimanyu143

    Thread Starter Member

    Aug 25, 2014
    211
    1
    Hello
    I have fear in my mind, first time I am going to use relay in my project. I have done all work under 12 v dc. now I am trying to connect relay to mains power. that's why I need suggestion I don’t understand how to interface relay to 8051 and AC motor

    relay has 5 pins
    1. which Pins of relay connect to port of microcontroller (8051) ?
    2. which Pins of relay connect to mains power ?
    3. which pins of relay connect to AC motor ?
    4. look at image. It is suitable for AC motor ?
     
  2. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Your picture does not load properly, and needs to be reduced in size before posting...

    What are the specs on the motor (Locked rotor current, running current, HP)?

    How do you propose to drive a 12V relay from a 5V port? NPN? NFET?
     
    abhimanyu143 likes this.
  3. abhimanyu143

    Thread Starter Member

    Aug 25, 2014
    211
    1
    What are the specs on the motor
    specification AC motor
    Power rating : 0.37kW/0.5 Hp
    Voltage range : 180 to 240 Volts

    How do you propose to drive a 12V relay from a 5V port? NPN? NFET?
    I have 4 k resistor and NPN transistor
     
    Last edited: Oct 18, 2015
  4. abhimanyu143

    Thread Starter Member

    Aug 25, 2014
    211
    1
    Hello
    which pins of relay connect to AC motor ?
    which Pins of relay connect to port of microcontroller (8051) ?
    which Pins of relay connect to mains power ?
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,507
    2,367
    The circuit is wrong for your configuration the low voltage DC common and the AC side should not be connected, IOW galvanically isolated.
    The circuit show a diag. for a motor and control powered off the same supply.
    The AC power goes to one N.O. contact the motor the other, the neutral goes direct to the motor.
    If you are asking these very simple basic questions you may want to brush up on your basic electronics first.
    Max.
     
  6. abhimanyu143

    Thread Starter Member

    Aug 25, 2014
    211
    1
    Is it right connection ?
     
  7. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Like this:

    Interfacing-Relay.gif

    I would put a slow-blow fuse in the Green wire.
     
  8. abhimanyu143

    Thread Starter Member

    Aug 25, 2014
    211
    1
    I have done some connection on breadboard please look at connection . remember I have not connected 12 v supply and port pin.I just want to show the connection of relay
     
    Last edited: Oct 19, 2015
  9. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,507
    2,367
    Could be a little misleading, not to say dangerous using green for AC power, that is the colour code for GND, should be white, neutral.
    Especially if the motor has a green gnd wire already attached.;)
    Max.
     
    Last edited: Oct 19, 2015
  10. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Tell the TS (OP). He chose the wire colors. I think he is in a part of the world that does not use green...
     
  11. abhimanyu143

    Thread Starter Member

    Aug 25, 2014
    211
    1
    relay.png
    look at image , when I do same connection on breadboard. AC motor does not turn ON/off
    do you see any fault in connection ?
     
    Last edited: Oct 20, 2015
  12. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
  13. John P

    AAC Fanatic!

    Oct 14, 2008
    1,632
    224
    It says 7A at 240V on the case, and 1/2HP at 240V is less than 2A. Anyway, a solid-state relay would be silent and could run directly off 5V. He should be using that instead.
     
  14. abhimanyu143

    Thread Starter Member

    Aug 25, 2014
    211
    1
    I have changed idea , I am planning to use another motor
    voltage 165-250 V
    Power Consumption 20 W
    Output Power 1100 l/h

    I have specification of motor and relay. how to know that relay is suitable for above specification?
     
  15. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,507
    2,367
    vead likes this.
  16. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    I saw what is printed on the top of the relay; it still doesn't look up to the job to me...
     
  17. vead

    Active Member

    Nov 24, 2011
    621
    8
    Hello again
    actually I don't understand the wiring connection to power supply and lamp. there are two wires of supply and lamp, I don't understand how to connect them with relay wires. look the connection in image. If the all connections are correct than I will go for program
    relay with lamp.jpg
     
  18. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,507
    2,367
    It doesn't get much clearer than that??
    You may also want to look at a 2n7000 'Fetlington' in place of the BC547.
    Max.
     
  19. vead

    Active Member

    Nov 24, 2011
    621
    8
    ok its just diagram to show the wire connections. I am not using BC547. If you will see the my last post. I am asking about lamp and supply connection. Is it right connection ?
     
  20. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,507
    2,367
    Yes.
    Max.
     
Loading...