December 18, 2016

Auto light switch for bathroom using laser and IC4017

Many people forgets the bathroom and toilet lamps in ON state, absolutely this causes increasing electric bill and even decrease lamps lifespan. This circuit is a simple way to turning ON and OFF the bathroom or toilet lamp automatically without using microcontroller.
The circuit based on the counter IC4017 and laser. when a person go to bathroom his body cut the laser ray that is focused on the LDR in another side of the door frame, connecting and disconnecting the laser ray changed the LDR electric resistance and giving a positive signal to pin14 of the IC4017 through transistor 2N2222, since pin4 jumped to reset pin (pin15) so the output selector will be changed between pin3 and pin2. Pin3 run the transistor to running the relay.
Two LEDs showing ON state and OFF state. 330 ohm resistor used to LEDs protection by giving 15mA current to them.
You can use any other NPN transistor rather than 2N2222 such as BC547, C9013, 2N5551, etc. 
This circuit is suitable for light switching for any place that used by one person such as toilet and bathroom, you can't use it for the room because when second person coming  inside the room the lamp will be turns OFF.

Part list:
IC4017
Transistor 2N2222
Laser 5mW
Relay 5v 
LEDs
LDR
Resistor 1K
Resistor 200K
Resistor 2.2K
Resistor 330R
Capacitor 10nF
Diode 1N4007


Auto light switch for bathroom using laser and IC4017

Auto light switch for bathroom using laser and IC4017

In following video you can watch how the circuit works:
Please subscribe to my YouTube channel here: 
https://www.youtube.com/c/EngMousaalkaabi?sub_confirmation=1


November 26, 2016

220V Auto room light switch using Arduino and Laser (Visitor counter)

Many peoples forgets the Room lamps in running state when nobody in the room, this causes increasing electric bill or battery energy losing in solar home.
This Arduino project is a visitor counter that turns OFF the lamp when nobody in the room automatically, it also can used for lamps of bathroom, toilet, kitchen, etc.
Visitor counter can makes by using different types of sensors, such as IR ray, Ultrasonic, Avoidance sensor, Laser ray, etc.
Here i used Laser because the laser has long distance range, Avoidance sensor is very easy to use but its distance rang is lower than 30cm.
You can make this project with LCD display for showing the numbers of people in the room but as you can see in the video i don't used display because its not important for me, any way the code is same with or without display.
This project help to power consumption optimizing. 

Parts list:
Arduino board 
1 Channel Relay module
Laser diode(2 pcs)
Light sensor modules(2 pcs)
Adapter 5v 200mA
If you want to using display, need :
16X2 LCD Display
Resistor 10K
Resistor 220 ohm

220V Auto room light switch using Arduino and Lazer (Visitor counter)


220V Auto room light switch using Arduino and Lazer (Visitor counter)

220V Auto room light switch using Arduino and Lazer (Visitor counter)

Manual OFF switch used when you are in the room but want to turning OFF the lamp for sleep.

220V Auto room light switch using Arduino and Lazer (Visitor counter)


I used 1000uF 16v capacitor for power line to protect the arduino board from sudden voltage raising but its not necessary.

220V Auto room light switch using Arduino and Lazer (Visitor counter)

220V Auto room light switch using Arduino and Lazer (Visitor counter)



There are some important notes for making this project: 

1-Put the laser diode in the door frame before LDRs to determine the LDRs suitable position and to making sure the laser beam and LDRs are in same straight line. 

2-The laser diodes must set in suitable height to become suitable for all peoples with different long. also you have pay attention to door handle position, when the door is closed, handle maybe cuts the laser beam so put the laser beam above the handle.

3-The laser is harmful for eyes when its directly toward your eyes. 

4-One problem will happen for ONLY FIRST TIME USING this project. That problem is:
When you are in the room and turns this project ON for first time the light will be OFF because the Arduino count zero people come in the room(nobody) when you try to getting out the room the arduino turns ON the light because it count -1 people in the room. So in first time please try to get out the room without cutting the laser beam.
I'm trying solve this problem in the code.  



Code:

