As an Amazon Associate we earn from qualifying purchases.
A greenhouse works well only when the air, soil and light stay within a range the plants can tolerate. Checking this by hand is tiring and easy to forget. A small microcontroller project can do it for you: read a few sensors, compare the readings with limits you set, and switch a fan, heater, pump or light on and off.
This article explains how a greenhouse monitoring and control system is built around an Arduino and how you can test the whole design in Proteus before buying any hardware. The video below shows the simulation in action.
What the system does
The idea is a simple feedback loop. The Arduino reads the conditions inside the greenhouse, shows them to the user, and drives outputs to correct anything that drifts out of range.
- Monitor: measure temperature, humidity, soil moisture and light level.
- Display: show the readings on a character LCD.
- Control: turn a cooling fan, heater, water pump or grow light on or off through relays or transistor drivers.
Your parts list may differ from the one in the video, so treat the list below as a typical starting point rather than a fixed recipe.
Typical components
- Arduino Uno (ATmega328P) as the controller.
- Temperature sensor such as an LM35 or a DHT-type sensor. Check which one your Proteus library supports.
- Soil moisture input, which in simulation is often a potentiometer standing in for an analog sensor.
- LDR (light dependent resistor) with a fixed resistor, wired as a voltage divider, to estimate light level.
- 16×2 LCD to display values.
- Relays or transistors with flyback diodes to switch the loads.
- Loads: a DC fan or motor, a lamp or heater symbol, and a pump motor.
- Virtual terminal (optional) for sending readings over serial while debugging.
How the circuit is wired
Sensors
Analog sensors go to the Arduino analog input pins (A0, A1 and so on). The Arduino converts each voltage to a number between 0 and 1023, and your code turns that number into a temperature, a moisture percentage or a light level. Digital sensors use a single digital pin instead.
LCD
The LCD is normally connected in 4-bit mode, using RS, E and four data lines, plus a contrast potentiometer. If you have not done this before, the Arduino and LCD simulation walkthrough covers the wiring and test code step by step.
Output drivers
Never drive a motor or relay coil directly from an Arduino pin. Use a transistor or a relay driver stage, and add a diode across the coil to absorb voltage spikes. In Proteus, the simulation will still run without these, but the circuit would not be safe on real hardware. If you want the fan to run in both directions, see this guide on H-bridge DC motor direction control. For vents or windows that open to a set angle, servo motor interfacing is a useful addition.
Control logic
The program runs in a loop: read, compare, act, display. A basic rule set looks like this:
- If the temperature is above the upper limit, switch the fan on.
- If the temperature is below the lower limit, switch the heater on.
- If soil moisture is below the set level, run the pump until it recovers.
- If the light level is low, switch the grow light on.
- Print the current values and the state of each output on the LCD.
Use two thresholds for each control (for example, fan on at one value and off at a slightly lower one). This gap, called hysteresis, stops the relay from clicking rapidly on and off when a reading hovers near the limit.
The right limits depend on the crop you grow, so look up the recommended range for your plants rather than copying numbers from a demo.
Running the simulation in Proteus
- Draw the circuit in Proteus ISIS and place the Arduino, sensors, LCD and drivers.
- Write the sketch in the Arduino IDE and compile it.
- Copy the path of the generated .hex file (enable verbose output during compilation to see where it is saved).
- Double-click the Arduino in Proteus and load the .hex file in the program file field.
- Press play, then change the sensor values (adjust the potentiometer or the sensor properties) and watch the LCD and outputs react.
Test each limit on its own. Raise the temperature value past the upper threshold and confirm the fan turns on, then lower it and confirm it turns off at the lower threshold.
Common problems
- Blank LCD: check the contrast pin, the enable line and the pin numbers in the LiquidCrystal setup.
- Sensor values look wrong: confirm the sensor model in Proteus matches your formula and that the reference voltage is 5 V.
- Nothing happens on start: the .hex file may not be loaded, or the clock frequency in the component properties may be wrong.
- Output stuck on: check the driver wiring and whether your relay module is active-high or active-low.
Taking it to real hardware
A simulation proves the logic, not the electrical details. When you build it for real, use sensors rated for humid conditions, protect the electronics from moisture, keep mains-powered loads isolated behind properly rated relays, and calibrate each sensor against a reference. The same read-compare-act approach is used in larger setups such as a building automation system that uses temperature and gas sensors.
Possible upgrades
- Add a real-time clock to water or light on a schedule.
- Send readings to a phone using a GSM or Wi-Fi module.
- Log data to an SD card to study trends over days.
- Add manual override buttons for each load.
FAQ
Do I need real hardware to follow this project?
No. Proteus lets you build and test the circuit and the Arduino code on your computer. Real hardware is only needed when you want to run it in an actual greenhouse.
Which sensors work best in Proteus?
An LM35 and potentiometers are the easiest, because they are included by default and behave as simple analog voltages. Other sensors may need extra library files.
Why does my fan or relay keep switching on and off?
The reading is probably hovering around a single threshold. Use separate on and off limits, or add a short delay between changes.
Can I use the same design for a different board?
The logic carries over to other microcontrollers, but pin names, ADC resolution and libraries will change, so you would need to adjust the code and the Proteus model.