Monitor 24V smoke sensor with PICs ADC

Thread Starter

LewisMF

Joined Nov 15, 2014
100
Let me try it again...

Assuming that you can tie the 0V end of the 24Vdc supply that runs the smoke detectors to the 0V of the 5V supply that runs the PIC, the circuit I posted back in post #7 is all you need. Here it is again, this time showing two Sensors going off at the same time:

Each sensor draws 40mA if active. I am showing what happens at the PIC A/D input if first one goes on, and then the second one goes on, then the first goes off, and finally the second goes off. Note that with a 33Ω load resistor, you get 0V with none on, 1.3V with one on, 2.6V with two on, 3.9V with three on, and 5.2V with four on. I'm guessing that the likely-hood of four going off at the same time is unlikely. The AD has more than enough resolution to determine if it is one, two, three or four...

The upper plot pane shows the voltage into the AD input, and the lower pane show the current through the two simulated sensors.

View attachment 80765
Hi MikeML,

Yes it is very unlikely that 4 go off at the same time. But the standard I am trying to build it uppon (EN54 - parts 2 and 4) require a maximum of 32 sensors on each line. So that means that the panel needs to be prepared for 32 sensors on one line and the possibility that a lot of them go off at the same time without damaging the panel itself.

Another question I have here is, what is the alarm threshold? Would it be the 33 Ohm resistor?

I really appreciate your help.

Best regards
 

MikeML

Joined Oct 2, 2009
5,444
...So that means that the panel needs to be prepared for 32 sensors on one line and the possibility that a lot of them go off at the same time without damaging the panel itself.

Another question I have here is, what is the alarm threshold? Would it be the 33 Ohm resistor?
The alarm threshold is the difference between 32 static sensors vs 31 static sensors with one alarming.

The 32 static current with no alarms is 32*95uA ~= 3mA vs
the current when the first one alarms is 1*40mA +31*95uA = 42.95mA.
If all alarm at the same time, the current is 32*40mA = 1.28A.

If we size the load resistor such that with all alarming, the voltage across the resistor is <5V (to keep below the max allowed on the PIC input), the load resistor would be R=E/I = 5/1.28 = 3.906, so use a 3.9Ω resistor. The resistor's power rating would have to be P=E^2/R = 25/3.9 >= 6.4W, so use a 10W power resistor.

With a 3.9Ω load, the voltage at the AD input with no alarms would be E=I*R = 3mA*3.9Ω ~= 12mV. With one alarming, it would be 43mA*3.9Ω = 168mV.

If the AD is 10-bits (1024 steps), and the AD reference is 5V, the smallest step that can be resolved is 5/1024 = 4.88mV, so the AD will have no problem resolving if none, or 1 to 32 sensors are alarming.

These calculations are confirmed by the following simulation:

I added a low-pass anti-alias filter, and a voltage clamp. V2 makes the independent variable of the simulation; namely the number of sensors that are alarming, from 0 to 32. That number is plotted along the x-axis. Ignore that it is plotted as Volts: it is really the dimensionless number n.

The voltage at the AD input is shown on the left y-axis (V) in green. The total current from all the sensors flows in R1, and is shown on the right axis (A) in red in the upper plot pane.

The lower plot pane shows the counts out of a 10bit AD referenced to 5.00V as the blue trace. Note that 1 sensor alarming creates ~35 counts and 2 sensors creates 66 counts. The quiescent current with no sensors alarming is about 3 counts, so there is plenty of resolution to "count" how many of the sensors are alarming (1 to 32).

Finally the violet plot is the power dissipated in resistor R1 in Watts.

134b.gif
 
Last edited:

BobTPH

Joined Jun 5, 2013
8,813
I still like my solution.

Put a 100Ω resistor between each sensor (separately) and ground.

Then use a small signal diode with the anode to the junction of the resistor and sensor.

Tie all the cathodes together and connect to in input pin, with a 1K pulldown resistor.

You now have a digital input that is high when any combination of sensors is alarming.

Bob
 

ErnieM

Joined Apr 24, 2011
8,377
I feel like asking "why so serious?" Why do analog to digital?

A 100 ohm sense resistor will give a digital response to the first sensor trip when using 5V logic. Since all the sensors are in parallel you probably don't care how many trip; one trips and call 911!

