2. Objective
❑ Basic of ioT
❑ Introduction to ESP32 for ioT
❑ Input and Output
❑ Multitasking
2
PREPARE BY SUNPHONG THANOK
3. Internet of things
The Internet of things (IoT) describes the network of physical objects—“things”—that are
embedded with sensors, software, and other technologies for the purpose of connecting and
exchanging data with other devices and systems over the Internet.
3
PREPARE BY SUNPHONG THANOK
4. Embedded System
Definition:
“An embedded system is a computer system designed for specific control
functions within a larger system, often with real-time computing constraints.”
4
Memory CPU
Hardwired Unit
Sensor
Actuator
Embedded System
PREPARE BY SUNPHONG THANOK
5. Embedded System
Embedded systems represent target platforms that are usually specific to a single task. This
specificity means the system design can be highly optimized because the range of tasks the
device must perform is well bounded. In other words, you wouldn’t use your PC to run your coffee
machine (you might, but that’s beside the point). Unlike your desktop processor, the 4-bit
microcontroller that runs your coffee machine costs less than $1 in large quantities. It does
exactly what it’s supposed to do to — make your coffee. It doesn’t play Zelda, nor does it exchange
data with an Internet service provider (ISP), although that might change soon. Because the
functionality of the device is so narrowly defined, you must find the optimal processing element
(CPU) for the design. Given the several hundred choices available and the many variations within
those choices, choosing the right CPU can be a daunting task.
5
PREPARE BY SUNPHONG THANOK
6. Embedded & IoT
PREPARE BY SUNPHONG THANOK 6
Hardware
Network
Software
IoT
Embedded
Memory CPU
Hardwired Unit
Sensor
Actuator
Embedded System
Network
Module
IoT Device
7. ioT Market in Worldwide
❑The following Table shows IDC's overall revenue forecasts for the ioT market, segmented by
major industry, including the value of telecommunication and mobile phones
❑The market size includes all external spending by OEMs and subcontractors on technology and
services suppliers, integrating the following product and services categories
❑ioT market should reach €1.5 trillion in revenue by 2015
7
PREPARE BY SUNPHONG THANOK
9. Internet of things
The Internet of things (IoT) describes the network of physical objects—“things”—that are
embedded with sensors, software, and other technologies for the purpose of connecting and
exchanging data with other devices and systems over the Internet.
The definition of the Internet of things has evolved due to the convergence of multiple
technologies, real-time analytics, machine learning, commodity sensors, and embedded systems.
Traditional fields of embedded systems, wireless sensor networks, control systems, automation
(including home and building automation), and others all contribute to enabling the Internet of
things. In the consumer market, IoT technology is most synonymous with products pertaining to
the concept of the "smart home", including devices and appliances (such as lighting fixtures,
thermostats, home security systems and cameras, and other home appliances) that support one
or more common ecosystems, and can be controlled via devices associated with that ecosystem,
such as smartphones and smart speakers.
9
PREPARE BY SUNPHONG THANOK
13. Introduction to ESP32
Key Features
• 240 MHz dual core Tensilica LX6 microcontroller with 600
DMIPS
• Integrated 520 KB SRAM
• Integrated 802.11 b/g/n HT40 Wi-Fi transceiver,
baseband, stack and LwIP
• Integrated dual mode Bluetooth (classic and BLE)
• 16 MB flash, memory-mapped to the CPU code space
• 2.3V to 3.6V operating voltage
• -40°C to +125°C operating temperature
• On-board PCB antenna / IPEX connector for external
antenna
Security Related
• WEP, WPA/WPA2 PSK/Enterprise
• Hardware-accelerated encryption: AES/SHA2/Elliptical
• Curve Cryptography/RSA-4096
Performance
• Max data rate of 150 Mbps@11n HT40, 72 Mbps@11n
HT20, 54
• Maximum transmit power of 19.5 dBm@11b, 16.5
dBm@11g, 15.5 dBm@11n
• Minimum receiver sensitivity of -97 dBm
• 5 μA power consumption in Deep-sleep
13
PREPARE BY SUNPHONG THANOK
16. ESP32 Block Diagram
Advanced Peripheral Interfaces
• 12-bit SAR ADC up to 18 channels
• 2 × 8-bit D/A converters / 10 × touch sensors /
Temperature sensor
• 4 × SPI / 2 × I2S / 2 × I2C / 3×UART
• 1 host (SD/eMMC/SDIO) / 1 slave (SDIO/SPI)
• Ethernet MAC interface with dedicated DMA and IEEE
1588 support
• CAN 2.0
• IR (TX/RX)
• Motor PWM
• LED PWM up to 16 channels
• Hall sensor
• Ultra low power analog pre-amplifier
16
PREPARE BY SUNPHONG THANOK
17. Input & Output
NodeMCU Digital Inputs and Digital Outputs (Arduino IDE)
Ref: https://randomnerdtutorials.com/esp8266-nodemcu-digital-inputs-outputs-
arduino/
17
PREPARE BY SUNPHONG THANOK
18. Multitask
Multitasking is the ability to perform more than one task or activity at the same time
18
PREPARE BY SUNPHONG THANOK
19. TaskScheduler
Cooperative multitasking for Arduino, ESPx, STM32 and other
microcontrollers.
Supports: periodic task execution (with dynamic execution
period in milliseconds or microseconds – frequency of
execution), number of iterations (limited or infinite number of
iterations), execution of tasks in predefined sequence,
dynamic change of task execution parameters (frequency,
number of iterations, callback methods), power saving via
entering IDLE sleep mode when tasks are not scheduled to
run, event-driven task invocation via Status Request object,
task IDs and Control Points for error handling and watchdog
timer, Local Task Storage pointer (allowing use of same
callback code for multiple tasks), layered task prioritization,
std::functions (esp8266, esp32 only), overall task timeout,
static and dynamic callback method binding.
19
PREPARE BY SUNPHONG THANOK