#include<LiquidCrystal.h>
LiquidCrystal lcd(0, 1, 3, 4, 5, 6);
#define in 11
#define out 12
#define relay 13
int count=0;
void IN()
{
    count++;
    lcd.clear();
    lcd.print("Person In Room:");
    lcd.setCursor(0,1);
    lcd.print(count);
    delay(1000);
}
void OUT()
{
  count--;
    lcd.clear();
    lcd.print("Person In Room:");
    lcd.setCursor(0,1);
    lcd.print(count);
    delay(1000);
}
void setup()
{
  lcd.begin(16,2);
  lcd.print("Visitor Counter");
  delay(2000);
  pinMode(in, INPUT);
  pinMode(out, INPUT);
  pinMode(relay, OUTPUT);
  lcd.clear();
  lcd.print("Person In Room:");
  lcd.setCursor(0,1);
  lcd.print(count);
}
void loop()

 
  if(digitalRead(in))
  IN();
  if(digitalRead(out))
  OUT();
 
  if(count<=0)
  {
    lcd.clear();
    digitalWrite(relay, LOW);
    lcd.clear();
    lcd.print("Nobody In Room");
    lcd.setCursor(0,1);
    lcd.print("Light Is Off");
    delay(200);
  }
 
  else
    digitalWrite(relay, HIGH);
 
}

November 23, 2016

AC 220V Frequency counter using arduino

In this project i used Arduino and some other electronic components for AC mains frequency measurement.
Since Frequency is equal to: 1 divided by time period, so in first we should measure the time period. Time Period is the time of one full wave in AC voltage, means positive half wave+negative half wave.
Here i used optocoupler for detecting the frequency of AC voltage. 47K resistor decrease the current to about 5mA for running the optocoupler and one diode for half wave rectification  So the arduino here calculate the ON time and OFF time of optocoupler that connected to Pin 13 in arduino board, then divided 1 by (ON+OFF) Time for give the frequency. 
Since in arduino code the time always must insert as millisecond so we devide 1000 by ON+OFF Time for give the frequency.
The circuit 100% insulated from mains voltage and can not be harmful for your arduino board.
You can use any other available optocoupler rather than 817B. 

AC 220V Frequency counter using arduino

Parts list: 
Arduino board
LCD display 16x2
Resistor 10K
Resistor 220 ohm
Resistor 47K / 1W
Diode 1N4007
Potentiometer 10K
Optocoupler 817B or any optocoupler  

NOTE: Don't touch the circuit when it connected to mains voltage.
 
AC 220V Frequency counter using arduino

AC 220V Frequency counter using arduino

Please subscribe to my YouTube channel here: 




Code:

 #include <LiquidCrystal.h>
int input=13;

int high_time;
int low_time;
float time_period;
float freq;
float frequency;
LiquidCrystal lcd(0, 1, 3, 4, 5, 6);
void setup()
{
pinMode(input,INPUT);
lcd.begin(16, 2);
}
void loop()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Frequency Meter");

high_time=pulseIn(input,HIGH);
low_time=pulseIn(input,LOW);


time_period=high_time+low_time;
time_period=time_period/1000;
frequency=1000/time_period;
lcd.setCursor(0,1);
lcd.print(frequency);
lcd.print(" Hz");
delay(500);
}

July 25, 2016

Fridge door alarm circuit with delay time

New fridge models contain an alarm to notice door leaves open, it prevent energy losing.
This circuit is a simple fridge door alarm that active when the fridges door leaves open for 15 seconds, this delay time depend on 10uF capacitor so you can increase this delay time by increasing the capacitor value.
Alarm sound frequency depend on second capacitor value.
The circuit run with 9v battery and draw 40mA when the alarm is active and lower than 10mA when it is in standby state. Its better to use a rechargeable 9v battery.

Parts list:
IC555 (2pcs)
Buzzer
LDR
Resistor 1M
Resistor 1.5M
Resistor 100K
Capacitor 10uF
Capacitor 220nF
Battery 9v

Fridge door alarm circuit with delay time

Fridge door alarm circuit with delay time

July 22, 2016

1.5V Electric fly zapper circuit

