Wiring a smoke detector

I think your cheapest option will end up being an Arduino with Ethernet shield - but it is still exxy - compared to using a sonoff or NodeMCU etc.

I think you should give a couply of WIFI installations a go and see if they change your mind.

Craig

Hi Craig, I have ordered today a LOT of stuff (nodemcu...) on Aliexpress to do some experiments. Have learned very much from everybody in this discussion, since I'm a novice in this domain. And perhaps the wifi is so good, that I can keep my 'obsession' under control :thinking:. The family will be very surprised when I'm removing all the CAT cables out of my walls...

Will post my experiences here around the end of the year. Thanks again!
Bart

1 Like

Good one.

Also note someone posted above that the NodeMCU can be powered by 12v - i do not believe this is the case so be careful if you were planning on going down that route. Max V in on the NodeMCU is 5V i believe (either through USB or on the VIN pin) all other pins are 3.3v only

Craig

It should be able to take 10v like other ESP8266 devices. Though I've not checked. 12v would be pushing it I think. But it may well be the case that the smoke detectors could run on 9v and in that case, you could run everything from one power source.

I wouldn't do that. They might become useful in the future.

The NodeMCU, depending on the vintage, has an SPX3819 or NCP1117 Voltage Regulator. The specs of the SPX3819 and NCP1117 show an absolute maximum Vin of 20V, and a normal operating range for Vin as 2.5-16V, so 12V should be safe.

References:

https://www.mouser.com/datasheet/2/308/NCP1117-D-81326.pdf

Here's a discussion of various ways to power the NodeMCU:
http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/powering-the-esp-12e-nodemcu-development-board/

Very nice discussion!

The ESP8266 is great. I think it would be great for this. But if there is a wire connection available ....

Relay is a relatively slow device (compared to GPIO), and it works with a relatively high current, and is not so sensitive to interference.

The first solution is to remove the relay from the sensor and mount it closer to the GPIO.

Another solution is to use an additional relay module (12V), meaning 12V relay, and 12V on input/trigger, and thus bypass the intervention on the sensor. These relay modules are fairly cheap. There are low level trigger, high level trigger and low/high trigger(both) versions.

It is also possible to connect the Zener Diode of the corresponding values ​​in the series, thus avoiding the influence of the voltage lower than the zener diode voltage on the input part (GPIO).

Good luck with the project!

1 Like

Nice, good call.

Hi @markost, what do you mean with "corresponding values"? And could you please explain the "influence of the voltage" a bit more please.

P.S. the relay is build-in inside this smoke detector. Moreover it offers switches to set normally open or closed.

Hi Bart,
In my article "The project that grew and grew", I used a DC to DC voltage converter to convert 3V3 or 5v to 12V.
i.e. Convert the WeMos power input to the voltage needed by my IR Detector.
Here's the Banggood link where I purchased it.

1 Like

See the following link:
https://www.youtube.com/watch?v=VG_7LHW9SS8
The value below 5.1V will not activate the optocoupler at the input of the relay module.
This should be enough to prevent distortion from the environment

1 Like

That video is about controlling relays, not about reading the current state of the contacts.

Truth.

I thought about this:

Problem solving from hardware side. No coding, no wifi, very easy setup. Easy to build and check, very cheap, no maintenance.

[Relay module](WAVGAT 1 2 4 8 Channel 5V 12V Relay Module Board Shield with Optocoupler Support High and Low Level Trigger for Arduino https://s.click.aliexpress.com/e/fUm7080)

1 Like

Did the discussion go off on a tangent? The OP drawing shows a simple relay contact. If that's what he is detecting then there is no need for an opto-coupler.

Steve, the worry is that if there are long wires from the relay to a remote GPIO on a central Pi then induced noise may cause false triggers if the simple built in pull (or down) resistor built into the Pi is used. Using an opto would allow higher voltages to be used that would be less susceptible to noise.

That would apply if he still insists on running long wires, but the group generally seems to be steering him to WiFi.

Why the Zener? A current limiting resistor should be all that's needed.

Indeed - I was just relating it back to OP...
If wireless/esp then no need for opto.

Bart,
If you want to keep it simple, the pullup Resistor is the best way to go, simple and reliable. 40m of cable for a low frequency signal should not get enough interference to give any false triggerings provided there is a pullup. This could jist be wired in the cable at the header pins (need 3, gnd, Vcc (3.3V) and a GPIO pin ). You do need to run the GPIO and Gnd wire together from the PI to the detector and preferebly a twisted pair, this will drastically reduce induced noise in signals. A pair out of a Cat 5 cable (use the multi core rather than solid core, less prone to breaks) is quite adequate. A short time constant filter in Pi software (2 or 3 readings the same before triggering on or off) will also reduce likelyhood of false triggers.
I haven't used Pi GPIO, so check if the pullup is to 3.3v or 5v. Ardunio have an internal pullup you can enable, even that will be adequate with twisted pair cable and soft filter (debounce).

1 Like

Always pulup to 3.3v on a pi, never 5. If you pullup to 5v you may damage the Pi.

Ta, thought it was 3.3v. Mainly using my Pi to run Node-Red and Mosquitto with Arduino as ethernet or WiFi connected things around the place. So know Arduino IO better.