Thursday, May 9, 2024

Smart Timer For Liquid Electronic Mosquito Repellents

efy tested

As the hazards of mosquitoes are increasing day by day, the usage of liquid (electric) mosquito repellents is on the rise as well. These devices are widely employed for ensuring a good night’s sleep and are also commonly found in offices to enhance work environments.

Most liquid mosquito repellents are ruggedly constructed and operate continuously once activated. But the continuous operation of these mosquito repellents causes the vapour content in the room to exponentially increase over time, which can cause harmful breathing effects and allergic reactions.

Liquid Mosquito Repellents Smart Timer
Fig. 1: Liquid Mosquito Repellents Smart Timer

The smart timing operation for liquid mosquito repellents addresses this issue, offering different modes suitable for residential and office purposes. The author’s prototype is shown in Fig. 1, with the required components listed in Table 1.

Table 1: Bill of Materials
ComponentsQuantity
Arduino Uno board (MOD1)1
DS1307 RTC module (MOD2)1
One channel 5V relay module1
10-kilo-ohm resistor (R1, R2, R3)3
On/off switch (S1 through S4)4
12V DC adaptor1

Liquid Mosquito Repellents Timer – Circuit and Working

The circuit diagram of the smart timer for liquid mosquito repellents is shown in Fig. 2. It is built around the Arduino Uno board (MOD1), RTC DS1307 module (MOD2), 5V relay module, 5V buzzer (B1), and a few other components.

The positive terminal of the buzzer (B1) is connected to pin D13 of the Arduino Uno, with its ground pin connected to the Arduino ground. A 12V DC adaptor that powers the circuit is directly connected to the DC socket on the Arduino Uno board.

- Advertisement -
Liquid Mosquito Repellents Timer Circuit
Fig. 2: Circuit diagram

The relay’s normally-open (NO) pins are connected to a 220V AC, 6A electrical socket, which is also used to connect the liquid mosquito repellents. An additional 6A SPST electrical switch (S4) is connected across the NO and COM pins of the relay module, which acts as a bypass switch whenever a smart switching action is not needed. Images of the DS1307 I2C RTC module and the 5V relay module are given in Fig. 3 and Fig. 4, respectively.

DS1307 I2C RTC module
Fig. 3: DS1307 I2C RTC module

The Arduino board, which is the heart of the system, is central to the real-time clock, mode selection switches, and the 5V relay board. The main purpose of the timer is to regulate the on/off cycles of the liquid mosquito repellent according to different modes of operation.

One-channel 5V relay module
Fig. 4: One-channel 5V relay module

For convenience, it has seven modes that can be selected by three switches.

- Advertisement -

Mode 1: Night mode: In this general-purpose mode, the controller automatically switches on the mosquito repellent from 6:00 pm to 6:00 am for uninterrupted sleep. To enable this mode, keep switches S1, S2, and S3 open.

Mode 2: Night toggle mode: In this mode, the timer switches on the repellent continuously from 6:00 pm to 00:00 hours, then toggles from 00:00 hours to 6:00 pm, every hour. To enable this mode, close switch S1 and keep switches S2 and S3 open.

Mode 3: Night toggle mode with buzzer: It is similar to mode 2, but has an added feature of a buzzer acting as a wake-up alarm at 6:00 am. To enable this mode, close switch S2 and keep switches S1 and S3 open.

Mode 4: Office mode: In this mode, it operates continuously during office hours from 10:00 am to 6:00 pm, which is suitable for open office rooms. To enable this mode, close switches S1 and S2 and keep switch S3 open.

Mode 5: Office toggle mode: The repellent switches on and off hourly during office hours from 10:00 am to 6:00 pm, which is suitable for closed, air-conditioned office rooms. To enable this mode, close switch S3 and keep switches S1 and S2 open.

Mode 6: Hall mode: This mode is for use in halls during evening gatherings to keep the repellent switched on from 5:00 pm to 10:00 pm. To enable this mode, close switches S1 and S3 and keep switch S2 open.

Mode 7: All-day toggle mode: This mode operates the repellent continuously but non-sequentially, switching on and off every hour, which is ideal for office rooms operating 24/7. To enable this mode, keep switch S1 open and switches S2 and S3 closed.

