0% found this document useful (0 votes)
7 views

Practical 6B - Grove Base HAT

Uploaded by

black hello
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Practical 6B - Grove Base HAT

Uploaded by

black hello
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

BAIT2123 INTERNET OF THINGS Jul 2024

Practical 6 B - Grove Base HAT

Objective
Further understand Raspberry Pi, Grove Pi module and sensor features.

Procedure

Step 1: Test on Ultrasonic Sensor & Relay

- Connect Grove - Ultrasonic Ranger to port D5, Grove - Relay to port D16 of Base Hat.

- In Thonny IDE, create a new python file, named “test04b.py”. Type the following code in
your test05b.py

- Run the program


BAIT2123 INTERNET OF THINGS Jul 2024

Task 1: Modify the hardware circuit to allow relay contact with the buzzer (if no buzzer,
use LED).

* Clue: refer to the following diagram

Task 2: Adding relay and LEDs on the constructed hardware circuit to allow relay to
control Red and Green Lights (either one side is selected)

* Clue: refer to how relay works, and you may need another relay to do it.
BAIT2123 INTERNET OF THINGS Jul 2024

Step 2: Test LCD & Digital Temperature and Humidity (DHT) Sensor

- Connect Grove - 16*2 LCD to I2C port,Grove - Temperature and Humidity Sensor to
port D5.

- In Thonny IDE, create a new python file, named “test06b.py”. Type the following code in
your test06b.py

- Run the program


- If everything goes well, you should see the relay on/off once it detects an obstacle within
20 cm.

Task 1: Test your DHT sensor by facing it with a few breaths.

Task 2: Add LED light and buzzer to indicate the temperature and humidity values in
alarming levels (example: humidity value > 80%).

You might also like