In this post we are going to construct a password based mains ON/OFF switch circuit, which can turn ON and OFF the AC mains supply, only when correct password is entered. This prevents the danger of electrocution of the technician who might be currently working with the high voltage lines and equipment.
By Girish Radhakrishnan
The biggest nightmare for any electrician or technician is an accidental activation of AC lines by someone, which might kill or cause fatal damage to the body organs in a blink of an eye.
This password protected mains ON/OFF switch circuit prevents such unfortunate incident and allows the technician to turn ON the AC mains supply safely by entering correct password and not just by flipping a lever.
This project presents the facility to change password which is stored in the EEPROM of Arduino’s microcontroller.
Human body or even animal body has its own electrical system, which helps to send information from one part of the body to another part. The information is send as electrical signals which have measurable amplitude and frequency. It also helps to contract and relax the muscles, for example our heart.
Fun Fact: Heart has a multivibrator like signal generator called “SA node” or “Sinoatrial”; which controls the heart rate. If Sinoatrial fails we have to apply external electrical signal to heart using pacemaker.
Any surge to existing electrical signals of our body will make lose control over our own body parts. That’s why people feel getting stuck and paralyzed when they come in contact with an open electrical LIVE wire.
Our body have reasonable resistance and also good amount of electrical conductance. We know that any element with resistance generate heat when electric current is passed.
This applies to human body too; the heat damages the organs and may cause blood to boil. Soon or later the person may die if he/she got electrocuted long enough.
That’s enough medical electronics for now. Let’s move on to technical details.
The project consists of LCD display, a 4 x 3 alphanumeric keypad, a status LED and relay.
Schematic for Arduino and LCD connection:
The display is connected to analog pins of the arduino from A0 to A5. The display is unusually connected to analog pins (which functions same as connected to digital pins) so that keypad can be connected to digital pins (from 2 to 9).
Adjust display contrast using the 10 K ohm potentiometer.
The keypad has 8 cables which should be connected to Arduino, from pin #2 to pin #9. The left most wire of keypad must go to pin #9 and connect the succeeding right to next wire of keypad to pin# 8, 7 ,6, 5, 4, 3, 2, the last or the right most wire of keypad must go to pin #2.
Rest of the electrical connections:
You need to download and add the keypad library from the following link: https://github.com/Chris--A/Keypad before compiling the code.
EEPROM of Arduino microcontroller would have some random values stored initially. We have to reset to zero, so that our main program don’t get confused. To rest EEPROM values to zero upload the below program first and then upload the main program second.
Program for resetting EEPROM (Upload this first):
phew!!….That’s a massive program code.
How to operate this password based mains ON/OFF switch project:
· With completed hardware setup, upload the EEPROM reset code.
· Now, upload the main program code.
· It will ask you to create 6-digit number password (no less or no more) on LCD, create a password and press “A”.
· Re-type the password again and press “A”. Your password is saved.
· You can change password by pressing the “C”. Enter the current password and enter the new password.
· To toggle the AC mains ON or OFF, press “D” and enter the password and press “A”.
Functions of keys A, B, C and D:
A – Enter/Yes
B – Cancel/NO
C – Change Password
D – Toggle AC Mains
If you have any specific question regarding this password based AC Mains ON/OFF switch circuit project, express in the command section, you may receive a quick reply.