0% found this document useful (0 votes)
22 views4 pages

Practical 6A - Grove Pi+

Uploaded by

black hello
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views4 pages

Practical 6A - Grove Pi+

Uploaded by

black hello
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

BAIT2123 INTERNET OF THINGS Jul 2024

Practical 6 A - Grove Pi+

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

Procedure

Step 1: Test Ultrasonic and Relay.


* Picture is for illustration ONLY, please follow the steps correctly.5

1. Connect a Grove Relay to port D2 and the Grove Ultrasonic to port D3.

2. In Thonny Python (ID), click “New” to create a new python file and Save As
“test04.py”. Type the following codes:

3. Type the following code:


BAIT2123 INTERNET OF THINGS Jul 2024

4. Run the code

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)
BAIT2123 INTERNET OF THINGS Jul 2024

* Clue: refer to how relay works, and you may need another relay to do it.

Step 2: Test RGB LCD Display and DHT (Digital Humidity and Temperature)

* Picture is for illustration ONLY, please follow the steps correctly.

1. Connect a Grove DHT to port D7 and the Grove RGB LCD Display to any of the I2C
ports.
2. In Thonny Python (ID), click “New” to create a new python file and Save As
“test05.py”. Type the following codes:

3. Type the following code:

4. Run the code

* If your Grove RGB LCD only able to display ½ row of characters (malfunction)
BAIT2123 INTERNET OF THINGS Jul 2024

(8 characters per row), try to indicate the value as “T: 26.3C H:62.7%”

Task 1: Test your temperature and humidity sensor by facing it with a few breaths.

Task 2: Adjust the LCD backlight and add two LED lights to indicate the temperature
and humidity values in alarming levels.

You might also like