Introduction to Arduino and IoT
What is Arduino?
• - Arduino is an open-source electronics
platform based on simple hardware and
software.
• - It’s used to build digital devices and
interactive objects.
• - Suitable for beginners, hobbyists, and
professionals.
Arduino Board Overview
• - Popular Boards: Arduino Uno, Mega, Nano,
Leonardo
• - Key Components:
• • Microcontroller (e.g., ATmega328P)
• • Digital & Analog Pins
• • USB Interface
• • Power Jack
• • Reset Button
• - Programming Language: Arduino C/C++
The Arduino Development Board
Different types of Arduino
Boarduino Kit
Arduino LilyPad
DIY Arduino
Arduino Uno
Arduino Mega 2560
5
USB
PWR IN
(to Computer)
RESET
SCL\SDA
(I2C Bus)
POWER
5V / 3.3V / GND
Digital I\O
PWM(3, 5, 6, 9, 10, 11)
Analog
INPUTS
6
The Arduino Microcontroller: Atmel ARV
Atmega 328
Getting Started
• Check out: http://arduino.cc/en/Guide/HomePage
1. Download & install the Arduino environment (IDE)
2. Connect the board to your computer via the UBS cable
3. If needed, install the drivers (not needed in lab)
4. Launch the Arduino IDE
5. Select your board
6. Select your serial port
7. Open the blink example
8. Upload the program
Try It: Connect the USB Cable
Arduino IDE
See: http://arduino.cc/en/Guide/Environment for more information
Select Serial Port and Board
Status Messages
Add an External LED to pin 13
• File > Examples > Digital > Blink
• LED’s have polarity
– Negative indicated by flat side of the housing
and a short leg
A Little Bit About Programming
• Code is case
sensitive
• Statements are
commands and
must end with a
semi-colon
• Comments follow
a // or begin with /*
and end with */
• loop and setup
6 Major concepts
• digitalWrite()
• analogWrite()
• digitalRead()
• If (statements) / Boolean
• analogRead
• Serial Communication
16
Our First Program
Terminology
Digital I/0
pinMode(pin, mode)
Sets pin to either INPUT or OUTPUT
digitalRead(pin)
Reads HIGH or LOW from a pin
digitalWrite(pin, value)
Writes HIGH or LOW to a pin
Electronic stuff
Output pins can provide 40 mA of current
Writing HIGH to an input pin installs a 20KΩ pullup
Arduino Timing
• delay(ms)
– Pauses for a few milliseconds
• delayMicroseconds(us)
– Pauses for a few microseconds
• More commands:
arduino.cc/en/Reference/HomePage
Digital? Analog?
• Digital has two values: on and off
• Analog has many (infinite) values
• Computers don’t really do analog, they quantize
• Remember the 6 analog input pins---here’s how
they work
Applications of Arduino
• - Home automation
• - Robotics
• - Sensor-based projects
• - Wearable technology
• - Environmental monitoring
What is IoT (Internet of Things)?
• - IoT is a network of interconnected devices
that collect and exchange data.
• - Devices can be sensors, actuators, smart
appliances, etc.
• - IoT enables automation, remote control, and
real-time monitoring.
Basic Architecture of IoT
• 1. Sensors & Actuators
• 2. Microcontroller (Arduino, NodeMCU)
• 3. Communication (Wi-Fi, Bluetooth, GSM)
• 4. Cloud/Server
• 5. User Interface (Web App/Mobile App)
IoT Communication Technologies
• - Wi-Fi (ESP8266/NodeMCU)
• - Bluetooth (HC-05/HC-06)
• - GSM (SIM800L)
• - MQTT Protocol
• - REST APIs
Arduino + IoT Projects Examples
• - Smart Home (LED, Fan automation)
• - Temperature Monitoring using DHT11 +
Blynk
• - Soil Moisture-based Irrigation System
• - RFID-based Attendance System
Tools and Platforms
• - Arduino IDE
• - Tinkercad (Simulation)
• - Blynk, ThingSpeak, IFTTT
• - NodeMCU (for Wi-Fi-enabled IoT)
Benefits of Arduino in IoT
• - Cost-effective
• - Easy to use
• - Open-source community
• - Extensive library support
• - Rapid prototyping
Summary
• - Arduino is a great tool to learn embedded
systems.
• - IoT enables devices to talk and automate
tasks.
• - Combining both opens possibilities for smart
and connected systems.