4. Assemble the Smart Farm Kit

Step 1 Install the ESP32 Board and the Relay Module

1.1 Required components

img

1.2

img

1.3

img

1.4

img

1.5

img

Step 2 Install the Fixing Frame for Battery Case and install the Feeding Cabin, connect the ESP32 board and the Relay Module

2.1 Required components

img

2.2

Assemble the wooden board X and O on bottom plate

img

2.3

img

2.4

img

2.5

img

2.6

img

2.7

img

2.8 Connect the ESP32 board and the Relay Module

Module

Wire

Pin

Relay Module

3PIN 20cm

IO25

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io25

img

2.9

img

Step 3 Install the Substructure of the house

3.1 Required components

img

3.2

img

3.3

img

3.4

img

3.5

img

3.6

img

3.7

img

3.8

img

3.9

img

3.10

img

3.11

img

Step 4 Install the Door of the Feeding Cabin

4.1 Required components

img

4.2 Set Servo to 180°

image-20250416162128859

The acrylic sheet is packed separately, and it is recommended that you tear off its protective film to reduce the friction when it moves as a door.

4.3 Install Servo

img

4.4

Note: The screws need to be tightened to keep the servo stable, otherwise the door may get stuck

img

4.5

image-20250416162337896

Install M1.4*6MM self-tapping screws as shown below

img

4.6

image-20250416162754513

4.7

img

4.8

Do not turn the gear after it is installed on the servo. If you have already turned the gear you will need to readjust the servo angle to 180°.

img

4.9

NOTE: When installing the lid of the feeding box, its opening should be fully closed.

img

4.10

img

4.11

img

4.12

img

4.13 Test the door

  1. Connect Servo to pin IO26 of the ESP32 board. Connect yellow to S, red to V, black to G.

image028-1

  1. Connect 6 AA batteries to the DC 7-12V port of ESP32 board. (Batteries not included in the kit)

image-20250417084747308

  1. Upload the Test code

A. Connect the ESP32 board to the computer with the usb cable. Open the INO file inside the 6.1Servo folder with Arduino IDE.

image-20250418081022882

image-20250418081231084

B. Click on Tools, select “ESP32 Dev Module” for the board type in the drop-down menu bar, and select COM-XX for Port (According to the port assigned by your computer in the device manager)

C. Please make sure you have uploaded the ESP32Servo library and then upload the code. The door of the feeding cabin will open and close slowly.

image-20250417085407205

NOTE: After uploading the code, ifthe door cannot be opened and closed and the servo is hot, please turn offthe powerimmediately.

check:

  1. Whether the plastic door has good contact and force points with the gear structure of the servo.

  2. Whether the tip of the fixing screw on the gear structure of the servo is stuck with the plastic shell of the servo. If so, please loosen the fixing screw a little to prevent its tip from contacting the servo.

image-20250417085630662

Step 5 Install the LCD display and the DHT11 Sensor

5.1 Required components

img

5.2

img

5.3

img

5.4

img

5.5 Prototype

img

5.6 Wiring

Connect modules via Dupont wires.

Module

Wire

Temperature and Humidity Sensor

3PIN 20cm

Pay attention to the color of the Dupont wire:

For temperature and humidity sensor, connect yellow to S, red to V, black to G.

img

5.7

Module

Wire

LCD 1602

4PIN (Black-Red-Blue-Green)

For the LCD display, connect green to SCL, blue to SDA, red to VCC, black to GND.

img

Step 6 Install the Ultrasonic Module

6.1 Required components

img

6.2

img

6.3

img

6.4 Wiring

Module

Wire

Ultrasonic module

4PIN (Black-Green-Blue-Red)

Pay attention to the color of the Dupont wire: For the ultrasonic module, connect blue to TRIG,green to ECHO, red to VCC, black to GND.

img

Step 7 Install the PIR Motion Sensor and Button Module

7.1 Required components

img

7.2

img

7.3

img

7.4 Wiring

Connect modules via Dupont wires.

Module

Wire

PIR Motion Sensor

3PIN 15cm

Button Module

3PIN 15cm

Pay attention to the color of the Dupont wire: Connect yellow to S, red to V, black to G.

