Relay


Closed Thread
Results 1 to 15 of 15

Thread: Relay

  1. #1
    Join Date
    Jun 2008
    Posts
    84

    Default Relay

    What is the best way to push a 5v or 12v relay (Output 220V/10A)

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Menta,

    If your question is how to trigger a relay (5 or 12 volt) then I would use a transistor such as a 2n2222A. A 1K resistor from the PIC pin to the base of the transistor is needed. Don't forget to put a diode across the relay coil to protect the transistor.

    HTH,

    BobK

  3. #3
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    can someone maybe post a circuit for such setup ?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    can someone maybe post a circuit for such setup ?
    PIC pin thru 1K resistor to the base, collector to power, emitter to the relay coil, other side relay coil grounded, diode across relay coil pins 'backwards'.
    Basic connection for an NPN transistor that's set up to apply power to something.
    Get a copy of 'The Art of Electronics' and read it. Great book. Loads of info...

  5. #5
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    If I need 16 relay outputs that alot of transistos and resistors.
    Why not using 2 relay drivers to control the massive relays ?
    http://www.datasheetcatalog.org/data...a/ULN2068B.pdf
    Last edited by menta; - 7th July 2008 at 13:12.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    If I need 16 relay outputs that alot of transistos and resistors.
    Why not using 2 relay drivers to control the massive relays ?
    http://www.sample.co.kr/ladder/index.html

  7. #7
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Last edited by menta; - 7th July 2008 at 21:10.

  8. #8
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    What is the best way to push<font color=red> a </font color>5v or 12v relay (Output 220V/10A)
    Perhaps because in English " a " means one ! You did not ask how to "push" 16 relays!
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  9. #9
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Thanks....

  10. #10
    Join Date
    Oct 2008
    Posts
    47


    Did you find this post helpful? Yes | No

    Question code

    ok i get how to connect it to the pic but what i need to know is how to write code for the operation of the relay. I want to switch the relay on when it reaches a setpoint value of 30 degrees. How would i do that?

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kalind View Post
    ok i get how to connect it to the pic but what i need to know is how to write code for the operation of the relay. I want to switch the relay on when it reaches a setpoint value of 30 degrees. How would i do that?
    When WHAT reaches a setpoint value of 30 degrees?
    The timing advance on my lawnmower?
    The temperature on the North Pole? On Mars?

  12. #12
    Join Date
    Oct 2008
    Posts
    47


    Did you find this post helpful? Yes | No

    Default

    I'm doing a temperature control system. Pretty new to PIC programming. I have managed to display temperature on the LCD using an LM35 sensor and a 16 x 2 lcd with a 16F873. I want to add on a 4 x4 matrix keypad so that i can set setpoints to switch a relay and a low warning buzzer I have no idea how to program for the above mentioned add-ons. Please could someone help me. below is my code which will obviously need additions and a scematic of my circuit is attached . Please could somebody help me with this!!

    ' Define LCD registers and bits

    Define LCD_DREG PORTB
    Define LCD_DBIT 0
    Define LCD_RSREG PORTB
    Define LCD_RSBIT 5
    Define LCD_EREG PORTB
    Define LCD_EBIT 4
    dEFINE LCD_BITS 4
    DEFINE LCD_LINES 2

    adval var word ' Create adval to store result
    temp var word ' Create temp to store result
    temp1 var word ' Create temp1 to store result

    TRISA = %11111111 ' Set PORTA to all input
    ADCON1 = %10000010 ' Set PORTA analog and RIGHT justify result
    ADCON0 = %11000001 ' Configure and turn on A/D Module
    Pause 100 ' Wait 0.1 second


    loop: ADCON0.2 = 1 ' Start Conversion

    AGAIN: Pause 1
    If ADCON0.2 = 1 Then AGAIN ' Wait for low on bit-2 of ADCON0, conversion finished

    adval.highbyte = ADRESH ' Move HIGH byte of result to adval
    adval.lowbyte = ADRESL ' Move LOW byte of result to adval

    Lcdout $fe, 1 ' Clear screen
    temp=50*adval ' Conversion to Degrees
    temp=temp/100
    Lcdout "TEMP = ",DEC temp,$DF,"C" ' Display the value of temp
    temp1 = temp*18 ' Conversion to Fahrenheit
    temp1 = temp1+320
    temp1 = temp1/10
    lcdout $FE,$C0, "TEMP = ",dec temp1,$DF,"F" ' Display the value of temp
    Pause 1000 ' Wait 1 second

    Goto loop ' Do it forever
    End
    Attached Images Attached Images  

  13. #13
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kalind View Post
    I'm doing a temperature control system.
    No kidding...just like the other post says...
    Don't double post!

  14. #14
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    If temp>=setpoint then
    high pin
    else
    Low Pin
    endif

  15. #15
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by aratti View Post
    If temp>=setpoint then
    high pin
    else
    Low Pin
    endif
    Where have I seen something like that before?

Similar Threads

  1. Need Help
    By PVBiljon in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th May 2009, 17:04
  2. Replies: 24
    Last Post: - 7th November 2008, 04:41
  3. Serin to Serin2 ??
    By Gixxer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2008, 03:56
  4. Serial Relays
    By tazntex in forum General
    Replies: 3
    Last Post: - 17th May 2007, 17:42
  5. Replies: 22
    Last Post: - 9th April 2007, 15:25

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts