Homemade Zigbee Environment sensor with Power outage and Hardwire Smoke detector

Hi Everyone,

It has been more than a year as a hobby I have been making Environment Zigbee sensor. I will not bore everyone here since there are already long discussion about it here.

I thought since we are able to monitor environment aspect of a room lets look at some other thing that probably make sense to monitor. In a way, I am always looking for a way to extend the modules.

Here is what I come up with. I added an AC to DC power converter so that we do not need to use our old USB phone charger. My thinking when I started doing this, I want to get more value out of adding this power converter. After all, we all should have access to old un-used USB charger. I do not want to replicate this model. I am looking to use the converter to patch power from my home hardwire smoke detector. They are powered by AC voltage. My thought, by this time, is that I may as well try to connect to the interconnect wire to get notification when the smoke detector detect some activity.

I have to credit Dr Edward Cheung for his work here for the interconnection research. The interconnect signal has evolve since then. In addition, Its extension may be different between vendors. I extend the idea to solve supporting additional device in the line is by sampling the line and report result of that sampling value. We know when the value of the line is the same after some period, they either say that there is no activity or there is smoke detected. The legacy signal sampling is simple. When there is a smoke, a constant 9v signal is sent on the wire. Any newer signals are a bunch of pulses of high (one) or low( zero). They may form a code when you decode them to a 8 bit variable. I am packing these bits to the extended zone status in IAS Zigbee cluster.

Based on my reading on Dr. Edward Cheung's work, his idea to connect to the interconnect wire is safe. The circuitry does not drive the line. It just listen to it.

I also added small circuit to detect power outage. This leverage the battery backup in the module that I have been developing.

Here is some demo of the project. I am sorry the video is on the longer side. I am looking to trim them down. In the meantime, I am excited to share what I have been able to get with it.

If there are any interest among pioneer, I should have a few boards more than I need myself to share like in my other project. However, I want to tide some things here and there before I would do that. I will wired it to my home smoke detector system to make sure that I am the first user.



I'd be interested in testing something like this out. Personally I would love to see motion and air quality integrated into it as well.

1 Like

@parish99, thanks for the feedback on motion and air quality. They should be do able. Meanwhile, just FYI, we have expansion pad exposed. One can attach at least a motion sensor easily as is now in any of my sensors. The pad is marked as DI, I have a sample child DTH in my github for extending the module with motion sensor.

A couple more thoughts on this, if you take it further. I would probably want to gut an old smoke detector and use the housing which would also work well for the motion sensor. It may be beneficial to add the same male 3 pin connector currently used for most smoke detectors which would allow it to be easily unplugged from power then.

I am guessing a lot of fire alarm can be gutted out. But, just a heads up, the size of the board may looks bigger than it seems in the video. There is some perspective because there are a Smoke detector and Carbon monoxide in the video. I would have to double check whether the board can easily fit into an existing case.

Depending also on the casing, you may loose the light reading. Once in an enclosure, temperature and humidity reading may be impacted.

All these side effect can be minimize of course with proper design of a case.

I plan to run mine naked. I will be using xiaomi motion sensor base. Like this.

I have extra of them. Mine come with double tape on both end. I just hang it on the ceiling next to one of my smoke detector. For me, in a way, it is a way to show of my work to friends and family. It probably won't look good. But, it is better than be mistaken as another smoke detector.

This is AWESOME !!! I also would like to see air quality added for use outdoors because I have some pretty severe allergies.

1 Like

Just a thought, but it seems to me that some smart person with a 3D printer could print something like a Smoke Detector or Ubiquiti WiFi AP enclosure and it would look pretty nice on the ceiling....even in a larger board size...


I got time to finally install it. I have also added HC-SR501 motion sensor. Yes, it does make sense to have a motion sensor on the ceiling on smaller room. It has enough coverage for 10x10 feet room in general. Perhaps, it can cover larger area if you have higher ceiling height.

Another view...

Yes, I did get the "WTF" stare from the wife. It actually feel good someone notice. But, seriously, a case would be nice. It would blend in with the room better.

A few have mentioned about adding some air quality sensors. Just by observing it, it seems our ceiling is not a good placement for small particle sensors. This is just a guess at this point.

I feel dust particle sensor should be place at reasonable height in the room (maybe eye level).

Some vendor sell air quality sensor which actually measure poisonous gas. I am not sure how this term get mixed. But, if this is what we are looking to measure, yes... our ceiling may be a good place to place these sensors as they may be lighter than oxygen. Therefore, they will travel up and reach the sensor.

I would look into the "air quality" sensor integration perhaps in different scenario.



Natural gas (methane) is lighter than air so sensors to detect a leak can be placed on the ceiling. LPG is heavier than air, ceiling placement wouldn’t be ideal for detecting that.

1 Like

Good to know.

1 Like

The motion sensor is a child device.

FYI, Using powered motion sensor can be a bit different from battery powered. In this case, since there is no battery conservation is needed, the sensor can send out change in motion detection shorter delay. It becomes very chatty. I am not sure whether this is something that in line with most use case today. Zigbee reporting configuration is very robust. I suppose, we can also simulate typical delay of a battery powered motion sensor by tweaking the reporting parameter.

Is there a sensor you could add for hydrogen (H2)? Batteries can off-gas hydrogen during the charging phase and I would like a ceiling mounted sensor for that.

I see a lot of sensor like this.

It has a few variant for different type of gas.

There should also be some other sensor that does it much more accurately. But, if you really look for it, it usually on the more expensive side.

Sorry for not answering it. Yes, after the motion sensor, there is still analog input for expansion.

If the price is double or triple that, it's still reasonable considering how dangerous hydrogen buildup could be.

Thanks Iman!

The BME680 is essentially the same sensor you are using with a built in IAC sensor might not give all the info people would want but it seems like a decent upgrade for a few bucks. Ceiling mount accuracy is probably dependent on what kind of air movement there is in the mounting location.

I will revisit this sensor in the future. For now, the cost of getting 1 to ~30 pieces of this sensor is very high. It start make sense when I can buy thousands of these sensors. Thanks for mentioning this sensor. I am a big fan of Bosch. As soon as this sensor come down in price, I will be looking at incorporating it..

I have completed assembling more of these. If anyone is feeling adventures and would like to try it, please do PM me.

This is early prototype. My intention is to build the whole thing with the case. But, we are still long way from that. Meanwhile, the electronic and software should be ready to test. Having said that, I have to put some disclaimer to those pioneer who would like to test this. There are pads and component exposed to high voltage on the modules This module is intended to be install out of reach from any living things. Ceiling is one of the place that I used it myself. I do not think you want to install it on floor level where children or animals can touch it.

Here are the modules. These are all I have build.

For everyone who requested this module, I have sent them out. You should received it in the next few days.

Please note, the terminal has marking for

S Signal from smoke detector line.
L This is the main power
N Neutral line.

I am hesitant to mention color as they can be different for different country. For USA, the signal line cable is typically colored Red. The main is typically colored Black. And the neutral line is white.

As I mentioned before that there is high voltage pad exposed in the PCB. Please do not touch them. The module takes 100v to 220v AC voltage.

I just update my github DTH to support the Smoke detecor, CO and main power attributes.

Thanks to everyone for your support again. I still have a few of this modules for those who are interested.


1 Like

The factory reset for this particular board is different from my other board if you own my original Environment Sensor.

For this board, you can just press the reset button (sliver looking button) for 4 to 6 seconds and release. It will reboot and factory reset the module.