img

Step 8 Install the Walls of the House

8.1 Required components

img

8.2

img

8.3

img

8.4

img

8.5

img

8.6

img

8.7

img

8.8 Prototype

img

8.9 Wiring

Module

Wire

Fan

4PIN Divided (Black-Red-Blue-Green)

Steam Sensor

3PIN 15cm

Photoresistor

3PIN 15cm

Pay attention to the color of the Dupont wire for the Fan:

Module Pin

Wire Color

ESP32 Board Pins

IN-

GREEN

io18

IN+

BLUE

io19

V

RED

V

G

BLACK

G

For Steam Sensor and Photoresistor: Connect yellow to S, red to V, black to G.

img

Step 9 Install the Roof of the house

9.1 Required components

img

9.2

img

9.3

img

9.4 Keep the wires organized

img

Step 10 Install the House and Ground

10.1 Required components

img

10.2

img

10.3

img

10.4 Bottom View

img

10.5

img

10.6 Arrange the wires

img

10.7

img

Step 11 Wiring the House

11.1

Pay attention to the color of the Dupont wire: Connect yellow to S, red to V, black to G.

NO.

Components

Wires

ESP32 Board Pins

1

Fan

4pin, Divided Bla ck-Red-Blue-Green

io18(IN-) \ io19(IN+)

2

PIR Motion Sensor

3pin 15cm

io23

3

Button

3pin 15cm

io5

4

Ultrasonic Module

4pin,Divided Bla ck-Green-Blue-Red

D12(TRIG) D13(ECHO)

5

LCD 1602

4pin, Connected

I2C

6

Temperature and Humidity Sensor

3pin 20cm

io17

7

Steam Sensor

3pin 15cm

io35

8

Photoresistor

3pin 15cm

io34

9

Servo

io26

10

Buzzer

3pin 20cm

io16

11

LED

3pin 20cm

io27

12

Water Level Sensor

3pin 25cm

io33

13

Soil Humidity Sensor

3pin 20cm

io32

14

Water Pump

3pin 20cm

io25

11.2 Fan

Pass the Dupont wire connected to the fan through the hole marked 30 on the wooden board.

Components

Wire

ESP32 Board Pins

Fan

4PIN Divided (Black-Red-Blue-Green)

io18(IN-), io19(IN+)

Module Pin

Wire Color

ESP32 Board Pins

IN-

GREEN

io18

IN+

BLUE

io19

V

RED

V

G

BLACK

G

img

11.3 PIR Motion Sensor

Pass the Dupont wire connected to the PIR motion sensor through the hole marked 24 on the wooden board.

Component

Wire

ESP32 Board Pin

PIR Motion Sensor

3PIN 15cm

io23

Connect red to V, black to G, yellow to S.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io23

img

11.4 Button Module

Pass the Dupont wire connected to the button module through the hole marked 25 on the wooden board.

Component

Wire

ESP32 Board Pin

Button

3PIN 15cm

io5

Connect red to V, black to G, yellow to S.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io5

img

11.5 Ultrasonic Module

Component

Wire

ESP32 Board Pins

Ultrasonic Module

4PIN Divided ( Black-Green-Blue-Red)

io13(ECHO), io12(TRIG)

Connect red to V, black to G, blue to io12, green to io13.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V (io12)

G

BLACK

G (io12)

ECHO

GREEN

io13

TRIG

BLUE

io12

img

11.6 LCD 1602

Component

Wire

ESP32 Board Pins

LCD1602

4PIN Connected (Black-Red-Blue-Green)

I2C

Connect red to V, black to G, blue to SDA, green to SCL.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

SCL

GREEN

SCL

SDA

BLUE

SDA

img

11.7 Temperature and Humidity Sensor

Pass the Dupont wire connected to the button module through the hole marked 20 on the wooden board.

Component

Wire

ESP32 Board Pins

Temperature and Humidity Sensor

3PIN 20cm

io17

Connect red to V, black to G, yellow to io17.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io17

img

11.8 Steam Sensor

Component

Wire

ESP32 Board Pin

Steam Sensor

3PIN 15cm

