Introduction
The aim of this project is to create lint build-up detector device that will be placed inside a dryer hose of an apartment complex. The device will monitor lint build up level and warm the landlord/renter/owner when the lint build-up is at a dangerous level that can trigger a fire.
Methodology
The device detect lint build up by using an LED and a photoresistor. The LED and photoreistor sit across each. The main board will read the voltage value from the photoresistor. Initially the photoresistor will give high voltage value but as lint build-up occur. The voltage reading will decrease and this is an indication that lint build-up is a fire hazard.
Wiring
Note: The ST B-L072Z-LRWAN1 have the same pinout as the Arduino so i just used Arduino in fritzing instead. The wiring should be exactly the same on the ST B-L072Z-LRWAN1.
First , the LED positive is connected to Digital Pin 13. LED negative pin is connected to GND.
For the photoresistor, on leg is connected directly to 5V. The other leg is connected to the resistor and Analog Pin A0. Finally the unconnected side of the 10k reistor is connected to GND. This create a voltage divider so that we can read the voltage value coming out of the photoresistor.
Software
Note : Before you begin follow the step from Helium Developer Board Quickstart guide first.
include "LoRaWAN.h"
const char *devEui = "FILL_ME_IN";
const char *appEui = "FILL_ME_IN";
const char *appKey = "FILL_ME_IN";
uint8_t payload[2];
uint8_t led1 = 13;
uint8_t value; // Store value from photoresistor (0-1023)
const int pResistor = A0; // Photoresistor at Arduino analog pin A0
void setup( void )
{
Serial.begin(9600);
while (!Serial) { }
// US Region
LoRaWAN.begin(US915);
// Helium SubBand
LoRaWAN.setSubBand(2);
// Disable Adaptive Data Rate
LoRaWAN.setADR(false);
// Set Data Rate 1 - Max Payload 53 Bytes
LoRaWAN.setDataRate(1);
// Device IDs and Key
LoRaWAN.joinOTAA(appEui, appKey, devEui);
pinMode(led1, OUTPUT);
}
void loop( void )
{
if (LoRaWAN.joined() && !LoRaWAN.busy())
{
analogWrite(led1, 20);
value = analogRead(pResistor);
Serial.println(value);
payload[0] = value;
if(value > 300)
{
Serial.println(" Lint level : Low");
payload[1] = "low";
}
else
{
Serial.println(" Lint level : High");
payload[1] = "high";
}
// Send Packet
LoRaWAN.sendPacket(1, payload, sizeof(payload));
}
delay(20000); //20 Seconds
}
The follow code use the general Helium network communication template with modification to include the sensor code in the void loop(). Inside the void loop(), the board check if if it can join the Helium hotspot then read in the voltage value from the photoresistor and determine if the lint build up level is high or low. Finally, the voltage value and and lint build-up level will be sent as a payload to the Helium Console.
Next we going send our data to the Helium Console. If the following code don't work it mean that you don't have a Helium hotspot near you and must create one. Use the the following guide to set up your own Helium Hotspot .
Once the hotspot is setup and your board can connect to it. The sensor data will be send to the console and you can monitor your lint level build up using the Helium Console.
Demo Video
Comments