IoT Lab Day1
IoT Lab
What is IoT?
IoT stands for Internet of Things. It refers to the interconnectedness of physical devices, such as appliances and vehicles, that are embedded with software, sensors, and connectivity which enables these objects to connect and exchange data and also integrates everyday “things” with the internet.
for more information https://aws.amazon.com/what-is/iot/
Today, we are going to learn the basics of IoT using ESP32-S which is a low-cost, low-power Microcontroller with integrated Wi-Fi and Bluetooth for connecting multiple accessories and making these devices connected to the internet.
The accessories we use today are ...
ESP32-S
for more information https://catalog.us-east-1.prod.workshops.aws/workshops/5b127b2f-f879-48b9-9dd0-35aff98c7bbc/en-US/module1/esp32
Breadboard
A breadboard (sometimes called a plug block) is used for building temporary circuits. It is useful to designers because it allows easily removing and replacing components. It is useful to the person who wants to build a circuit to demonstrate its action, then reuse the components in another circuit. (ref: https://www.sciencedirect.com/topics/engineering/breadboard)
ESP32 Board basic
1. GPIO Pins
- GPIO stands for General Purpose Input Output and is responsible for controlling or reading the state of a specific pin in the digital world. For example, this peripheral is widely used to create the LED blinking or to read a simple button. (Some ports such as GPIO6-11 can not be used for input and output but, these ports use for storing and reading values from the ESP32 flash memory only)
for more information https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/gpio.html
2. 5V and 3V3 Pins
- These are two power pins: the VIN pin and the 3V3 pin. The VIN pin can be used to power the ESP32 and its peripherals directly.
3. GND (Ground pin)
- Ground or GND is where the electrical level is at 0 Volts. It is mostly used as a reference to all other electronic parts, they need one common point to operate correctly and that is usually GND.
Setup the ESP32
- Download the Arduino program via https://www.arduino.cc/en/software
- Open the Arduino program
- Go to
File > Preference
paste this link https://espressif.github.io/arduino-esp32/package_esp32_index.json to the Additional boards manager URLs
then click OK.
-
Search
esp32
and clickinstall
libraryesp32 by Espressif Systems
-
After installed the library, go to select the board through
Tools > Board > esp32 > ESP32-WROOM-DA Module
-
Select the USB port that you have connected to the ESP32 at
Tools > Port > COMX (Each computer may see the different number)
Basic programming with Arduino
Arduino uses C language to write the code to operate your Microcontroller.
The basic operation to control your Microcontroller has only 2 main functions
-
void setup()
The first function to be executed in the sketch and it is executed only once. It usually contains statements that set the pin modes on the Arduino to OUTPUT and INPUT, -
void loop()
The function that executes indefinitely until you power off the Arduino