io35

Connect red to V, black to G, yellow to io35.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io35

img

11.9 Photoresistor

Component

Wire

ESP32 Board Pin

Photoresistor

3PIN 15cm

io34

Connect red to V, black to G, yellow to io34.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io34

img

11.10 Servo

Pass the wire of Servo through the Hole 15, and then connect it to ESP32 board.

Component

Wire

ESP32 Board Pin

Servo

3PIN

io26

Connect red to V, black to G, yellow to io26.

ESP32 Board Pin

Wire Color

V

RED

G

BLACK

IO26

YELLOW

img

11.11 Buzzer

Pass the wire of Buzzer through the Hole 17, and then connect it to ESP32 board.

Component

Wire

ESP32 Board Pin

Buzzer

3PIN 20cm

io16

Connect red to V, black to G, yellow to io16.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io16

image-20250417093147856

img

11.12 LED

Pass the wire of LED through the Hole 7, and then connect it to ESP32 board.

Component

Wire

ESP32 Board Pin

LED

3PIN 20cm

io27

Connect red to V, black to G, yellow to io27.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io27

img

11.13 Water Lever Sensor

Pass the wire of water level sensor through the Hole 13, and then connect it to ESP32 board.

Component

Wire

ESP32 Board Pin

Water Lever Sensor

3PIN 25cm

io33

Connect red to V, black to G, yellow to io33.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io33

img

11.14 Soil Humidity Sensor

Pass the wire of soil humidity sensor through the Hole 11, and then connect it to ESP32 board.

Component

Wire

ESP32 Board Pin

Soil Humidity Sensor

3PIN 20cm

io32

Connect red to V, black to G, yellow to io32.

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io32

img

11.15 Relay Module

Component

Wire

ESP32 Board Pin

Relay Module

3PIN

io25

Module Pin

Wire Color

ESP32 Board Pin

V

RED

V

G

BLACK

G

S

YELLOW

io25

Pass the wire of Water Pump through the Hole 11 in the way as shown below:

img

The red wire of the water pump is connected to the middle terminal of the relay module, and the black wire is connected to the GND of the ESP32 board.

In addition, you need to use a Dupont wire to connect the left terminal of the relay module to the 3.3V of the ESP32.

img

img

Insert the male terminal of the Dupont wire into the female terminal of the relay module and tighten it with a screwdriver.

image-20250417093737686

After the above steps, note that all the wiring has been finished. And wires of the LED, water level sensor, soil humidity sensor, buzzer and relay water pump have respectively passed through the holes of 7, 11, 13, 17 and 40 carved on the basswood board, preparing for the subsequent installation.

354e13bf130d878628f1361fdd37b997

Step 12 Install the house and foundation

12.1 Required components

img

12.2

img

12.3

img

12.4

img

12.5

img

Step 13 Install the Plastic Sinks

13.1 Required components

img

13.2

img

13.3

img

Step 14 Install the soil module and water level module

14.1 Required components

img

14.2

img

14.3

img

14.4

image-20230718085623979

14.5

image-20230718085641291

14.6

image-20230718085722378

14.7

image-20230718085743776

Step 15 Install fence

15.1 Required components

image-20230718085854136

15.2

image-20230718085921988

15.3

image-20230718085936256

15.4

image-20230718085954487

Step 16 Install the Buzzer and the Led Module

16.1 Required components

image-20230718090031524

16.2

image-20230718090057124

16.3

image-20230718090110113

16.4

image-20230718090127577

Step 17 Decorate the House

17.1 Required components

image-20230718090150918

17.2

image-20230718090215504

17.3

image-20230718090227072

Step 18 Install Solar Panel

18.1 Required components

img

18.2

img

18.3

img

18.4

img

18.5

Install the LED light of the solar panel into this hole.

img

18.6

Use a sticker to secure its wires to the wall

img

18.7

img

18.8

img

18.9

img

18.10

image-20230718091556561

Step 19 Install Battery Case

19.1 Required components

image-20230718091623881

19.2

Install 6 AA batteries(Not included in the kit)

image-20250417095312061

19.3

image-20230718091649546

19.4

image-20230718091701966