Summary of Arduino Home Irrigation System With a 7 Segment Display
Summary: This project builds a standalone Arduino/ATmega328-based home irrigation system that measures soil moisture with hygrometer sensors and controls pumps via relays. It uses a TM1637 display for feedback and can be assembled on perfboard or breadboard. The author recommends using a ULN2803A or MOSFETs for driving relays, provides wiring guidance for standalone ATmega and Arduino Uno setups, and emphasizes safety when wiring pumps and power supplies.
Parts used in the Home Irrigation System:
- Arduino Uno or ATmega328 chip with programmer
- 10 kOhm resistor
- 20 kOhm resistor (or other resistor to put in series)
- ULN2803A (or MOSFETs and diodes)
- TM1637 display
- Hygrometer sensors (2)
- Pumps (2)
- Momentary push button
- Relay board
- 2 pole terminal
- Sockets (optional)
- 16 MHz crystal (if using standalone ATmega)
- 22 pF capacitors (2)
- 10 µF capacitor
- 1N4001 diode
- Jumper cables
- Hook up wire
- Tubing
- Breadboard or perfboard
- Power supplies for logic (5V) and for pumps
- Soldering iron, pliers, cable stripper, digital multimeter
In this instructable we are building a home irrigation system based on an arduino uno. I know there are tons of similiar projects / tutorials already floating the web, but maybe I did something different and you can pick up an idea or two.
Step 1: Gathering the Tools
You will need:
1 x Arduino Uno (or an atmega328 chip and a programmer)
1 x 10kOhm resistor
1 x 20kOhm resistor (or any other number resistor that you can put in series)
1 x ULN2803a (or MOSFETS + diodes)
1 x TM1637 Display
2 x Hygrometer sensors
2 x pumps (something like these)
1 x momentary push button
1 x relay board
1 x 2 pole terminal
sockets (optional, but highly recommended to be able to easily reprogram the atmega chip if needed)
depending whether you use an arduino or an atmega:
1 x 16 Mhz crystal
2 x 22pF capacitors
1 x 10 µF capacitor
1 x 1N4001 diode
jumper cables
hook up wire
tube
breadboard or perfboard
power supplies (5V or more, and one power supply for your pumps)
You will need basic equipment like:
Soldering Iron
Pliers
Cable stripper
Digital Multimeter
Step 2: The Schematics
You can see the wiring and schematics both for the atmega328 standalone version and the wiring for using an arduino uno. Since the project is supposed to run on its own after it’s finished I don’t need any of the arduino functionalities and just use the bare chip. You can either use the chip from the arduino or refer to this video to see how you can use your arduino as programmer for another chip.
As you can see I have a GND and 5V rail on either site of my perfboard, all the GND and 5V connections in the schematic refer to these, therefore the filter cap is only drawn once.
Have a look here to see the pin mapping of the atmega chip compared to the arduino.
If you are going to solder everything on a PCB, make sure to use your digital multimeter to check all connections and to make sure all power rails are powered with 5V. If you are going to use a power supply with more than 5V, add appropriate voltage regulators (7805 e.g.). I again would recommend soldering a socket to the board instead of the chip directly, so you can easily take it out again for reprogramming as you are doing the fine tuning for your setup.
Other than that, you should be able to recreate the wiring from the schematics.
I used a ULN2803A module because the output pins of the atmega (and therefore probably from the arduino, too) do not supply enough current to switch the relay. My relay requires around 60mA, but the pins of the atmega are not to exceed around 40mA. Also I read that you shouldn’t switch inductive loads like relays directly anyway. The module protects the chip from any damage. I was advised that this module creates a voltage drop, so if your relay can’t be powered with less than 5V, use MOSFETs and flyback diodes accordingly.
Step 3: Wiring the Relay and Pumps
WARNING: I do not know which pumps or power supplies you are using. When wiring up the relay, make sure to disconnect everything from power before you start cutting / connecting any cables. You may be working with mains voltage. Mistakes can lead to serious injury or death. If not done correctly, you may also start a fire. I do not take responsibility for any damages done to you, others or your property. I’m not an electrician, so maybe the way I did is not correct either. If you do not know what you are doing and feel uncomfortable, leave to project be or consult someone who knows. Proceed at your own risk.
My relay board consists of 3 terminals for each input: NO, NC and COM. I just got into the habbit of switching both neutral and phase for each pump although with the specific power supply I used I know for sure which cable is which. This is not always the case as you may not have polarity protection.
I cut the cables from the power supply and connected them to the COM ports. I then connected the normaly open terminals to my pumps. When the relay turns on, the normally open connection closes and the pump starts. To be able to use 1 power supply for multiple pumps I connected the normally closed port to the COM port of the next set of terminals.
When pump 1 is turned on, terminal 1 and 2 both switch on, neutral and phase are both connected via the NO and COM terminal, the normally closed terminal is now open.
When pump 2 is turned it, the normally closed terminal is closed, so we can draw power from there. I don’t turn on both pumps at the same time but sequentially so this is not a problem.
You can find a more detailed explanation of how the modules work here.
Source: Arduino Home Irrigation System With a 7 Segment Display
- Can I use a bare ATmega328 instead of an Arduino Uno?
Yes, the project includes wiring for a standalone ATmega328 and the author prefers using the bare chip for a standalone system. - Why use a ULN2803A module in this project?
The ULN2803A protects the ATmega outputs because the microcontroller pins cannot safely supply the current required by the relay and to avoid switching inductive loads directly. - Can I replace the ULN2803A with MOSFETs?
Yes, the author notes you can use MOSFETs and flyback diodes if the ULN2803A creates too much voltage drop for your relay. - Do I need a voltage regulator if my power supply is above 5V?
Yes, the article recommends adding an appropriate voltage regulator such as a 7805 if using a supply higher than 5V. - How are the pumps wired to the relay board?
The power supply cables are cut and connected to COM ports, pumps are connected to the normally open terminals so they run when the relay closes; the author chains supplies via NC to COM for sequential use. - Should I solder the ATmega chip directly to the board?
No, the author recommends soldering a socket so the chip can be removed for reprogramming and fine tuning. - Is there a schematic for both Arduino and standalone ATmega setups?
Yes, the article provides schematics for both the ATmega328 standalone version and wiring for using an Arduino Uno. - What display is used for feedback in the project?
A TM1637 7-segment display is used in the project. - Does the author recommend turning on multiple pumps at the same time?
No, the author states they do not turn on both pumps at the same time but sequentially to avoid issues. - What safety precautions are mentioned for wiring pumps?
The author warns to disconnect power before cutting or connecting cables, notes risk of mains voltage, and advises consulting a qualified person if unsure.