16 analog outputs into 1 digital output

Hi.

I have one alarm station that has 16 outputs. On each of this outputs you can read out some voltage change from 1 -

1,5V ( when in alarm state ).

To save space and money i was planning to hook up one multiplexer to those outputs and then other part of multiplexer to raspberry PI GPIO.

Did someone try to make something like this ?

Reply to
gm
Loading thread data ...

If all you need to know is if _a_ alarm is going off, not what particular one, you could use 4 LM339 quad comparators, one section for each alarm channel. Set them up with a reference voltage on one input and and some hysteresis, and since they have open collector outputs, the outputs can be OR-ed together into one "digital" output that pulls down when one of the comparators is triggered.

Please see page 10 of the following datasheet:

formatting link

Reply to
bitrex

Actually, if the threshold voltages on all the comparators are going to be the same, you could use fewer ICs - see page 7 of the datasheet for an "OR" gate that accepts multiple inputs.

I don't think I'd like to try to put 16 inputs all to 1 IC, but I'd feel comfortable using a LM339 quad and putting 4 inputs into each, and then ORing the outputs of each 4 input OR gate together.

You can also do a multiple input OR gate with hysteresis.

Reply to
bitrex

Just use 16 diodes, followed by one comparator to restore levels.

NT

Reply to
tabbypurr

------------- I need to know which alarm is turned ON. This is the main thing. So you have 16 different alarms. I was thinking that there is a way to output those signals on single digital line. So i can read them as binary value.

Your suggestion is OK but i need to record each alarm state. Alarm from each sensor...

Reply to
gm

Use a couple of shift registers and read them via SPI.

Cheers

Phil Hobbs

Reply to
Phil Hobbs

I guess that works OK, assuming that all the outputs of whatever the "alarm" is are low impedance. But he says he needs to know which particular alarm is going off, so I guess it's moot...

Reply to
bitrex

A/D converter connected to the rasp via I2C. For example:

formatting link

or comparator as someone else said and the something like this (connected via I2C):

formatting link

Bye Jack

--
Yoda of Borg am I! Assimilated shall you be! Futile resistance is, hmm?
Reply to
Jack

Have a setup where the comparators feed a control voltage to a 555 timer or something, and then count pulses :)

Reply to
bitrex

Well, if you have just ONE digital line, how are you going to tell which one of SIXTEEN alarms are active?

You can do it with some sort of wacky coding scheme (reinventing asynchronous serial is probably easiest), but it will take a bunch of circuitry -- and you'll need to start with sixteen comparators.

Or if you want to stick to a Raspberry PI sort of level of technical expertise, you could use an Arduino as a peripheral.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

I'm not sure what you are thinking exactly. If you want to multiplex 8 inputs onto one input you need to control the mux with 4 outputs. Is that what you are thinking?

I'd say the easiest way to do this is to use a 16 input analog mux chip to select the input to test, then use a single comparator to accurately set the threshold level. The digital output of the comparator is used to drive your computer input.

--

Rick
Reply to
rickman

--
You could use a 16 to 1 mux with its address inputs driven by 4 output 
bits from the PI and the corrersponding data bit driving an ADC or 
analog comparator input of the PI. 

If it has neither an ADC nor comparator input,  use an external 
voltage comparator with its output wired to a PI digital input. 

John Fields
Reply to
John Fields

Does that mean that there's a power supply behind those sixteen signals? How much power is available from that source?

You could connect the rPI through an eight-wire cable (Cat5 style) to a sixteen-input analog MUX chip. Four wires of address (gives sixteen possibilities), one wire for DC power, one for ground, one for connect enable/disable (optional, so the rPI port can be later connected to other 16-bit nodes later). This will use 4 or 5 GPIO output pins and one analog input pin of your rPI.

74HC4067 is a 16-1 multiplexer chip that works on low voltage power (3.3V from the rPI?). Two 74HC4051 8-to-1 muxes would also work (three address wires, two enable wires).
Reply to
whit3rd

-

O.

or

t

the

wn

o

el

n

Your question seems a bit vague. There are various ways to squeeze 16 bits onto 1 line, but you're not telling us much, other than the above, about wh ich would suit you best. So I'm not sure I see the constructiveness in maki ng more, inevitably guessed, suggestions. Really you need to tell us your l ikes and dislikes about the various options.

NT

Reply to
tabbypurr

Split the lines into 2 x 8. Add binary weighed resistors to yield 2 analog signals. Sample this signal on the receiving side

Cheers

Klaus

Reply to
Klaus Kragelund

These outputs are actually the terminals on LEDs, right? add a 100K pull-down resistor, check performance, and measure again.

sounds like you want a parallel-in serial out shift register.

3 wires pins to the raspberry pi GPIO, 16 to the alarm outputs, there's 8 bit chips easily had, so you'd need 2 of them to make a 16 bit unit. but that voltage will need to be converted to something more sensible first, a couple of ULN2008s and some pull-up resistors could be all it takes. (ULN2008 used off-label as it just happens to have its threshold in about the right place)

yeah, it's all been done before.

--
  \_(?)_
Reply to
Jasen Betts

----------------- Thank you all for reply !

So basically you have one alarm station like -paradox-. There is a YT video that explains almost all :

formatting link

When i detect voltage change on connectors: COM - Z1 COM - Z2 COM - Z3 COM - Z4

i should log this data on RSP. All sensors are powered with 12VDC but i have to check how much is the voltage difference when the system is in alarm state. I think it's around 1,5V.

According to your suggestions there are few options. Is there some ready made device that i can just hook up to alarm panel outputs and directly to RSP ? I can use 2x 8 pin solution.

Regards !

Reply to
gm

I can't say for sure because I don't have this alarm panel, but I would expect more than 1.5 V. When I worked with alarm systems they put the full battery voltage on the wire pair. The pair went to all the switches in a loop and back to the panel so that if the wire were cut or shorted, it could be detected. The voltage would switch between zero and the full battery voltage. This panel is not wired that way, so I can't say what voltage is placed on the wires.

Have you measured the voltages on the zone wires? I expect you will be designing a more complex circuit.

--

Rick
Reply to
rickman

------------------- Is someone interested in schematics and board design for this PCB ? Of course, with some financial backup :-)

I would go with 74HC4067 + 4 wires to RSP ( GPIO switching ) and ADC ( for reading ) + voltage divider.

GM

Reply to
gm

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.