The second sensor may not trip with 19V across it (and make sure the first one stays tripped at 19V, I didn't read the whole spec) but you can lower the digital "one" voltage by running the digital end off a lower voltage.

Yeah, if multiple sensors trip you can exceed 5V so put a diode from the input to the power rail as a clamp.
 

MikeML

Joined Oct 2, 2009
5,444
Perhaps Lewis could tell us if he just wants the PIC to know if at least one sensor is alarming, or if knowing how many are alarming would be useful. If he only wants to know at least one, then there is no need to use the PIC's AD; any digital input port pin will do...
 

ErnieM

Joined Apr 24, 2011
8,377
If you can read any requirements from post #20, your crystal ball is better than mine.
How would the PIC detect if a SD is in alarm? What is the threshold? I need to have an end of line resistor on the last SD to supervise the line.
My crystal ball read this as the sensor line is a pair of wires with sensors scattered about the length, and at the far end there is an (unknown) resistor which will serve to indicate the entire length of the pair is intact.

So there are four basic levels of current to be sensed:

Current A=0 indicating broken wire

Current B>A where the wires are intact

Current C>B where one sensor has tripped

Current D>B where multiple sensors have tripped. D by itself is not a constant.
 

Thread Starter

LewisMF

Joined Nov 15, 2014
100
Perhaps Lewis could tell us if he just wants the PIC to know if at least one sensor is alarming, or if knowing how many are alarming would be useful. If he only wants to know at least one, then there is no need to use the PIC's AD; any digital input port pin will do...
Hi Mike,

Sorry for my late reply.

I only need to know when 1 sensor is alarming, it doesn´t matter how many so we could use digital I.

The conditions ErnieM explained are correct apart from the fourth one which is not necessary. So the conditions would be:

Current A=0 indicating broken wire

Current B>A where the wires are intact

Current C>B where one sensor has tripped


What kind of circuit should I use to interface it with the pics digital input port?

Once again thank you for your help!

Best regrads,
 

Thread Starter

LewisMF

Joined Nov 15, 2014
100
My crystal ball read this as the sensor line is a pair of wires with sensors scattered about the length, and at the far end there is an (unknown) resistor which will serve to indicate the entire length of the pair is intact.

So there are four basic levels of current to be sensed:

Current A=0 indicating broken wire

Current B>A where the wires are intact

Current C>B where one sensor has tripped

Current D>B where multiple sensors have tripped. D by itself is not a constant.
Hi ErnieM,

These are the exact conditions I need to sense. Apart from the fourth one which is not necessary. I don´t mind how many are alarming, with one in alarm it is sufficient.

I appreciate your help.

Best regards.
 

Thread Starter

LewisMF

Joined Nov 15, 2014
100
What is the resistor at the far end? What resistance value?
That is one of my questions to know what resistor to use.

I have looked on google at some commercial versions and they use between 4.7KOhm to 10KOhm - 1/2W resistors.

Best regards
 
Last edited:

MikeML

Joined Oct 2, 2009
5,444
Since there are three conditions that need to be sensed, it would either require two digital-input port pins per string of sensors, or one AD input.

The resistor that is in series with 32 paralleled sensors like you described cannot be 4.7K. Follow the math I did earlier.

The three conditions being sensed are:
1. 0mA (open circuit)
2. 3mA (circuit normal, no sensors alarming)
3. >43mA (at least one sensor alarming)

If the sensing resistor is 4.7K, the voltage across it with 3mA is E = IR = 0.003*4700 = 14.1V
If the sensing resistor is 4.7K, the voltage across it with 43mA is E = IR = 0.043*4700 = 202V, obviously cant be 4.7K!
 
Last edited:

Thread Starter

LewisMF

Joined Nov 15, 2014
100
Since there are three conditions that need to be sensed, it would either require two digital-input port pins per string of sensors, or one AD input.

The resistor that is in series with 32 paralleled sensors like you described cannot be 4.7K. Follow the math I did earlier.

The three conditions being sensed are:
1. 0mA (open circuit)
2. 3mA (circuit normal, no sensors alarming)
3. >43mA (at least one sensor alarming)

If the sensing resistor is 4.7K, the voltage across it with 3mA is E = IR = 0.003*4700 = 14.1V
If the sensing resistor is 4.7K, the voltage across it with 43mA is E = IR = 0.043*4700 = 202V, obviously cant be 4.7K!
Hi Mike,

Please read the specifications chart of the picture I have attached. It is a convenctional fire control panel capable of monitoring up to 32 sensors on each zone. It is in spanish but the end of line resistor value is the fourth line where it says 'final de linea' as you can see it is 4.7Kohm.

Best regards
 

Attachments

MikeML

Joined Oct 2, 2009
5,444
Do you have a data sheet on the sensors? I am thinking you have not adequately described them. Do they have three wires, or only two?
 

Thread Starter

LewisMF

Joined Nov 15, 2014
100
Do you have a data sheet on the sensors? I am thinking you have not adequately described them. Do they have three wires, or only two?
Please find attached a screenshot of the detectors technical specifications takem from the datasheet.

Please note that when a sensor is in alarm it will load the line with 600Ohm.

The sensors only have two wires. +24V and 0V.
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
The sensors work over a wide range, and stay tripped over an even wider range. That looks good.

One further thing to protect against is a dead short on the sensor lines. A series resistor at the source will do for that.

I played with some numbers:

V supply =24V
R series = 100 ohms
R end = 5000 ohms
R sense = 100 ohms

I idle = .005 A
I trip = .038 A
I alltrip = .2 A
I short = .12 A

V open = 0 V
V idle = .47 V
V trip = 3.78 V
V alltrip = 12 V
V short = 20.2 V

Obviously this still needs a catch diode (which changes all the alltrip and short numbers) but shows a proof of concept.
 

MikeML

Joined Oct 2, 2009
5,444
I looked up the installation manual on some similar sensors (since Lewis hasn't provided the model number that he intends to use). The "end of line" resistor that he talks about is actually connected in parallel with all the sensors. I think it is a method of making sure that the bus has not gone open...

Here is my best guess as to what is going on showing both the EOL resistor R1 and a sensing resistor R2

21.gif

The 24V supply is actually inside the Alarm Panel. It likely is wired in series with a sensing resistor R2 (as I surmised way back in my first post), which serves both to limit the current from the power supply, as well as to provide a voltage proportional to the total current being drawn by the sum of the EOL resistor and the sensors.

To protect the A/D input, I have added a series resistor R3 and a 4.7V Zener diode, which will allow measuring the difference between the just the EOL resistor with no alarms, and the first and subsequent alarms. If multiple sensors alarm, the Zener limits the voltage into the A/D.

Now we just need to agree on R1 and R2...
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
Now we just need to agree on R1 and R2...
Don't forget the line may short and needs current limiting. That can probably come from the sense resistor.

Try R1=5K and R2=100 ohms as a starting point. Also add another 100 ohms in the top leg.

(I use Excel as my sim, works great but doesn't make pretty pictures.)
 
Last edited:
Top