Embedded Project for Renesas S5D9 board: A Plant's Automatic Light and Water Monitor System

Project Goals

  • Create a sophisticated embedded system that can monitor a plant's environment such as soil moisture, lighting level, temperature and humidity.

  • Display the sensor readings on a mini OLED display for users to review.

  • Intelligently enable the lamp when the room is too dark for the plant.

  • Intelligently enable the water pump when the soil is too dry.

  • Safely disable the water pump from overheating when the water level in the tank is low.

  • Allow the users to turn on or off the lamp and water pump with two enable buttons.

Hardware Setup

Diagram A: Overall System Review with components.

Diagram B: Original picture of the overall system without the component labels.

Diagram C: OLED Display shows all the sensors' data in real time as well as the on/off status of the water pump and lamp.

Diagram D: PC's serial terminal display (11520 baud, 8 data bit, 1 stop bit, no parity) also shows the same information. Because it contains the history of old data, it helps us easily see how the increase in moisture level eventually shuts off the water pump.

Peripheral Connection

Diagram E: External headers (Grove A, Grove B, PMOD)

1. Grove A is used for UART only.

P4_10/RXD (S5D9) to TXD (UART to USB cable)

P4_11/TXD (S5D9) to RXD (UART to USB cable)

2 Grove B is used by Temperature and Humidity Sensors (SHT31), OLED Display, ADC Converter Module.

P1_0/SCL (S5D9) to SCL (all I2C peripheral devices)

P1_1/SDA (S5D9) to SDA (all I2C peripheral devices)

3. PMOD is used by Distance Ultrasonic Sensor (HC-SR4), AC Relay Switches, and two push buttons.

pin 1 P2_5 (S5D9 GPIO Input Mode/IRQ1) to Echo Output pin (HC-SR4)

pin 2 P2_3 (S5D9 GPIO Output Mode) to Trigger Input pin (HC-SR4)

pin 3 P2_2 (S5D9 GPIO Output Mode) to Relay IN1 (Water Pump)

pin 4 P2_4 (S5D9 GPIO Output Mode) to Relay IN2 (Lamp)

pin 5 GND to GND (all peripheral devices)

pin 6 VCC (5V set by J6 jumper) to VCC (only HC-SR4)

pin 7 P7_8 (S5D9 GPIO Input Mode/IRQ11/Pullup) to Button 1 for Water Pump

pin 8 P2_6 (S5D9 GPIO Input Mode/IRQ0/Pullup) to Button 2 for Lamp)

pin 9 Unused

pin 10 Unused

pin 11GND

pin 12 VCC (5V)

Video Demonstration

Video 1 with the following demonstration:

1. Push the light button to turn on the lamp if it is off or turn off the lamp if it is on.

2. Push the water pump button to turn on the water pump if it is off or turn on the water pump if it is on.

3. Cover the light sensor with my hand to emulate the dim light condition. The sensor reading shows high value. The lamp immediately turns on. When I remove my hand, the sensor reading returns to low value, the lamp turns off.

4. Take out the soil sensor from the soil to emulate the dry condition. The water pump is enabled to bring the water into the plant's soil. When the soil sensor is placed back into the soil, the soil sensor reading shows that the soil is quite wet. The water pump is disabled promptly.

5. Take out the soil sensor from the soil to emulate the dry condition. The water pump is enabled to bring the water into the plant's soil. This time the distance sensor over the water tank is lifted to emulate that the tank is empty. The safety measure is taken promptly to shut down the water pump to prevent overheating.





  • Grey Facebook Icon
  • Grey Twitter Icon
  • Grey Instagram Icon
  • Grey Google+ Icon
  • Grey Pinterest Icon


My name is Mike.   This blog is made especially for you to enter my technology universe.  You will find new ideas and skills that may be helpful to you.   Feel free to leave your comments.   I am excited to hear from you.  Thank you. 



 Please subscribe.   So, you will get notification of the latest exciting posts. 

© 2023 by FEEDs & GRIDs. Proudly created with Wix.com

This site was designed with the
website builder. Create your website today.
Start Now