With Covid-19 still rampant, we need to be vigilant. Mask wearing, social distancing and properly washing or sanitizing our hands from time to time is absolutely essential to avoid this. As a precaution, you should also avoid touching any item including electrical switches as much as possible. In public places, schools and offices, electrical switchboards are touched by everyone, so the virus can be transmitted from one person to another.
Here’s a solution in the form of a 4-channel touchless keyboard. The Arduino Uno is the heart of the project, surrounded by four ultrasonic sonic sensors, it offers a simple, low-cost and novel solution. The switches can be turned on and off alternately by placing the hand next to the device’s ultrasonic sound sensors, without touching.
circuit and work
Figure 1 shows the circuit diagram of a 4-channel non-touch switchboard. It consists of four ultrasonic sensors HC-SR04 (SEN1-SEN4), a four-channel relay board (RM1) and an Arduino Uno (Board1).
The microcontroller on the Arduino Uno board receives the switching signals from the sensors and the program code sends the signals to the 4-channel relay module thus turning on/off the devices. The HC-SR04 ultrasonic sound sensor is used to sense the conversion action.
The pin details of the HC-SR04 Ultrasound Sensor are shown in Figure 2. It has the following four pins:
VCC: +5V DC
Trig: on (enter)
Echo: echo (directed)
Sensors can be easily interfaced with the Arduino Uno. When a hand is placed about 5 cm from the sensor, the program in the Arduino reads the signal and the relay is energized to perform the switching procedure. When placing the hand back near the sensor, the Arduino again reads the signal and the relay is de-energized to toggle the switch from its previous position. A similar procedure is performed with all other ultrasonic sound sensors.
Table 1 shows the comparison of different types of switchboards that are generally available. Table 2 shows the Arduino Uno pin connections with the components.
4-channel relay board
Figure 3 shows a 4-channel relay board. This is a low level 5V board that each channel consumes 15-20mA driver current. It can be used to power many high current consuming devices as it is equipped with high current relays operating under 250V, 10A AC or 30V, 10A DC. It has a standard interface that can be controlled directly by the microcontroller.
This unit is optically isolated for high safety voltages and has four SPDT relays.
The fourchan.ino program is loaded into the internal memory of the Arduino Uno. The program is simple and easy to understand. Comments are given at the end of each command line.
The following must be specified in the code first:
- Echo and trigger pins for ultrasonic sound sensor
- Four-pin relays
- Intermediate variables for the migration process
- Variables for all four sensors
Next, a void setup() function must be created. The corresponding pins must be configured as inputs and outputs. Then the serial connection must be started. Serial communication has nothing to do with the project, it is only used to analyze the program on the screen.
The loop() function allows the program to change and respond. It is used to actively control the Arduino Uno board. Activate the echo sensor. Calculate the distance and perform the on/off switch procedure. Pass the switch state to the relay. Write the code above for all the other 3 sensors and relays as well.
Build and test
The circuit requires a 12V, 1A power supply. Connect the unit as shown in the circuit diagram. Keep some distance between the four Echo sensors so that their operation does not affect the adjacent sensors.
A PVC keyboard box can be used to enclose the Arduino Uno and the relay board. Connect AC devices according to the specifications of the relays. The phase connection (L) and the neutral wire (N) are shown in the circuit diagram. The author’s prototype is shown in Figure 4.
Noticeable. The Arduino Uno board and the HC-SR04 sensors are very sensitive, so handle them with caution. You need to slowly bring your hand closer to the sensor and slowly remove it.
caution. Take precautions while handling AC mains tubes. Novice experimenters are advised to consult an expert before making AC connections with relays.
Download source code
K. Murali Krishna Works as Junior Engineer, BSNL, Rajahmondon, Andhra Pradesh. He is an electronics enthusiast, circuit designer, and technical writer.