Well, I have not did very good about keeping a project log. Here is the (hopefully) final project.
Figure 1: The internet enabled smoke alarm on the benchtop
Figure 2: The internet enabled smoke alarm installed on the ceiling.
Figure 3: Inside of the Hammond enclosure
Oh, this is the misbehaving smoke alarms I mentioned in the project description.
When reverse engineering part of the commercial FireX smoke alarm schematic, I took digital images of the top and bottom side of the PCB. I then over layed the images in http://paint.net. Then, the opacity was adjusted to see both the traces on the bottom and the components on the top side. (This technique has been written about on various sites)
There are three wires going to each smoke alarm:
The 120VAC and common are incredibly fortunate. This makes it easy to power the ESP8266 module with a 120VAC to 3.3VDC wall pack adapter. The network line connects all 6 smoke alarms. Normally, the network line is at the same level as common. But, when the smoke alarms are sounding an alert, the network line rises about 9 volts above common. This causes all 6 smoke alarms to sound an alert. This network wire is connected to the ESP8266, through an optocoupler. The optocoupler has several advantages:
1) The optocoupler is high impedance, so it will not interfere with the smoke alarm operation.
2) The optocoupler electrically isolates the smoke alarm from the ESP8266.
3) The optocoupler is one directional. So, if some evil-hacker guy gets into the ESP8266, he could not set off the fire alarm. (I'm not 100% sure if the 3.3V logic line from the ESP8266 would set off the smoke alarm)
Now that it is known how the network line operates, here is a schematic of the smoke alarm modification.
Figure 4: Schematic to add internet connectivity to a smoke alarm.
There really isn't too much to the hardware. When the network line goes to 9V above common, the optocoupler turns on. This changes the state of the I/O line going to the ESP8266. There is a two wire cable going to the white LED. The LED blinks when there the wireless router is not found. The 3.3V wall pack powers the ESP8266. The schematic has a few details noted on it.
The software I used for the ESP8266 module is written in Lua. The NodeMCU firmware was loaded in the module. The module is running version 20150318 of NodeMCU.
Here is the code:
-- Matt Meerian -- Date: 5-16-2015 -- Origin: This started as an example from the internet (there are several modified snippets) -- Target: ESP8266 module -- Connection to target: USB to 9600 baud, 3.3V -- Downloader: ESP8266 LuaLoader 0.83 or later -- Firmware running on the ESP8266: NodeMCU 0.9.5 build 20150318 powered by Lua 5.1.4 -- Description: (NOTE: This firmware should be the only file on the ESP8266 module when run) -- This script will send an email to my yahoo account when the networked smoke alarms sound an alert. -- There are 6 networked smoke alarms in the house: Kiddie i4618. I have reverse engineered -- part of the schematic. There are three wires going to the smoke alarm: 120VAC and a -- "network" wire. The network wire is normally at 0V. When the alarm is going off, the network -- line goes up to 9V. This then sets off the other smoke alarms on the network. I have -- used an optocoupler to tap off of this network line and trigger the input of the ESP8266 module. -- You need to connect to a wireless router (AP) before you run the "dofile": -- wifi.setmode(wifi.STATION) -- wifi.sta.config("NSA_mobile_surveillance","frn...") -- You can then get your wifi by: = wifi.sta.getip() -- NOTE: The email alert is sent by pushingbox. -- When running a new lua script in LuaLoader: -- Press the "Upload File" button. (wait) -- Press the "Restart" button. -- Press the "dofile" button to run the script. -- How to flash lua firmware into the ESP8266: -- Use esp8266_flasher.exe Follow the instructions there led_output_pin=4 --This is the pin for the "wifi not connected" LED...Read more »