Project description:

Post date: Apr 30, 2015 6:17:55 AM

I want to connect multiple sensors, switch and display on one arduino board to check out how it's work and what i can do with some of the sensors provided with the arduino starter kit and RFrobotic beginer kit.

Components:

1 Temperature sensor LM35

1 Temperature sensor TMP36

1 photo resistor VT90N2 LDR

1 Ultrasonic HC SR04

1 PIR Sensor DSUN

1 Piezzo buzzer unknown reference for DFRobotic.

2 miniswitch

1 tilt sensor unknown reference fro DFRobotic

1 Alphanumeric display 16x2 WH1602B

Temperature:

The two sensors are directly connected between the 3.3Volt, the Pin A0/A2 and the ground of the arduino board.

the 3.3V is connected to the AREF pin to use external reference for the ADC.

I choose to use Aref 3.3V to increase the resolution of the ADC. 3.3/1023 =0.0032V per step instead of 5/1023=0.0048V per step.

I want to compare the reading of the 2 sensors and display the result on the LCD Screen.

The system will take an average of 100 reading before printing the average result for stability of the measurement. The software should record the maximum and minimum temperature for the two sensors.

The formula to convert voltage to temperature for the TMP36 sensor is:

Temp in °C = [(Vout in mV) - 500] / 10

The formula to convert voltage to temperature for the LM35 is:

Temp in °C = (Vout in mV) / 10

check out this article from adafruit website https://learn.adafruit.com/tmp36-temperature-sensor for more info about the calculation.

Light measurement:

The sensor is connected to the 3.3 Volt and AREF and the arduino analog input A1 via a pull down resistor of 10 KOhm.

I want to calculate a rough value in LUX of the reading of the LDR. LDR are not perfect sensor to measure lux because they don't react the same to all the light colors.

I found in this article https://arduinodiy.wordpress.com/2013/11/03/measuring-light-with-an-arduino/ the formula to calculate the LUX from the reading in volt of the LDR.

the formula is Vout=(3.3/(10+Rldr))*Rldr ==> Lux=(2500/((AnalogRead*3.3/1024)-500))/10

An other option would have been to calibrate the light sensor with the reading of an external LUX meter such as Beecam Light meter for android.

The software should record and display max and min light reading.

A second screen must display a text according to the light conditions:

light < 10 "Night"

10 > light < 200 "Dark Overcast"

200 > light < 1000 "Overcast/room"

1000 > light < 10000 "Day Light"

light > 10000 "Sunny"

a counter should count and display the number of darkness to light events.

This could help to answer the fundamental question : is the light in my fridge is still on when i close the door.

Movement detection, alarm and distance reading:

I want to trigger a sound alarm when motion is detected by the PIR sensor. The sound can be canceled by a switch button. State LOW the sound is triggered by the PIR State HIGH the alarm is silent and only an alarm message will be display on the LCD screen when motion detected by the PIR sensor.

When motion is detected by the PIR the Ultrasound sensor should measure and display the distance of the object who had trigger the PIR.

I add a resistor to the + of the buzzer to reduce the volume during the test period. I could have programm it but a resistor do the job and it much easier to setup

Display:

The display should show 3 different main screen:

1st screen:

1st line:Temperature of the LM35 temperature sensor,average, min and max

2nd line Temperature of the TMP36 temperature sensor,average, min and max

2nd screen: rotating screen every 5 seconds to display

first the average light measurement on the first line and min max measurement on the 2nd line.

2nd screen display the light condition text on the first line and the day/night count on the 2nd line.

3rd screen:

first line:Alarm status and alarm trigger button state

2nd line: distance of the detected object.