12v Home Alarm System to 3v raspberry pi connection

Discussion in 'The Projects Forum' started by paddyhughes086, Jan 30, 2015.

  1. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    Hi ALL

    I am trying to wire in my raspberry pi to email me when it is triggered By my House alarm.

    The issue is my house alarm connector ports are all 12v to run the bells and flashing lights. I want to connect my raspberry pi to one of the free bell ports on my alarm system so when it goes off it sends voltage from the alarm system to the raspberry pi

    The issue is raspberry pi cant run with 12v so I need to drop down to 3v could any one recommend a cheap circuit to build or a cheap device that will do this for me

    Thanks
     
  2. Reloadron

    Active Member

    Jan 15, 2015
    963
    232
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Two component interface:


    134b.gif
     
  4. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    I am really sorry in the delay in getting back to both of you I did not get email notification that my post was answered so I just assumed that no one had answered. I have been looking around for some sort of IC kit that I could put between the 12v alarm system and the 3.3v raspberry pi. Here is something I was looking at
    SparkFun Opto-isolator Breakout
    BOB-09118

    https://www.sparkfun.com/products/9118

    Thanks for your help.
     
  5. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    It is for going from Arduino or PI to a noisy load; not for input.

    Do you think you want opto-isolation? It might not be a bad idea.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,429
    3,360
    Let's rephrase that.

    It would be a good idea to use an opto-coupler to go from 12V to 3.3V.
     
  7. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    Hi everyone
    But is the opto-coupler all I need to put between the 12v system and a 3.3v pi or do I need to make or buy a kit like Mikeml say to use a 1n4148.

    Thanks for all your help with my questions.
     
  8. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    View attachment 79650 [/QUOTE]

    Hi MikeML

    I popped your circuit into Circuit Wizard program and checked it out so it looks like this is exactly what I was looking for THANKS just a few questions.

    Q1. Can I change the 1N4148 for (1N4001 or 1N4004) as I have them already if not that is fine and I can put in an order?

    Q2.In Circuit Wizard I was able test the voltage of the PI port input and it looks like it is getting 0.2v or maybe less when the alarm box is not giving any Voltage out and as soon as the alarm gives 12v the PI port gets 3v would this be correct in a real life circuit or is there a way of stopping the 0.2v

    Attached is the test. The first 6 seconds are at 0v from the alarm and from 7 seconds to 16 seconds is with the alarm giving 12v
    upload_2015-2-24_20-10-47.png


    Q3. If I do get the opto-isolation what way will I attach it to the circuit could you draw one up in your program for me please and is this what it looks like
    upload_2015-2-24_20-10-7.png
    Once again thank you to everyone who has helped me so far.
     
  9. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Any Silicon or Schottky diode will work.

    The logic low voltage will be the forward drop of the diode (~0.6V if Silicon) which is low enough to be recognized as a logic zero.
     
  10. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    Hi MikeML

    Thanks for the help so far with my question just one last thing.
    by attaching the alarm Ground and the Raspberry pi ground together do I have to worry about any feed back or power issues to the raspberry pi

    Thanks
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,429
    3,360
    If you use opto-coupler (opto-isolator) there is no need to connect grounds.
     
  12. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    Hi MrChips

    I posted a link before https://www.sparkfun.com/products/9118
    but after reading it I am not sure if it will work in the brief about the board it says (allows the low-voltage side to control a high voltage side) but I think this is the opposite of what I want I need when the 12v side is active it or has 12v running true it that the 3.3v side gives 3.3v to the GPIO pin on the raspberry pi. And when the 12v side is down to 0v then likewise the GPIO pin will also have 0v or as close to it at possible
     
  13. MrChips

    Moderator

    Oct 2, 2009
    12,429
    3,360
    You have a number of options:

    1) Simple voltage divider:

    [​IMG]

    R1 = 10kΩ
    R2 = 3.3kΩ

    This will drop the 12V input to 3V output with good current limiting.

    2) You can still use the Sparkfun opto-isolator board if you change the input series resistors R1 and R2 from 220Ω to 1kΩ to work with 12V input signals.

    3) You can roll your own opto-isolator circuit:

    [​IMG]

    R1 = 1kΩ
    R2 = 10kΩ

    The opto-isolator 4N25 family, 4N25-4N28 are common readily available 6-pin devices.
     
  14. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    Hi MrChips
    just looking at the 4N25 below is the layout
    View attachment 81253
    So
    1 is the 12v+
    2 is 12-
    5 is the PI 3.3V and the GPIO pin
    and 4 is the ground on the PI
    am I correct with this ?
     
  15. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    No. You forgot R1 and R2. They are essential, and must be placed as shown in MrChips schematic.

    Note that there is no -12V in the this circuit, only the 0V end of the 12V alarm power supply.
     
  16. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    ok I think I get it now

    Alarm 12v+ to R1 and then port 1 of Optoisolator
    Alarm 0v to port 2 of Optoisolator
    Optoisolator port 5 is PI GPIO then R2 between it and 3.3v PI
    Optoisolator port 4 is PI ground
    [​IMG]
     
  17. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
  18. paddyhughes086

    Thread Starter Active Member

    Jan 30, 2011
    48
    0
    Thanks MikeML
    Can I ask what program you are using To make the circuit displayed in your last reply
     
  19. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Free LTSpice downloadable at Linear.com
     
Loading...