12v Home Alarm System to 3v raspberry pi connection

Thread Starter

paddyhughes086

Joined Jan 30, 2011
48
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
 

Thread Starter

paddyhughes086

Joined Jan 30, 2011
48
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.
 

MikeML

Joined Oct 2, 2009
5,444
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.
 

Thread Starter

paddyhughes086

Joined Jan 30, 2011
48
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.
 

Thread Starter

paddyhughes086

Joined Jan 30, 2011
48
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.
 

MikeML

Joined Oct 2, 2009
5,444
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.
 

Thread Starter

paddyhughes086

Joined Jan 30, 2011
48
If you use opto-coupler (opto-isolator) there is no need to connect grounds.
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
 

MrChips

Joined Oct 2, 2009
21,665
You have a number of options:

1) Simple voltage divider:



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:



R1 = 1kΩ
R2 = 10kΩ

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

Thread Starter

paddyhughes086

Joined Jan 30, 2011
48
You have a number of options:

1) Simple voltage divider:



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:



R1 = 1kΩ
R2 = 10kΩ

The opto-isolator 4N25 family, 4N25-4N28 are common readily available 6-pin devices.
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 ?
 

MikeML

Joined Oct 2, 2009
5,444
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.
 

Thread Starter

paddyhughes086

Joined Jan 30, 2011
48
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.
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
 
Top