School of Technology, Assam Don Bosco University (tinyurl.com/eee-adbu)
Commissioning Numerical Protection and Procedure For Carrying Out Performance Tests
By EEE, ADBU
3 Applications Of Capacitor Banks Used To Correct The Load Power Factor
By EEE, ADBU
How bad harmonics influence the work of motors and generators, transformers, capacitors etc.
By EEE, ADBU
Fully Automatic Water Level Controller using SRF04
Full Automatic Water Level Controller using SRF04, L293D & PIC16F84A
Introduction to the Automatic Water Level Controller
Monitoring and controlling the level of water in water tanks is one of the most important work in almost many residential as well as commercial areas. In most cases, especially in residential buildings, due to unavailability of any automatic means, it becomes tiresome and inconvenient to frequently monitor the water level in the tanks. In fact, for places with water scarcity, overflow of water would be quite an expensive thing to pay for.
The only solution to the above problem is to have an automatic way to monitor and control the level of water. While there are many techniques like using distance sensors, using current probes, using ultrasonic ranger etc., here we are going to focus on using ultrasonic ranger.
System Overview of Water Level Controller
The system consists of an ultrasonic ranging sensor placed on top of the tank such that once triggered, it sends out an ultrasonic signal. Water present in the tank would reflect off the signal. The sensor would receive this signal and the time taken between these two signals give an estimate about the distance travelled by the signals, thus the water level from top.
Here a microcontroller is used to send trigger signal to the ultrasonic ranger. Once an echo is received, the time lag between the two pulses is calculated and this is directly proportional to the water level. The time lag is calculated with help of Timer, whose number of counting pulses denote the distance travelled by signal, or the water level.
Since here the ranger is placed on top of the tank, control of water flow is done considering the level of water from top of the tank. For example, if measured range is found to be between 0 to 1 cm, the tank is overflowing and the microcontroller sends a control signal to rotate the motor in reverse direction, to remove the excess water. ‘
If range is between 2 to 5 cm, the tank is full and the microcontroller sends a control signal to switch off the motor. If the range is above 5cm, the tank is almost empty and the microcontroller sends a control signal to rotate the motor in forward direction.
Circuit Diagram of Automatic Water Level Controller
Click image to enlarge
Figure 1: Water Level Controller
Parts Description
The following components would be used for designing the circuit.
- Ultrasonic Range Finder SRF04
- PIC Microcontroller PIC16F84A
- Motor Driver L293D
- DC Motor
- Two 1K Resistors
Let us have a brief idea about each component
Ultrasonic Range Finder SRF04:
The SRF04 is a high quality ultrasonic ranger which is used in many robotic applications for easy detection of obstacles. It requires 10 microseconds signal to be triggered.
Figure 2: SRF04 Ultrasonic Range Finder
Once triggered, it sends out 8 pulses of ultrasound, at a frequency of 40 KHz and simultaneously sends raises it echo line to HIGH. Once it receives the reflected signal or echo, it lowers the echo line to LOW.
Thus, width of the echo pulse denotes the distance travelled by the signal or in other words distance from the ranger to the object. The echo line is therefore a pulse whose width is proportional to the distance to the object. For 1cm, the echo pulse width would be 58 microseconds.
Figure 3: SRF04 Timing Diagram
- Also read: What is PID Controller & How it Works?
PIC Microcontroller PIC16F84A:
Figure 4: PIC Microcontroller PIC16F84A
It is a CMOS compatible, 8-bit, 18 pin Flash Microcontroller with a single 8-bit Timer (with 8-bit programmable prescaler). The Timer operation is controlled using the following registers – OPTION_REG, TMR0 and INTCON. The OPTION_REG is an 8-bit register whose 5th bit (T0CS) selects the required timer or counter operation.
Setting the bit selects counter operation whereas clearing it selects timer operation. TMR0 is the timer register, whereas INTCON is the interrupt register whose 5th bit (T0IE) denotes the timer flag, i.e. it sets when the Timer overflows.
Motor Driver L293D:
Figure 5: Motor Driver IC L293D
It is a 16 pin, H-bridge based DC motor driver IC. It has the capacity to drive two motors and in both directions. It consists of two enable pins (Pin1 and 9) which when set to HIGH, enable the IC operation. It basically acts as an interface between the microcontroller and the DC motor. It consists of four input pins – two for each H-bridge circuit. Given below is a table denoting the motor control.
IN1(Pin 2) | IN2 (Pin 7) | EN1 (Pin 1) | Motor Operation |
HIGH | HIGH | HIGH | OFF |
LOW | LOW | HIGH | OFF |
HIGH | LOW | HIGH | ON (Clockwise) |
LOW | HIGH | HIGH | ON (Anticlockwise) |
X | X | LOW | OFF |
Note: Since SRF04 is a TTL compatible device and PIC16F84A is a CMOS compatible, we are using a pull up resistor of 1K value, to compensate for the voltage level change.
- Also read: What is PID Controller & How it Works?
Working & Operation of Automatic Water Level Controller
The program is written such that a 10 microseconds pulse is sent from the microcontroller to trigger the ultrasonic ranger. This is written using a delay function. The timer register, TMR0 is loaded with decimal value 200, so that it makes 55 counts.
The output from SRF04, the echo signal is received at pin RA4 (The Timer clock pin, thus providing external clock pulse to the timer). Once the echo signal makes a transition from HIGH to LOW, the timer is activated. As the timer counts, the interrupt flag bit, T0IE, is monitored. Once set, the timer is deactivated.
The procedure is repeated for another echo pulse and so on. The number of times the timer operates is calculated and this denotes the number of echo pulses. Since each echo pulse is of 58 microseconds, it denotes 1 cm. Thus, 5 echo pulses would denote 5cm. The value of this count, stored in an integer, is used to control the DC motor.
If the value is between 2 to 5, the microcontroller sends HIGH signals to pins RB0 and RB1 (connected to IN1 and IN2 of L293D respectively), to switch OFF the motor. If value is between 5 to 20, the microcontroller sends a HIGH signal to IN1 and LOW signal to IN2, to switch ON the motor and rotate it in clockwise direction. If value is between 0 to 1, the microcontroller sends LOW signal to IN1 and HIGH signal to IN2, to switch ON the motor and rotate it in anti-clockwise direction.
Advantages of Automatic Water Level Controller using SRF04
- It would be a simple and convenient system.
- It would be a low-cost system due to use of low cost components.
- Using automatic technique would eliminate the hurdles faced in water level control using manual means.
- Since no mechanical parts are used, this would eliminate the risk of mechanical wearing or corrosion.
Disadvantages of Automatic Water Level Controller
- The ultrasonic range finder, SRF04, would be subjected to damping due to use of many electronics and thus should be properly insulated.
- This system is designed such that the sensor as well as the actuator needs to be placed in vicinity to each other. In layman’s words, this control system is for places where the water tank is near to the water pump. Thus, for many buildings where submersible pumps are used and water tanks are on the rooftops, this Automatic Water Level Controller system cannot be used. However, this can be modified by using communication circuit.
Also read:
- How to Program PIC18 Microcontroller in C.
- Traffic Light Control Electronic Project using IC 4017 & 555 Timer
- Clap Switch Circuit Electronic Project Using 555 Timer
The post Fully Automatic Water Level Controller using SRF04 appeared first on Electrical Technology.
October 05, 2017 at 10:01AM
7 design diagrams that HV substation engineer MUST understand
By EEE, ADBU
The Basics of Hardware and Software for SCADA Systems You Should Know About
By EEE, ADBU
Simple Calculation of Flood Light, Facade Light, Street Light & Signage Light-(Part1)
Introduction:
- Outdoor Lighting can be classified according to the location where it can be installed or its function which use for highlight landscape area.
- Outdoor Lighting can be classified as
- Flood Lighting,
- Facade Lighting and
- Signage Lighting
- Street Light
(A) General Outdoor Flood Lighting:
- Normally Pole mounted floodlights are used to illuminate general lighting area of parking lots and storage yards.
- There are three factor should be consider while designing of outdoor flood lighting.
- Mounting Height.
- Spacing
- Aiming Distance.
- Horizontal Aiming.
1) Mounting Height:
- Mounting height should be one half the distance across the area to be lighted.
- If the area to be lighted is 16 Meter, the lowest recommended mounting height is 8 Meter.
- Mounting height = 1/2 distance to be lighted
- 1/2 (16 Meter.) = 8 Meter.
2) Spacing:
- When more than one Luminar / pole is required than distance between two adjacent luminar / Pole is 4 times Mounting height of luminar /pole.
- If the mounting height of luminar /Pole is 8 Meter than distance between adjacent Luminar is 32 Meter.
- Pole Spacing = 4 x mounting height.
- 4 (8 Meter pole) = 32 Meter between poles
3) Vertical Aiming:
- The fixture should be aimed 2/3 of the distance across the area to be lighted and at least 30 degrees below horizontal.
- If the area to be lighted is 16 Meter across, the recommended aiming point is 10.6 Meter.
- Aiming point = 2/3 Distance to be lighted.
- 2/3 (16 Meter) = 10.6 Meter aiming point
- To minimize glare, the recommended aiming point distance should never exceed twice the mounting height.
- If a pole is 8 Meter high, the vertical aiming point should not exceed 16 Meter.
- 2 (8 Meter mounting height) = 16 Meter.
4) Horizontal Aiming:
- When two floodlights is mounted to a single pole then horizontal aiming also must be considered.
- Each floodlight should be vertically aimed according to the two-thirds rule.
- The floodlights should be aimed up to 90 degrees apart.
October 01, 2017 at 07:29PM
4 basic designs of an offshore wind farm collector system and important parameters
By EEE, ADBU