1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

I've been working on a similar project as this but with a HoneyWell alarm system. I've managed to lower the voltage from the 12V or so down to 3v (approx) using a resistor bridge. I now have the leads from the bridge plugged into the GPIO pins on the raspberry pi. I'm reading the pin input via Pi4J and it seems to give me a HIGH and LOW respectively for the 2 pins. This value does not change even if there is an event that occurs in the alarm panel(opening doors etc). Can anyone tell me how to read the data and clk inputs correctly?

Notes:In the circuit diagram below the voltage source is pretty much the data and the clock lines coming out from the Alarm Panel. I'm feeding the GPIO pin of the pi with a jumper wire to the end of the R1 resistor. I had to use a bunch of 1k and another 300Ohm resistor because I didn't have a 3300K resistor in my small kit. The clock and data lines are both being downgraded to a 3v input line by passing through this circuit (2 circuits on a bread board). The model of the Alarm panel is a Honeywell Vista 20p. Circuit Diagram of the panel attached below.I'm feeding the pi with the wires attached to PIN 6 and 7 as shown in the circuit.

[HoneyWell Alarm panel circuit diagram]

The following image is of the wires connected to the breadboard.The breadboard is then connected to the pi via a cable ( not sure what the cable is called). cables from alarm panel connected to a breadboard

\$\endgroup\$
  • \$\begingroup\$ Welcome to StackExchange, vineets. There is an easy-to-use schematic tool on the editor toolbar and if you draw that part of your circuit rather than describe it you are more likely to attract interest in your question and generate some good answers. Also, can you clarify how you're reading the pin input? (On one hand you say 'it seems to give me a HIGH and LOW' and on the other 'This value does not change'.) Where are you reading - on a multimeter or in the code? \$\endgroup\$ – Transistor Jan 5 '16 at 18:15
  • \$\begingroup\$ What you need is a logic level shifter, resistors won't cut the deal. \$\endgroup\$ – ammar.cma Jan 5 '16 at 18:31
  • \$\begingroup\$ @transistor When measuring with a multi meter the voltage on the data and clock wires of the alarm panel fluctuates between 2-3V approx. This is plugged into GPIO 18 and 23 of the Raspberry Pi. I'm using Pi4j (GpioPinDigitalInput class) to read whether the input is high or low and it always seems to be high for one and low for the other. These values do not seem to change with the fluctuating voltage on these wires when measured by the multi meter. These wires emerge from the leads which hook up to the keypads etc on the alarm system. I can attach pics and circuit diagrams if the need be. \$\endgroup\$ – vineets Jan 5 '16 at 18:49
  • \$\begingroup\$ Reading a pulse train with a multimeter is only going to give an average reading so you won't be able to tell what max and min voltages are. Schematics and photos always help. Put all this additional info into your question rather than comments as that way readers can find all the relevant information there. (This becomes more important the more answers you get.) \$\endgroup\$ – Transistor Jan 5 '16 at 19:17
  • \$\begingroup\$ check that the inputs work for sensing the voltage ranges you want to sense. \$\endgroup\$ – Jasen Jan 5 '16 at 22:04
1
\$\begingroup\$

Using a resistor divider for this is probably a bad idea, for a few reasons: ground isolation, electromagnetic compatibility, and whether the 12V output (and I'm assuming it's a 12V output from the alarm system that you're trying to monitor from the Pi) even has a full push-pull topology.

My first guess as to why you always see a 1 is that the 12V output may only a pull-up transistor and no pull-down, so the input pin will just float high. Or you've chosen the resistor values poorly, or a whole bunch of other possibilities.

The usual approach (unless the data rate is really high, like a Mbit or more) is to use an opto-isolator. That should get you a clean, isolated, level-shifted signal that can be directly observed by the Pi - you'll need to google ("opto-isolator input pi" or similar) a schematic but there are plenty to choose from.

The second issue is that if those two lines are clock+data outputs from the alarm, you are going to struggle to interpret them on the Pi as GPIO because you just cannot read them fast enough, with no gaps, to ensure that you get every bit. You would need to connect them to a dedicated I2C or SPI peripheral (whichever is appropriate for the actual signaling protocol coming from the alarm), configured as slave, in order to interpret the bit-stream in realtime without the linux scheduler getting in your way.

\$\endgroup\$
  • \$\begingroup\$ I'm going to give the opto isolator a shot and let you know if it works for me. I've added more info to the original post in case you have more suggestions for me. thanks! \$\endgroup\$ – vineets Jan 6 '16 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.