on advanced technology, there is a long library for almost every sensor available in the market.
Thus, we will have a readymade library for SDS011 that utilizes a Software Serial library and
seamlessly for Arduino Uno. However, ESP32 does not work with Software Serial. It consists
of three UART ports and uses Hardware Serial to connect to UART devices. We will be using
the existing library and commands with hardware-serial to receive PM data from the installed
sensors. The commands will be stored in processdata.file.
The SDS011 has a sleep current of 2mA. This sensor works even on sleep mode quite
infrequently. Sleep commands will be stored in processdata.h file for you to explore. However,
GPIO13 is utilized to switch on the NPN transistor (2N2219) to hold SDS011 on during its active
stage, before it could possibly turn into a power-o mode.
Once everything is done to this point, now it’s time to upload the code to ESP32. For this,
you will need to assemble devices on the PCB or to the general purpose Vero board. Then
connect the USB power supply to the ESP32 module. Start Arduino IDE to add the library for
ESP32 and other important libraries. Then you will need to open the Arduino Code to change/
provide Wi-Fi ID and Password for the initial setup. Now replace the ThinkSpeak channel
number with your own channel number. Then you will need to select the ESP32 Developers
module from the pull-down menu under tools option. Next is to select the right USB COM
port from the pull-down menu. Lastly, press upload. If you have installed everything right at its
place then the program will start communicating with the ESP32 board and then you will start
uploading the code into ESP32 MCU.
Once the process is complete you should see PM2.5, PM10 and other important data on the
TFT screen. The same data will be replicated on the serial monitor of Arduino.
PROJECT 4: SMART CAMERA BASED ON IoT BY USING
ANDROID AND RASPBERRY PI
Introduction and Objectives
In the 21st century of digital world and internet, surveillance is very important to ensure security
and protection. No one wants a burglar or a trespasser roaming around their private property.
For this reason, we need a complete flexible surveillance solution that is easily accessible by the
user. In this project, we will be using the Raspberry Pi (RPi) to make a smart camera and then
watch its live video on a smartphone from anywhere. For this project, internet connectivity is
a must for both Raspberry Pi and the smartphone. By following the step by step guide you can
build your own remote security camera for surveillance.
Method and Approach
Hardware Needed for the Project
1. An Android smartphone (it must be 4.0 [ice-cream sandwich] or higher).
2. Raspberry Pi 2.
3. Raspberry Camera module.
4. A 5 volt, 1 Amp with micro-USB output (mostly used in smartphones).
5. USB audio adaptor (This is optional only if you need audio in your video feed).
6. USB Wi-Fi dongle (It must be compatible with Raspberry Pi 2).
356 Internet of Things
Internet_of_Things_CH14_pp349-372.indd 356 9/3/2019 10:17:35 AM