This project is a modification of one of my other projects here on hackster that details how to install Node-RED on a raspberry pi zero w and then use Node-RED to remotely turn on an led using my cell phone, tablet or laptop. The difference this time is that I use Node-RED to "monitor" one of the GPIO pins and send me an email/text if the input to pin 32 goes to ground. In this project, it is the smoke alarm in my shop that I have connected to the Raspberry Pi.
If you are already running Raspian, here is a link on how to install NodeRed on the Raspberry Pi.
The smoke alarm I used is a First Alert model 3120B and needs no modifications to work with this project.
It is a wired smoke alarm found in many new construction homes. They require a 120vac connection and have a battery backup. What makes them ideal for this project is that they have an output signal that connects to other smoke detectors in the house. Once they activate, they send out a small DC voltage to other devices. It is this signal that I use for this project.
Since I just needed one in my shop, there was no need to connect to other detectors, however, if I had needed more than one I could have used the signal wire coming out of the last one in line.
As you can see, the wiring is very simple, but keep in mind that this is a 120vac connection that needs to be made to this device. It's not any more complicated than connecting an outlet box, but if you are not familiar with working with house wiring, please ask someone to do it for you. You won't get a second chance, and I shudder to think what would happen if you accidentally connected the "hot" wire to your project! When wired correctly, there shouldn't be anything over 10vdc going to your project board. This can be sent through a 10K ohm current limiting resistor to the input of an optocoupler like the PC817.
You don't need any outside free services or another app on you phone (like IFTTT) to send you the text. Node-RED handles everything. There's not even a need to put any sort of code in the Raspberry Pi. Connecting and monitoring sensors does not get any easier than this.
The key to sending the text message to your cell phone is built into Node-RED and it is very simple to install on the Raspberry Pi. In case you don't know what Node-RED is, here is a description from the Node-Red website that explains what Node-Red is.
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
Getting back to the project, here is a simple drawing of how to connect everything together. I used a USB charger to power the Raspberry Pi.
The flow provided needs to be copied/pasted in NodeRed using the import option. The flow is setup to send an email that you will actually configure in the node to send a text. This is done by replacing your email address with your phone number and sending it to your phone service provider to text out. There is a comment node in the flow that may help with this. The flow is also configured to use a pullup resistor, without that the PC817 will not trigger.
I only know that this configuration of wiring works with my First Alert smoke detector, other brands or models may work, but I only have this one. The signal wire on my alarm, after going through the 10k ohm resistor, goes from zero volts to 6.6vdc when activated. If the main power is off and the unit is running on battery power, the signal goes from zero to 8.8vdc. I tried different series resistors, but this one seems to have the least current draw but still enough to power the PC817 led. That's about all I can say about it. I am no expert.
Once the components are connected and the flow is entered into NodeRED, that's pretty much it. Nothing else to do that I can think of. I am next going to start adding more to this project and use it for shop security also. I want it to monitor the doors for entry and maybe even connect it to a motion detector also.
Comments
Please log in or sign up to comment.