The seven modes are controlled by push-to-on switches S1, S2, and S3, as shown in Fig. 1. These switches (S1 through S3) are simple on/off switches connected in series with the resistor between the 5V and the ground pin of the Arduino board.

Green boxes in Table 3 indicate the on-time of the liquid mosquito repellent. These switches are connected to the Arduino board pins as shown in Table 2. The positions of the switches and the corresponding modes of operation are shown in Table 3.

Table 2Arduino Uno pin connections with other components
Arduino Uno PinsComponents such as RTC module, switches, buzzer, etc.
5V pinDS1307 I2C RTC module VCC pin
5V pin2nd pins of S1, S2, S3
5V pinConnected to VCC pin of relay module
Pin D21st pin of S3
Pin D31st pin of S2
Pin D41st pin of S1
A4SDA pin of DS1307 I2C RTC module
A5SCL pin of DS1307 I2C RTC module
Pin D11Input signal pin of relay module
Pin D13Buzzer positive pin
GNDGND pin of relay module
GNDOne end of resistors R1, R2, R3
GNDGND pin of buzzer
GNDGND pin of DS1307 I2C RTC module
Table 3: Modes of operation
TIME IN HOURS678910111213141516171819202122230012345
MSB
LSB

























S3S2S1

























PIN 2PIN 3PIN 4MODE
























0001NIGHT MODE























0012NIGHT SMART TOGGLE























0103NIGHT SMART WITH BUZZER






















BUZZER AT 05:59:55 sec
0114OFFICE MODE























1005OFFICE TOGGLE























1016HALL MODE























1107ALL DAY TOGGLE MODE























Arduino Code for Liquid Mosquito Repellents Timer

The circuit operation is governed by the software program loaded into the internal memory of the Arduino Uno. The program, written in Arduino programming language, is uploaded using the Arduino IDE. The sketch initializes input and output pins and utilizes the wire library for communication with the DS1307 RTC module. Serial communication allows for monitoring of time and working mode.

The following functions and libraries are used.

Serial.begin(): Establishes serial communication between Arduino Uno board and another device, via a USB cable. It permits the two devices to communicate using a serial protocol. Here serial communication is used only to just read the data from Arduino Uno onto the screen. The displayed data allows us to know the time and working mode.

The following header files are used in the main code.

#include <Wire.h>: The Wire library allows to communicate through I2C devices, also called ‘2 wire’ or ‘TWI’ (two wire interface). The SDA (data line) and SCL (clock line) are used for communicating with the DS1307 RTC module.

#include “RTClib.h”: Used for communicating with the DS1307 RTC module. In the next step, initialize the relay pin as output.

Serial.begin(9600): Used for serial communication. For displaying the time on the serial screen, it is used for just reference purposes.

Two methods of setting the time into the RTC module

Method 1:

rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); This line sets the time according to your computer time. It will set the present clock time of your system into the DS1307 I2C RTC module.

Method 2:

rtc.adjust(DateTime(2021, 7, 21, 10, 0, 0)); This command will set the time into the RTC module in this format (year, month, date, hours, minutes, seconds.) (for example: 2021, July, 21, 10:00:00 am). Once the time is set, the backup battery in the RTC module keeps the time for a long time.

Construction and Testing

Upload the source code into the Arduino Uno board, ensuring proper timing settings as indicated in the source code. Assemble the circuit on a breadboard and connect the 12V DC power adaptor to the barrel jack on the Arduino. Select modes using switches S1 through S3. The relay will energize and de-energize based on the selected modes, controlling the liquid mosquito repellent accordingly.

For manual operation or bypassing the circuit, remove the 12V power supply from the Arduino Uno board and use switch S4. Close switch S4 for manual activation and open it for manual deactivation of the liquid mosquito repellent.


K. Murali Krishna is working as a JTO, BSNL, 4G saturation project in Vishakapatnam. He is a technical enthusiast, writer, and an embedded systems and circuit designer

murali krishna
murali krishna
JE BSNL, EFY ARTICLE WRITER CIRCUIT DESIGNER

SHARE YOUR THOUGHTS & COMMENTS

Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators