Humidity sensor with led alarm | Arduino project

This page contains Arduino Humidity sensor with led alarm source code. This project is good for someone who wants to make a humidity meter or hygrometer with led alarm if humidity and temperature over a threshold. It's easy to make and doesn't require an external power supply, just use power from an Arduino UNO R3 board (USB power compatible with this project).

Electronic components list:
1 x Arduino Uno R3
1x 20 x4 I2C LCD display
1 x AM 2320 humidity/temp sensor
1 x 5 mm led ( 2 x if you plan to use led for pin 13 instead built-in led)
1 x 1000 ohms resistor ( 2 x if you plan to use led for pin 13 instead built-in led)
Any USB power adapter, 500 mA current at least.

Here is the Arduino code:
AM 2320 library
LCD display i2c library

#include <Wire.h>
#include <AM2320.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 20, 4);
AM2320 th;
int led2 = 12;

Automatic night light switch project

Hello, today I'm going to show you how to make automatic night light switch. This circuit is easy to make and uses few electronic components.

This automatic night light switch project makes you save your electricity bill and makes your light bulb life longer. The circuit uses 5 volts power supply so you can use old USB cell phone charger as a power source or you can use any 5 volts adapter that rate at least 100 mAh. 

Electronic components list:
BD139 npn transistor = 1
BD140 pnp transistor = 1
100 kilo-ohms resistor = 2
5Volts@100 mAh adapter
1 kilo-ohms resistor = 1
Led = 1 ( you can remove 1 kilo-ohms resistor and LED if you don't need LED indicator)
1 LDR (light dependent resistor) = 1
5 volts Relay = 1
All resistor are 1/4 watts rating

Full wiring diagram

Circuit explains:
BD 140 is a PNP transistor that amplifies small current from 2 x 100 kilo-ohms resistor and sending current to  BD 139 NPN transistor Base (B) and amplifies current again until the current high enough to drive a Relay to turn on. 

When an environment light is enough the LDR's resistance is very low (1000- 100 ohms)and steal current that supply to BD 140 Base(B) from 2x100 kilo-ohms so the circuit doesn't have enough current to drive a Relay to turn on, but when an environment light is not bright enough, the LDR's resistance is higher(10,000 to 20,000 ohms) and it can not steal enough current from 2x100 kilo-ohms resistors that feed to BD140 so the current is enough to drive BD 139 to turn fully on and make a relay switch to NO position.

You can replace one 100 kilo-ohms resistor with 100 kilo-ohms variable resistor if you want to adjust light sensor sensitivity.

See the test circuit video below.