This circuit is an electric zapper that can convert 1.5v to very high voltage, so it can used as a fly killer. you have to connect two thin metal grid to the output exactly look like to commercial fly zapper. output voltage can reach to more than 2000v.
You can use almost any other PNP transistor rather than S8550 and any other NPN transistor rather than S9013.
The circuit run with 1.5v and consume 40mA to 100mA.

Parts list:
Transistor S9013
Transistor S8550
Resistor 30K
Capacitor 100nF
Capacitor 2uF 400v (8pcs)
Diode 1N5408 (8pcs)
Transformer 6v
Battery 1.5v 
Two thin metal grid



1.5V Electric fly zapper circuit1.5V Electric fly zapper circuit


July 12, 2016

220v AC timer using IC 555

This is a very useful timer that can run 110/220v AC load up to 10A.
This circuit give 5 time periods from 1 minute to 60 minutes, you have to select the time by time selector switch then press START to activating the relay for running the AC load and turning OFF the load after selected time automatically. 
Maximum time period in this timer is 60 minutes but if you need to higher period so you have to increase the value of 470uF capacitor or 4M resistor to higher value. 
If you need this timer for DC loads so can use second circuit diagram.

Parts list:
IC 555
Transistor 2N5551
Relay 12v
Red LED
Green LED
Push switch 
Selector switch
Diode 1N4007
Bridge diode 1A
Zener diode 12v 1W
Capacitor 470nF 400v
Capacitor 220uF 16v
Capacitor 100nF
Capacitor 470uF 16v
Resistor 270 ohm 2W
Resistor 30K
Resistor 1K(3pcs)
Resistor 100K
Resistor 500K
Resistor 1.5M
Resistor 2M
Resistor 4M

220v AC timer using IC 555





220v AC timer using IC 555

220v AC timer using IC 555 220v AC timer using IC 555

July 11, 2016

Running small 220v lamp by 1.5v battery

This circuit is a simple inverter that convert 1.5v to high voltage. 

Parts list:
Transistor BC547 
Transistor BD140
Transformer 220v:6v
Capacitor 100nF
Resistor 30K 



Running small 220v lamp by 1.5v battery
Running small 220v lamp by 1.5v battery

Please subscribe to my YouTube channel here: 
 

July 06, 2016

Simplest heat sensor using NTC

There are different elements to electronic temperature measuring such as LM35, NTC, PTC, 18B20 and even diode 1N4148, some of them have very high precision in temp. measuring and some other have low precision and used only for detect if the temperature is cold or hot.
Following circuit is simple way to using NTC, when the temperature raise over a certain temp.(more than 41C when the potentiometer set in mid level ) NTC's  electric resistance decreased and run the transistor for running the buzzer or any other load. Potentiometer using for set the temperature level that buzzer active. you can use any other NPN transistor for this circuit.
The circuit works by 5v and consume lower than 10mA when the buzzer be turn ON.
Parts list:
Transistor S9013
NTC 10K
Buzzer
Potentiometer 1K
Resistor 470 ohm

Simplest heat sensor using NTC

Simplest heat sensor using NTC

May 28, 2016

Turn ON-OFF 220v electric appliances by any IR remote control

By this circuit you can turn ON and OFF an electric appliance up to 10A by any IR remote control such as remote control of TV, satellite, air conditioner ... etc.
Red LED run when the load is turn OFF, it help you to find the switch position in dark.
I put here two circuits, they are similar but the first contain a transformerless power supply circuit to convert 220v to 12v and 5v for running the 12v relay and the IC, but the second circuit is easier to make because used a 5v mobile charger to running the circuits by 220v.

Parts list:
IC 4017
IC 7805
Transistor 2N2222
Transistor S9012
Diode 1N4007
Bridge diode 1A
Zener diode 12v 1w
LED
IR receiver 1838A
Capaciror 470nF 400v
Capacitor 220uF 16v
Capacitor 0.47uF
Resistor 270 ohm 2w
Resistor 1K
Resistor 100K
Resistor 47 ohm
Resistor 220 ohm
Relay 12v


Turn ON-OFF 220v electric appliances by any IR remote control

Turn ON-OFF 220v electric appliances by any IR remote control

Turn ON-OFF 220v electric appliances by any IR remote control

