Do you often forget to irrigate your plants? Do you have to ask your neighbors to take care of them when your whole families are out for a vacation? Don’t worry any more! Here is a solution. This embedded system, worry-free automatic timed plant feeder, can do all the services for you. It can: regularly feed water to your plants for a specified amount of water; and also be used as an alarm clock.
You can set your desired feed pattern, and change all options at any time. It is easy, low-cost, and safe. It makes your worry free while you still enjoy your plants.
The following diagram shows the system schematic.
It contains the several major blocks:
Some key blocks will be explained in detail later on.
The AVR processor used in this project is an ATmega323. It has two 8-bit Timer/Counters and one 16-bit Timer/Counter. Meanwhile, it supports the real-time counter. These features satisfy the system's demands. More detailed information can be founded in data sheets at Atmel. The following picture shows the pin configurations of the ATmega323.
The programming control circuit is shown in AVR basic system schematic. With this circuit, the code can be easily read and written by software PonyProg.
The regulator circuit uses an LM7805. A heat sink helps it cool down. This block of circuits is also shown in AVR basic system schematic.
The system has lots of functions heavily depending on a real-time clock. Thus, a 32768 Hz crystal works here. With a prescale of 128 and Timer2's overflow interrupt service, the crystal finally offers a 32768/128/(2^8) = 1 Hz frequency. Circuits for both the RTC crystal and the 8MHz crystal are shown in AVR basic system schematic.
A 2*24 HD44780 LCD is used as a display.
A 0.2W speaker makes sound.
The following diagram shows how push buttons work. When the button is pressed, the output signal is connected to GND. When it is released, the output is connected to VCC. Thus, it simulates push buttons in AVR STK500 kit. Push buttons are nominally open.
A R40-11D2-5 relay plays an important role in this project, since it is the relay that changes a control signal from the AVR into turning on or off the water pump. Its contact arrangement is shown as following.
In the system schematic as shown previously, there is an additional circuit for the relay to protect the AVR’s pins from being damaged. As we know, U=LdI/dt. There could be as large as 100 volts introduced from coils in the relay when the current flow in the coils are suddenly stopped or allowed. This high voltage can easily break through the AVR ports. In order to protect the AVR, the following circuit is used to limit the voltage applied on the AVR pins.
With this circuit, about 5 volts will be applied if the input control signal at B is high, which is large enough to trigger the relay.
The water pump (CAL P60) is in serial with a fuse for safety.
The speak makes sound of a certain tone when it is fed with a rectangular wave of a certain frequency in the project.
The system provides a variety of UI functions. It has a pump, a LCD, a speaker and five push buttons.
The pump irrigates plants, which is our goal. Constrained by the water pump, the system uses a semi-volume control method by pumping for a specified amount of time. Water flow can be manually off-line adjusted by rotating a plastic valve in the pump. So please do some check and make sure that the pump supplies a desired amount of water in the specified time duration, before you leave the system to work.
The speaker will make sound when alarming or pumping. It actually gives a segment of music at the following frequencies in circular order:
Page 4, 5, and 6 together specify the pattern of pumping water.
A user can click five push buttons to communicate with the system. Timer0 is used to filter out electrical and mechanical noises. One of five buttons is used to reset the system. The other four, from left to right, are:
Because of safety, conventions, and other issues, the system will stop alarming and/or stop pumping when any one of the buttons is clicked.
The project is written in C, and compiled by AVRGCC. Meanwhile, it is heavily based on AVRlib function libraries, courtesy of the instructor Prof. Pascal Stang. About 45 % of code deals with real-time clock and time-related stuffs. It considers practical issues, such as 29 days, instead of 28 days, in February every four years. It need calculate and update the next pump time when necessary, since the next pump time is always larger than the current RTC time. About another 45 percent of code deals with the LCD.
Please click the following files to view the source code:
You may have to register before you can post comments and get full access to forum.