Monitor 24V smoke sensor with PICs ADC

Discussion in 'Embedded Systems and Microcontrollers' started by LewisMF, Feb 20, 2015.

  1. LewisMF

    Thread Starter Member

    Nov 15, 2014
    63
    2
    Hi everybody,

    I am trying to monitor an optical smoke detector with the ADC of a PIC18F4520. The sensor feeds off a +24V rail and when they sense smoke, the resistance of the sensor will drop making the consumption go up to about 4mA.

    The problem I am having is that I don´t know how to interface the PIC with these sensors to be able to monitor the current safetly and know when they are active.

    Could anyone give me some ideas?

    I appreciate all your help. :)
     
  2. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Are there just two wires going to each sensor?

    What is the current into the sensor before it detects smoke?

    What is the current into the sensor after it detects smoke? (4mA?)

    What is the lowest voltage you could feed to the sensor and still have it operate properly?
     
  3. LewisMF

    Thread Starter Member

    Nov 15, 2014
    63
    2

    Hi Mike,

    First of all I would like to thank you for your quick response.

    There are just two wires to the sensor +24V & GND.

    The quiescent current is very low, according to the datasheet 95uA @ 24V.

    Alarm current (after it detects smoke) is 40mA @ 24V (I missed a zero after the four earlier, sorry)

    The minimum "detector active" voltage is 6V according to the datasheet, but as standard I need it to work at 24V.
     
  4. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,548
    2,373
    Any details on the sensor itself??
    Max.
     
  5. LewisMF

    Thread Starter Member

    Nov 15, 2014
    63
    2
  6. BobTPH

    Active Member

    Jun 5, 2013
    782
    114
    Connect the sensor to ground through a 100 Ohm resistor. That will give you a 4V signal when it is sensing smoke, which can be fed directly into your micro as a digital input.

    This assumes your micro is running at 5V. If at 3V use a 68 Ohm resistor.

    Bob
     
  7. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Here is something to try. You can just use a port pin; not the A/D converter. I'm assuming that the Pic is running on 3.3V.

    13.gif
     
  8. LewisMF

    Thread Starter Member

    Nov 15, 2014
    63
    2
    Hi Bob,

    The problem is that there is only two wires to the sensor, 24V & 0V. Would it be possible to measure the resistance on the negative wire with the uC? If yes, how could this be done?
     
  9. LewisMF

    Thread Starter Member

    Nov 15, 2014
    63
    2
    Hi Mike,

    I will definitely give this a try!

    To give you a better idea of what I want to do, is a conventional fire alarm panel. Where the detectors connect between a 24V and GND rail and on the last detector there is an end of line resistor (i.e. 10K). The sensors dont consume hardly any current while in normal mode but when they sense smoke and go in to alarm their resistance will drop causing the uC to stop monitoring the end of line resistor and this way interpretting the alarm.

    So I actually do need to use the ADC of the PIC which runs at 5V.

    As I said before, as 24V is too much for the uC, would there be any possibility to measure the resistance on the negative wire?

    I have searched on google but I have no other information on how these conventional fire panels monitor the detectors.

    Best regards.
     
  10. #12

    Expert

    Nov 30, 2010
    16,298
    6,810
    Is there any possibility of using the intended signal and using 1 or 2 resistors to decrease its voltage to 5 volts?

    You, "digital only" people need to learn some basic electricity.
     
  11. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    You are running the sensors in parallel, right?
    Therefore, there is only one resistor, and if any of the detectors alarm, the voltage drop across the resistor is what the A/D input sees? If you want to make it so that you can "count" how many sensors are alarming, then use a smaller resistor, and the voltage across it would be 0.04*n*R, where n is 1,2,...5
     
    ErnieM likes this.
  12. LewisMF

    Thread Starter Member

    Nov 15, 2014
    63
    2
    Hi Mike,

    Yes the sensors will be in parallel.

    The only thing I need to monitor is alarm, open circuit and short circuit. Maybe I could just use a simple voltage divider?

    I am a bit confused :S
     
  13. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,685
    2,747
    It looks like he is sensing the 'alarm current', which I doubt is proportional to 'smoke level' and is likely noisy. An A/D is not going to do much. Digital I/O is the way to go.

    I'd run the return wire to an optocoupler to ground (I get nervous tying long wires to CPU pins), and use the opto output to a digital pin.
     
  14. LewisMF

    Thread Starter Member

    Nov 15, 2014
    63
    2
    Hi Joeyd999,

    You are right, I am only sensing alarm current which is a threshold. Nothing to do with smoke level.

    Would you be able to post an example of a schematic if it´s not too much to ask :)

    Thanks for your help.
     
  15. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,685
    2,747
    Rough sketch:

    20150220_182040.jpg
     
  16. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,685
    2,747
    Here are some component values to get you started. It'll likely need a bit of tweaking.

    20150220_190022.jpg
     
  17. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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.

    13a.gif
     
    Last edited: Feb 20, 2015
  18. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,548
    2,373
    My choice would be to go with the opto, but straight in via a suitable resistor, no bi-polar transistor.
    Max.
     
  19. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,685
    2,747
    The bipolar is to limit the current into the photodiode.
     
  20. LewisMF

    Thread Starter Member

    Nov 15, 2014
    63
    2
    Hi Joeyd999,

    Thanks for yor help, this schematic is very usefull for me.

    I just have a couple of questions, what is the 1K pot just on top of the ADC line to the PIC?

    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.

    Best regards
     
Loading...