Instructor Notes
This is a placeholder file. Please add content here.
- Downloading and installing the Arduino IDE
- DHT11/DHT12 Guide
- Specifications and Fritzing component downloads
An Introduction to the Internet of Things
Instructor Note
Notes for the instructor
The Arduino IDE
Instructor Note
Remember: system (sudo) python version needs pyserial installed.
To install you need pip
(Linux):
sudo apt-get install python3-pip
To install pyserial: sudo pip3 install pyserial
Understanding the code
Connecting the first sensor
Connecting the second sensor
Combining the two circuits
Using MQTT for the Internet of Things
Instructor Note
To avoid the requirement of Internet access for this lesson it is possible to set up and access point and MQTT broker using a Raspberry Pi. It could be done with any available computer, really, but the RPi makes for a simple solution that one can prepare beforehand and keep just for this purpose. It is small and easy to take along to a workshop.
This has only been tested with a RPi 4 with 2GB of RAM. Older RPis should work.
- Using the Raspberry Pi Imager, select the Raspberry Pi OS Lite version of the operating system.
- Using the settinngs menu, enable SSH and configure the wireless LAN. The settings are very much determined by your Internet connectivity and network setup so it might be worth looking at documentation on the Internet for your specific circumstances. Make sure you set the Wireless LAN coutry and the locale settings.
- Write the operating system to a micro-SD card and start up the RPi. You should be able to ssh into the RPi at this point
- To create an access point we will use the software developed by the open-source project RaspAP (https://raspap.com/)
- To install RaspAP:
After the reboot log into the RPi again
- You should now be able to connect to the Access point with the following information:
IP address: 10.3.141.1
Username: admin
Password: secret
DHCP range: 10.3.141.50 — 10.3.141.255
SSID: raspi-webgui
Password: ChangeMe
- Using a browser navigate to 10.3.141.1 and log in using as user
admin
with passwordsecret
. Change the IP address to192.168.0.1
and the DHCP range to192.168.0.50 - 192.168.0.255
. You don’t have to do this but if you don’t you’ll have to adapt the IP address for the MQTT server in the lesson. - Reboot the RPi
- Log into the RPi again. We now have to install Mosquitto which is the MQTT broker and client
- In the terminal type the following command:
- Reboot again just to be sure
- Your RPi should now be running RaspAP for students to connect to for an Access Point and it should be running the Mosquitto broker.