Basic Usage 1

Blinking LED on board

This is the basic experiment for learning the plant watering kit, it will help you to know about the pinout of electronics components onboard and help you understand how to use those components individual.

OK, let’s begin the basic learning.

In this experiment, we are going to blink the two LEDs on the plant watering hat board.

Hardware Overview

The shield provides the following interfaces:

  • 3 x Soil Moisture Sensors (Analog Inputs A0, A1, A2)
  • 3 x NTC Temperature Sensors (Analog Inputs A4, A5, A6)
  • 3 x 3.3V Relay Modules (Digital Outputs 2, 3, 4)
  • 3 x Mini Water Pumps
  • 1.3-inch IPS RGB TFT Screen (ST7789 Controller)

Pinout Chart

  • Details of the expansion board.
Plant Watering Kit Hat Board Arduino UNO R4 WiFi Board
HUMI3 A0
HUMI2 A1
HUMI1 A2
TEMP3 A3
TEMP2 A4
TEMP1 A5
IR_RSV D5
Relay 1 D2
Relay 2 D3
Relay 3 D4
TFT_SCLK D13
TFT_MOSI D11
TFT_CS D10
TFT_DC D9
TFT_RST D8
RX TX->1
TX RX<-0
Green LED D6
Red LED D7

Circuit Diagram

circuit Diagram

LEDs on board Position Detail

ledpinout

Connecting the Shield

  • place the arduino uno r4 on a flat surface.
  • align the shield with the headers of the arduino board and gently press it down until it clicks into place.
  • plug the plant watering hat board on top of arduino uno r4 on gpio pins.

Programming

Open arduino IDE and create a new sketch by clicking file-> New Sketch

new sketch

Define LED Pin number

#define Green_LED 6
#define Red_LED 7

Initializing Pin Mode

Set the pin direction to OUTPUT in setup function sector.

void setup() {
    pinMode(Green_LED, OUTPUT);
    pinMode(Red_LED, OUTPUT);
}

Modify loop section

void loop() {
  digitalWrite(Green_LED, HIGH);
  digitalWrite(Red_LED, HIGH);
  delay(500);
  digitalWrite(Green_LED, LOW);
  digitalWrite(Red, LOW);
  delay(500);
}

It will light up Red LED after Green_LED and wait for 500 milliseconds and then turn off the LEDs.

Upload the sketch to Arduino UNO R4 WiFi board.

  • Connect the Arduino UNO R4 WiFi board to your computer via USB-C cable on USB port

  • Select the serial device on your arduino IDE and click upload icon as following figure:

upload sketch

You may try to modify the code in loop section to change the behavior of the LED indicators.

Demo Code Sketch Download

Finally

  • If you can see the LED lights are blinking means that you have finished this task. Let us remove to next chapter.