credit: pixabay
Today, I will talk about how one can build a very small and cost effective electronic device that will detect the frequency of thunderstorms from a far away distance in the sky and automatically disconnects gadgets connected to source of electric power throughout the period of time during which the thunderstorm strikes, and after which the device automatically reconnects immediately the thunderstorm is over.
I shall also attach the PIC microcontroller code, circuit diagrams and the printed circuit board design should in case anybody here feels like building the device.
Cool right?.Okay, let's go...
LIGHTNING
Lightning strikes are one of those natural occurrence that wreak disastrous havoc on any powered electronic gadgets within the region of the strike, if the device is not being properly protected. The strike carries an average current of 30KA and a huge amount of energy (in different forms such as light and sound) is released alongside the strike.
Furthermore, the strike also emits large amount of Very Low Frequency (VLF) and Low Frequency (LF) electromagnetic radiations. These radiation are of the range 3KHz to 300KHz.
This project detects lightning at the stated frequency as they happen (a few microseconds after). It makes use of an antenna that picks fluctuations in electromagnetic spectrum specifically around 7-9 KHz. These fluctuations will induce a small voltage in the antenna, the voltage which is amplified by passing it through a high gain amplifying circuit consisting of two LM324 operational amplifiers in cascade.
SYSTEMS DESIGN
This section discusses in details, the design considerations and specifications, parts explanation of the circuit and the circuit parts operation of the microcontroller based thunderstorm lightning protection surge .
The three sections into which the entire circuit is subdivided are the power supply unit, lightning detection unit and the controller unit.
POWER SUPPLY UNIT.
Components and Quantities:
- 12V step down Transformer (1)
- 1N4007 diode (4)
- 2200uF capacitor (1)
- LM7805 voltage regulator (1)
- 12 Battery 1A (1)
proteus simulation: designed by me
As the name implies, this is the unit from which the maximum of 5V dc voltage needed in the circuit is being supplied. This design employs an uninterrupted power supply (UPS) design which ensures that the lightning protector is always powered. The UPS design employed ensures that required 5V is always available.
As shown above, a transformer is used to step the 240V/220V a.c supply voltage down to suit the requirement of the solid-state electronic devices and also provides isolation from the supply line.
A full wave bridge rectifier (consisting of four 1N4007 diodes) performs the transformation of the a.c. voltage into a pulsating d.c. voltage in a process known as rectification.
The battery is needed to operate the device should in case there's power outage (especially in developing countries with no stable power supply).
The 2200uF Capacitor filters out (remove) fluctuations or pulsations (called ripples) present in the rectifier output voltage.
A fixed voltage regulator (7805) is mounted on the internal circuit board to provide a stable + 5V d.c. output from the unregulated 12V d.c. fed into its input terminal. This then powers the PIC16F877A controller which can only operate on a maximum voltage of 5V.
LIGHTNING DETECTION UNIT
Components and their Quantities
- LM324 operational amplifier (2)
- Flexible wire (antenna)- few metres long
- 2.2Mega Ohms resistor (2)
- 100K resistor (2)
- 1K resistor (1)
- 10nF capacitor (2)
- LED (1)
- 8 pins IC sockets (2)
proteus simulation: designed by me
As explained in the previous section, this unit consists majorly of LM324 operational high pass amplifier arranged in cascade. This simply arrangement of LM324 ICs allows the user to imagine distant thunder lightning by means of an antenna precisely in keeping with the lightning which may be happening anywhere in the distant sky.
Once the circuit has been set up as shown above, the user can test whether it's working or not. This is done by using a gas lighter which has certain pertinence to the thunderstorm lightning. The radio frequency signal from the antenna will be captured and the immediate flashing of the indicator LED (on the pin 7 of the second LM324 IC) indicates that the detector circuit has truly captured lightning.
MICROCONTROLLER UNIT
Components needed and Quantities:
- 1 Programmable Interface Controller (PIC)877A
- 22pF capacitor (2)
- 4MHz Crystal Oscillator
- Push button (1)
- 10k resistor (1)
- 5V DC motor (1)
- 1k resistor (1)
- BC547 Transistor (1)
- 1N4007 Diode (1)
proteus simulation: designed by me
The microcontroller section of the project consists of the PIC16F877A operated on 4MHz clock frequency. The output from the Lightning detection unit was fed as an input into PORTB4 of the controller using PORTB interrupt change and configured in a way that the indicator of the lightning detection unit was monitored closely.
By default, the PORTB.b4 was set to a low- indicating no lightning has been detected. And if peradventure lightning is sensed, an interrupt occurs. The pin (PORTB.b4) then goes high.
In short, we would be looking for when the pin is triggered high and when such happens, I tell the microcontroller to trip off the connected gadgets within the next 3 seconds (period during which thunderstorm accompanies lightning). The gadget will continue to be in this state until the thunderstorm is over and the device will continue to function once again.
Here, the connected gadgets were prototyped by a DC motor and a red color Light Emitting Diode (LED).
Complete Circuit Diagram
proteus simulation: designed by me
Controllers Stage Printed Circuit Board
PCB design: designed by me
Software (MikroC) Code used
MikroC code: written by me
Construction and Testing stages
working stage
Software Used:
Proteus Professional 8: Used for simulation and for circuits drawings
MikcroC IDE: Used for writing microcontroller C - Language code
Express PCB : Used for Printed Circuit Board designing.
Remember this is a small project, it can be modified for more complex applications!
Thanks for taking your time to read!!!.
References