Turn ON-OFF 220v electric appliances by any IR remote control
Please subscribe to my YouTube channel here: 
https://www.youtube.com/c/EngMousaalkaabi?sub_confirmation=1


May 25, 2016

220V ON-OFF Latching touch switch by one touch plate only

This is second 220v touch switch that i made. the first one was made by IC4011.
Touching plate completely insulated from the main supply and can't be dangerous.
Red LED allowing you easily to locate the switch in the dark, it be turn OFF when the AC lamp running ON.
The touching plate must touch for 1 second for turning the load ON or OFF.
You can't use very big touching plate for this circuit and the wire of touching plate must be short as possible. This circuit can run up to 10A load.

Parts list:
IC555
Bridge diode 1A
Diode 1N4007
Zener diode 12v 1W
Transistor 2N2222
Relay 12v
LED
Resistor 1K
Resistor10K(3pcs)
Resistor 270ohm 2W
Capacitor 220uF 16v
Capacitor470nF 400v
Capacitor 47uF

Note:
Don't touch the circuit when it connected to the main voltage, even after power separating there are some remaining voltage in the capacitor that can give you shock.

220V ON-OFF Latching touch switch by one touch plate only

220V ON-OFF Latching touch switch by one touch plate only


May 20, 2016

LED chaser with only one IC555

This circuit is a simple LED chaser, (Bike Turning Signal Circuit) used IC 555 and 5 transistors.
Here we used IC 555 as astable multivibrator to running the transistors.
Flashing speed depend on both capacitors.
1K resistors used for each LED as protection.
The circuit run with 12v and draw 40mA current when all LEDs be turn ON.

Parts list:
IC555 https://goo.gl/R2x7X3
LEDs(5pcs) https://goo.gl/SPCY5o
Transistor S9013(5pcs) (Transistor Kit https://goo.gl/5csLJy)
Diode 1N4148 https://goo.gl/y5S4sr
(Capacitor Kit https://goo.gl/6zqbJy)
Capacitor 470uF
Capacitor 100uF
(Resistor kit https://goo.gl/p4JvQY)
Resistor 4.7K (2pcs)
Resistor 10K (2pcs)
Resistor 680 ohm
Resistor 1K (6pcs)

LED chaser with only one IC555

LED chaser with only one IC555

Please subscribe to my YouTube channel here: 


May 16, 2016

Roulette circuit with touch switch using IC4017

Some games need to pick a random number. this circuit is a roulette with touch switch using IC4017 and IC555.
When you touch the wires, LEDs moving speed up and when release them slow down and stop on a number.
Flashing speed of LEDs depend on 1uF capacitor and time period between LEDs speed up and stopping depend on 0.47uF capacitor, so you can changes them by other value if you want to change that speed.
You can run this circuit by 5 to 12v and power consumption is very low (lower than 10mA).

Parts list:
IC4017
IC555
Transistor BC557
Capacitor 1uF
Capacitor 0.47uF
Capacitor 100nF
Resistor 3.9M (3 pcs)
Resistor 1K
Resistor 13K
Resistor 330R ohm for 5v power supply 680 ohm for 12v power supply
LEDs (10 pcs)

Roulette circuit with touch switch using IC4017

Roulette circuit with touch switch using IC4017



Roulette circuit with touch switch using IC4017


May 13, 2016

2 Lamps, 2 switchs, 1 wire

When you have a pair of N and L wires and want to turn ON-OFF two lamps SEPARATELY, you have to add third wire, adding third wire for second lamp on the workbench is easy, but that is very hard or impossible if your wires are inside the wall.
This is a very very simple idea for solving a big problem. you just have to using 4 diodes.
First 2 diodes are responsible of running first lamp and another 2 diodes responsible of running second lamp.
In following video i used 3A diodes(1N5408), but 1A diodes such as 1N4007 are enough.

2 Lamps, 2 switchs, 1 wire
2 Lamps, 2 switchs, 1 wire
Since diodes run the load just in half AC cycle so the lamp give half luminescence because it will consumed half power,

2 Lamps, 2 switchs, 1 wire


for this reason we have to add an capacitor parallel with the load(Lamp) as you can see in following pic.

2 Lamps, 2 switchs, 1 wire

2 Lamps, 2 switchs, 1 wire

After adding the capacitor this problem solved, following fig. shown the power consumption of 100W lamp before using capacitor(in left) and after using the capacitor(in right) in this circuit.

2 Lamps, 2 switchs, 1 wire





May 03, 2016

Wireless power transmitter using IC555

This is a wireless power transmitter that used IC 555 and power transistor.
I used it for running 36 white LEDs.
You can use any other NPN power transistor instead of 13003.
Both coils are 30 turns enamelled wire 30 SWG with 5cm diameter.
10 ohm resistor that placed between base of transistor and pin3 of IC, can replaced by 5 to 75 ohm resistor or jumped, if you jumped it the max. distance range between two coils increased.(power consumption also increased)
The circuit run by 3v battery and power consumption is 80 to 270mA.

Parts list:
IC555 https://goo.gl/R2x7X3
Transistor 13003 (Transistor Kit https://goo.gl/5csLJy)
Coils 30 turns, 5cm diameter, 30 SWG wire
(CeramicCapacitor kit https://goo.gl/q29Du3
Capacitor 3.3nF
Capacitor 47nF
(Resistor kit https://goo.gl/p4JvQY)
Resistor 1k
Resistor  10 ohm
Resistor 10k
LEDs https://goo.gl/SPCY5o
Battery 3v



Wireless power transmitter using IC555

Wireless power transmitter using IC555



Wireless power transmitter using IC555


Please subscribe to my YouTube channel here: 
https://www.youtube.com/c/EngMousaalkaabi?sub_confirmation=1






April 29, 2016

Phone ringer circuit

This is simple phone ringer circuit using IC 4060.
Can run it by 5 to 12v and its power consumption is very low, lower than 10mA.
You can use any other PNP transistor rather than S9012.

Parts list:
IC 4060
Transistor S9012(3pcs)
Capacitor 3.3nF
Resistor 13k (3pcs)
Resistor 100k
Potentiometer 100k
Buzzer

Phone ringer circuit

April 26, 2016

Sequential LED flasher using IC 4017 (KNIGHT READER)

This is a beautiful sequential LED flasher (LED chaser) that also called KNIGHT READER CIRCUIT.
Flashing speed can changed by changing the value of capacitor or 33K resistor. 
The circuit run by 5v and draw very low current lower than 10mA.
You can run the circuit by 12v battery but you have use 1K resistor rather than 470ohm resistor to LED protection.

Parts list:
IC4017
IC555
Resistor 470 ohm
Resistor 33K
Diode 1N4148(8pcs)
Capacitor 2.2uF
LEDs(11pcs)
 

Sequential LED flasher using IC 4017 (KNIGHT READER)

Sequential LED flasher using IC 4017 (KNIGHT READER)


Sequential LED flasher using IC 4017 (KNIGHT READER)



Arduino Gas leakage sensor with LCD display

Arduino Gas leakage sensor with LCD display

Parts list:
Arduino board https://goo.gl/XR3mXG
LCD display 16x2 https://goo.gl/yTjFJS
Resistor 220 ohm (Resistor kit https://goo.gl/p4JvQY)
MQ-2 gas sensor module  https://goo.gl/eFg3Se
Potentiometer 1K (Potentiometer Kit https://goo.gl/z5b4X1)
Connecting wires https://goo.gl/BVC3pM



Arduino Gas leakage sensor with LCD display

Arduino Gas leakage sensor with LCD display


Arduino Gas leakage sensor with LCD display

Please subscribe to my YouTube channel here: 


Code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);


int potPin = A4;

int potValue = 0;

int buzzer = 6;


void setup() {

    lcd.begin(16, 2); // lcd rows and columns

    lcd.print("GAS SENSOR");

    pinMode(6, OUTPUT);


}


void loop() {

    potValue = analogRead(potPin);

  

    lcd.setCursor(0, 1);

    lcd.print("Value = ");

    lcd.print(potValue);

    delay(1000);

    lcd.print(" ");

    delay(1);


if (potValue>15)

{

    digitalWrite(6,HIGH);

    delay(1000);

  }

}