Azure Stream Analytics saving lives! Using Arduino

azure heater main

Azure Stream Analytics watches sensors, control device autonomously, send Tweets and alerts in case of a hazard. Controllable by smartphone.azure heater main

Things used in this project

Hardware components

Arduino MKR1000
Arduino MKR1000
× 1
SparkFun Graphic LCD 84×48 – Nokia 5110
× 1
Texas Instruments LM2596 DC-DC 4.5-40V Adjustable Step-down Power Supply Module
× 1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
× 1
ElecFreaks MQ-5 Gas Sensor
× 1
KEYES flame sensor module
× 1
NXP 74LS00 TTL Quad 2-input positive NAND gates
× 1
ST STM32L4, STM32F7 STB75NF75 N-channel Power MOSFET
× 3
Water/Gas Flow Solenoid Valve Normally Closed
× 1
2-Wire Ignition Coil
× 1
Resistor 10k ohm
Resistor 10k ohm
× 2
Resistor 4.75k ohm
Resistor 4.75k ohm
× 1
Breadboard (generic)
Breadboard (generic)
× 1
33 Ohm 10W Resistor Wire Wound
× 1
Jumper wires (generic)
Jumper wires (generic)
× 1
SparkFun DC Barrel Jack Adapter – Female
× 1
Heatsink Heat Sink for Voltage Regulator or MOSFET
× 3
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
× 1

Software apps and online services

Microsoft Azure
Microsoft Azure
Visual Studio 2015
Microsoft Visual Studio 2015
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
3D Printer (generic)
3D Printer (generic)
Corded Drill

Story

https://youtu.be/ZfN5Ts3B_tY

Inexpensive heaters like the one pictured here are common in southeast Asia. In my country gas pressure fluctuates throughout the day in the hours of peak demand. Every year there are many lives lost to unattended heaters with either Carbon Monoxide poisoning, http://goo.gl/JvEHK7 or gas leak when a momentary decrease in pressure causes the flame to go out, http://goo.gl/Y4JxfJ

Inspiration for the project came one winter night when my daughter’s room was too cold but I could not allow the heater to stay ON while she slept.

When I started designing the project, I thought, If I put a WiFi enabled controller like MKR1000 in there then I can do lot of cool stuff apart from safety. That’s where smartphone connectivity, auto-ignition using motorcycle parts came into picture. There is some good learning along the way like solenoid current control, level conversion by a NAND chip and unbricking a MKR1000!

Block DiagramHobby Projects

Heater is sending telemetry data to Azure through IoT Hub. The Stream Analytics job is doing near real time analytics on the device data and will post alerts based on the SQL request it is configured with. The Worker role will pick up the alerts generated by Stream Analytics and will forward the alerts to the device through IoT Hub.

Disclaimer

Only attempt this project if you have sufficient experience in working with gas and electronics.

To avoid fire hazard, be sensible when attaching cardboard and electronics to gas appliance.

Hardware Setup

Please see the video at the start where I explain the hardware choices, also check out attached schematic.

At the time of building this project MKR1000 was not released and documentation was not public. My concern was the MQ5 gas sensor uses heater and the current demand may not be met if connected to MKR1000 power rail. To be safe I configured the buck converter to provide the 5V rail. Then used MKR1000 on board regulator to provide 3.3V rail.

If you got 3V compliant MOSFETs like FQP30N06L from Sparkfun, then you don’t need the Quad NAND chip, but you do need to pull your MOSFETs down by a 10k resistor.

I highly recommend using a desk power supply that can measure current. This is useful when you made a mistake in software or wiring and accidentally let a MOSFET ON or in floating state. The desk supply current draw will alert you before you smell the burning silicon 🙂

Dht11 install
Dht11 install
Temperature sensor installation
Temperature sensor installation
MOSFETs
MOSFETs
LCD
LCD
Flame sensor
Flame sensor
Flame sensor with cover
Flame sensor with cover
Final
Final
Added gas sensor
Added gas sensor

Making the box

I just used an old shoebox and cut it to my spec. Laser cut Acrylic sheet was my first choice but did not get my hands on it.

shoebox
caption (optional)

shoebox

shoebox

Drilling

Leave a Comment

Your email address will not be published. Required fields are marked *