2. Table
of
Contents
1. Raspberry pi Introduction.....................................................................................................................3
1.1. Raspberry pi Model.......................................................................................................................4
1.2. Raspberry Pi Connections .............................................................................................................5
1.3. Raspberry Pi 4 Pin out...................................................................................................................6
1.4. Power Supply ................................................................................................................................7
1.5. Micro SD card................................................................................................................................8
1.6. Headphones or speakers ............................................................................................................10
1.7. An Ethernet cable........................................................................................................................10
1.8. OS Installation.............................................................................................................................11
1.9. Terminal ......................................................................................................................................15
2. Trainer Overview.................................................................................................................................16
3. Modules..............................................................................................................................................17
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
1
3.1. LEDs ............................................................................................................................................17
3.2. Switches .....................................................................................................................................18
3.3. FlameSensor ..............................................................................................................................19
3.4. PIR Sensor .................................................................................................................................20
3.5. DHTSensor ................................................................................................................................21
3.6. Ultrasonic Sensor ......................................................................................................................22
3.7. CDS Sensor .................................................................................................................................23
3.8. Potentimeter ..............................................................................................................................24
3.9. Sound Sensor..............................................................................................................................25
3.10. Opto Sensor ................................................................................................................................26
3.11. IR Reciever..................................................................................................................................27
3.12. Reed Switch................................................................................................................................28
3.13. Limit Switch................................................................................................................................29
3.14. Push Button ................................................................................................................................30
3.15. Tilt Sensor ................................................................................................................................... 31
3.16. Touch Sensor............................................................................................................................... 32
3.17. Vibration Sensor.......................................................................................................................... 33
3. 3.19. RGB LED ......................................................................................................................... 35
3.20. RelayModule.................................................................................................................. 36
3.21. PiezoBuzzer.................................................................................................................... 37
3.22. LCD ................................................................................................................................. 38
3.23. DustSensor ..................................................................................................................... 39
3.24. LM35Sensor................................................................................................................... 40
Table
of
Contents
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
2
4. Interfacing....................................................................................................................................... 52
5.1 What is IOT ? ....................................................................................................................................68
5.2 ApplicationsofIOT..........................................................................................................................68
3.25. Stepper Motor............................................................................................................... 41
3.26. Servo Motor................................................................................................................... 42
3.27. DC-Motor....................................................................................................................... 43
3.28. Joystick........................................................................................................................... 44
3.29. Thermistor..................................................................................................................... 45
3.30. Water Sensor................................................................................................................. 46
3.31. IRReflective.................................................................................................................... 47
3.32. LaserModule.................................................................................................................. 48
3.33. Speaker..........................................................................................................................49
3.34. ADCModule................................................................................................................... 50
3.18. Gyroscope....................................................................................................................... 34
5.3 IntroductiontoNodeRed................................................................................................................69
5.4 HowtoSetupNodeRedonRaspberryPI......................................................................................... 69
5.5 HowtoRunNodeRed .....................................................................................................................70
5.6 Example1:ControllingLEDfromNodeRed.....................................................................................71
5.7 Example2:DHT22Sensor (TemperatureandHumidityDisplay)...................................................76
5.8 IntroductiontoMQTT.....................................................................................................................90
5.9 HowMQTT Works..........................................................................................................................91
5.10 HiveMQCloud............................................................................................................................. 91
5.11 ExampleonMQTT........................................................................................................................ 92
4. 1. Raspberry Pi Introduction
• Raspberry Pi is a small single board computer. By connecting peripherals like Keyboard,
mouse, display to the Raspberry Pi, it will act as a mini personal computer.
• Raspberry Pi is popularly used for real time Image/Video Processing, IoT based
applications and Robotics applications.
• Raspberry Pi is slower than laptop or desktop but is still a computer which can provide all
the expected features or abilities, at a low power consumption.
• Raspberry Pi Foundation officially provides Debian based Raspbian OS. Also, they
provide NOOBS OS for Raspberry Pi. We can install several Third-Party versions of OS
like Ubuntu, Archlinux, RISC OS, Windows 10 IOT Core, etc.
• Raspbian OS is official Operating System available for free to use. This OS is efficiently
optimized to use with Raspberry Pi. Raspbian have GUI which includes tools for
Browsing, Python programming, office, games, etc.
• We should use SD card (minimum 8 GB recommended) to store the OS (operating
System).
• Raspberry Pi is more than computer as it provides access to the on-chip hardware i.e.
GPIOs for developing an application. By accessing GPIO, we can connect devices like
LED, motors, sensors, etc and can control them too.
• It has ARM based Broadcom Processor SoC along with on-chip GPU (Graphics
Processing Unit).
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
3
5. 1.1. Raspberry pi Model
There are several models of Raspberry Pi, and for most people
Raspberry Pi 4 Model B is the one to choose. Raspberry Pi 4 Model
B is the newest, fastest, and easiest to use.
Raspberry Pi 4 comes with 2GB, 4GB, or 8GB of RAM. For most
educational purposes and hobbyist projects, and for use as a desktop
computer, 2GB is enough.
Raspberry Pi 4 Model B offers ground-breaking increases in
processor speed, multimedia performance, memory, and
connectivity compared to the prior-generation Raspberry Pi 3
Model B+, while retaining backwards compatibility and
similar power consumption. For the end user, Raspberry Pi 4
Model B provides desktop performance comparable to entry-
level x86 PC systems.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
4
6. 1.2. Raspberry Pi Connections
Now get everything connected to your Raspberry Pi. It’s
important to do this in the right order, so that all your
components are safe.
• USB ports: these are used to connect a mouse and
keyboard. You can also connect other components, such as
a USB drive.
• SD card slot: you can slot the SD card in here. This is
where the operating system software and your files are
stored.
• Ethernet port: this is used to connect Raspberry Pi to a
network with a cable.
Raspberry Pi can also connect to a network via wireless
LAN.
• Audio jack: you can connect headphones or speakers here.
• HDMI port: this is where you connect the monitor (or
projector) that you are using to display the output from the
Raspberry Pi. If your monitor has speakers,you can also use
them to hear sound.
• Micro USB power connector: this is where you connect a
power supply. You should always do this last, after you
have connected all your other components.
• GPIO ports: these allow you to connect electronic
components such as LEDs and buttons to Raspberry Pi.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
5
7. 1.3. Raspberry Pi 4 Pin out
Raspberry Pi Zero, Raspberry Pi Zero W, and Raspberry Pi Zero WH are
smaller and require less power, so they’re useful for portable projectssuch as
robots. It’s generally easier to start a project with Raspberry Pi 4, and to move
to Raspberry Pi Zero when you have a working prototype that a smaller
Raspberry Pi would be useful for.
A Raspberry Pi 4 board has 40 pins on it. Among these pins, we have four power pins on the Raspberry Pi, two of which are 5v pins and
another two are 3.3v pins. The 5v power pins are connected directly to the Raspberry Pi's power input and we can use these pins to
run low power applications.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
6
8. 1.4. Power Supply
To connect to a power socket, all Raspberry Pi models have a USB port (the same found on many
mobile phones): either USB-C for Raspberry Pi 4, or micro USB for Raspberry Pi 3, 2, and 1.
You need a power supply that provides:
At least 3.0 amps for Raspberry Pi 4
At least 2.5 amps for Raspberry Pi
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
7
9. 1.5. Micro SD card
Your Raspberry Pi needs an SD card to store all its files and the Raspberry Pi OS operating
system.
You need a microSD card with a capacity of at least 8GB.
Many sellers supply SD cards for Raspberry Pi that are already set up
with Raspberry Pi OS and ready to go.
A keyboard and a mouse
To start using your Raspberry Pi, you need a USB keyboard and a USB mouse. Once
you’ve set up your Raspberry Pi, you can use a Bluetooth keyboard and mouse, but
you’ll need a USB keyboard and mouse for the first setup.
A TV or computer screen
To view the Raspberry Pi OS desktop environment, you need a screen, and a cable to link the screen and your Raspberry Pi. The screen can be a
TV or a computer monitor. If the screen has built-in speakers, Raspberry Pi is able to use these to play sound.
HDMI
Your Raspberry Pi has an HDMI output port that is compatible with the HDMI port of most modern TVs and computer monitors.
Many computer monitors may also have DVI or VGA ports.
Raspberry Pi 4 has two micro HDMI ports, allowing you to connect two separate monitors.
You need either a micro HDMI to HDMI cable, or a standard HDMI to HDMI cable plus a micro HDMI to HDMI adapter, to connect
Raspberry Pi 4 to a screen.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
8
10. Raspberry Pi 1, 2, and 3 have a single full-size HDMI port, so you can connect them to a screen using a standard HDMI to HDMI cable.
DVI
If your screen has a DVI port, you can connect your Raspberry Pi to it using an HDMI to DVI cable.
VGA
Some screens only have a VGA port.
To connect your Raspberry Pi to such a screen, you can use an HDMI to VGA adapter.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
9
11. 1.6. Headphones or speakers
The large Raspberry Pi models (but not Raspberry Pi Zero or Raspberry Pi Zero W) have a standard audio port like the one on a
smartphone or MP3 player. The Pi Model B+, Pi 2, Pi 3 and Pi 4 features a 4-pole 3.5mm audio jack which also includes the
composite video signal. This has allowed for the removal of the composite video socket found on the original Model B. The new jack
is a 4-pole socket which carries both audio and video signals.
If you want to, you can connect your headphones or speakers so that your Raspberry Pi can play sound. If the screen you’re
connecting your Raspberry Pi to has built-in speakers, Raspberry Pi can play sound through these.
1.7. An Ethernet cable
The large Raspberry Pi models (but not Raspberry Pi Zero or Raspberry Pi Zero W) have a standard Ethernet port to connect them
to the internet; to connect Raspberry Pi Zero to the internet, you need a USB to Ethernet adapter.
Raspberry Pi 4, Raspberry Pi 3, and Raspberry Pi Zero W can also be wirelessly connected to the internet.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
10
12. 1.8. OS Installation
In the following steps, we will install Raspbian OS on SD card and connect to Raspberry pi headless with SSH.
Step 1 : Insert a microSD card into your computer. Your card should be 8
GB or Larger.
Step 2 : Install Etcher, Click the Select image button and choose the
Raspbian image to flash.
Step 3 : Select the SD card and click flash
You can download operating system images from this link : https://www.raspberrypi.com/software/operating-systems/
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
11
13. Step 4: Etcher will take a few minutes to install Raspbian on your microSD card When it's done at least in Windows you'll see a number
of alerts prompting you to format the card Close these dialog boxes or hit cancel on them ( you will format over the OS).
Step 5: Write an empty text file named " ssh"(no file extension) to the root of the directory of the card When it sees the " on its first
boot up, Raspbian will automatically enable SSH (Secure Socket Shell), which will allow you to remotely access the Pi command line
from your PC.
Step 6 : insert an SD card with Raspbian installed.
Step 7: Plug the power supply into a socket and connect it to your Raspberry Pi’s power port. You should see a red LED light up on the
Raspberry Pi, which indicates that Raspberry Pi is connected to power. As it starts up (this is also called booting).
After a few seconds the Raspberry Pi OS desktop will appear.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
12
14. Finishing the setup
When you start your Raspberry Pi for the first time, the Welcome to
Raspberry Pi application will pop up and guide you through the
initial setup.
• Click on Next to start the setup.
• Set your Country, Language, and Time zone, then click on Next again.
• Enter a new password for your Raspberry Pi and click on
Next.
• Connect to your wireless network by selecting its name,
entering the password, and clicking on Next.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
13
15. • Click on Next, and let the wizard check for updates to
Raspberry Pi OS and install them (this might take a little while).
• Click on Restart to finish the setup.
Wait until the wireless connection icon appears and the correct time is shown before trying to update the software.
You will only need to reboot if that’s necessary to complete an update.
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
14
16. 1.9. Terminal
The terminal (or 'command-line') on a computer allows a user a great deal of control over their system. Users of Windows may
already have come across Command Prompt or Powershell, while mac OS users may be familiar with Terminal. All of these tools allow a
user to directly manipulate their system through the use of commands. These commands can be chained together and/or combined
together into complex scripts that can potentially complete tasks more efficiently than much larger traditional software packages.
Opening a Terminal window
On the Raspberry Pi OS, the default terminal application is called LXTerminal. This is known as a 'terminal emulator', this means that it
emulates the old style video terminals — from before Windowing systems were developed — inside a graphical environment. The application
can be found on the Raspberry Pi desktop, and when started will look something like this
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
15
17. 2. Trainer Overview
The AIOT Basic Kit is easy to use and flexible to handle numerous pre-built modules. Kit introduces a safe and easy connection of the kit’s
components by 2mm banana cables to 2mm safe banana plug.All modules are protected against reverse polarity connections. Users can
install the required application components and connect between them easily. Kit’s Main AIoT controller’s GPIOs pins are accessible via
2mm banana plug for easy connection to the Kit’s modules, The 2mm banana cable is stackable, so you can share the same Main AIoT
Controller’s GPIO Pins between more than one module.
For easier connections
Breakout cable has been provided
to connect the Raspberry Pi board to
the system devices.
5V power supply 3.3V and
Dual Power Supply
Micro-controller Kit is among
few development boards which
support both 3.3V and 5V
microcontrollers. This feature
greatly increases the number of
supported MCUs. It’s like
having two boards instead of
one!
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
16
18. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
17
3. Modules
3.1. LEDs
A light-emitting diode (LED) is a semiconductor device that emits light when an electric current flows through it. When current passes
through an LED, the electrons recombine with holes emitting light in the process. LEDs allow the current to flow in the forward direction
and blocks the current in the reverse direction.
LEDs find applications in various fields, including optical communication, alarm and security systems, remote-controlled operations,
robotics, etc. It finds usage in many areas because of its long-lasting capability, low power requirements, swift response time, and fast
switching capabilities. Below are a few standards LED uses:
• Used for TV back-lighting
• Used in displays
• Used in Automotives
• LEDs used in the dimming of lights
19. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
18
3.2. Switches:
Switches and push-buttons are mechanical devices that have two or more sets of
electrical contacts. When the switch is open or disconnected, the contacts are open
circuited and when the switch is closed or operated these contacts are shorted
together.
The most common way of input interfacing a switch (or push button) to an
electronic circuit is via a pull-up resistor to the supply voltage as shown. When the
switch is open, 5 volts, or a logic “1” is given as the output signal. When the switch is
closed the output is grounded and 0v, or a logic “0” is given as the output.
Then depending upon the position of the switch, a “high” or a “low” output is
produced. A pull-up resistor is necessary to hold the output voltage level at the
required value (in this example, +5v) when the switch is open and also to prevent
the switch from shorting out the supply when closed.
Push button switches are present in so many areas across different industries and
for different uses here are some examples:
• Calculator buttons – a hand held calculator has lots of small push button
switches
• Reset switches – these are usually small and require a tool to press to avoid
accidental operation
• Stopping machinery – often around industrial machinery there will be an
emergency stop button, sometimes these are located on the wall
• Arcade gaming – these are usually brightly coloured to encourage people to
play
20. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
19
A flame detector is a type of sensor that can detect and respond to the presence of a flame.
These detectors have the ability to identify smokeless liquid and smoke that can create
open fire. For example, in boiler furnaces flame detectors are widely used, as a flame
detector can detect heat, smoke, and fire. These devices can also detect fire according to the
air temperature and air movement. The flame detectors use Ultraviolet (UV) or Infra-Red
(IR) technology to identify flames meaning they can alert to flames in less than a second.
The flame detector would respond to the detection of a flame according to its installation,
it could for example sound an alarm, deactivate the fuel line, or even activate a fire
suppression system.
3.3 Flame Sensor
Applications of Flame Sensor:
These sensors are used in several dangerous situations which include
the following.
• Hydrogen stations
• Industrial heating
• Fire detection
• Fire alarm
• Fire fighting robot
• Drying systems
• Industrial gas turbines
• Domestic heating systems
• Gas-powered cooking devices
21. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
20
3.4 PIR Sensor
PIR sensors allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range.
They are small, inexpensive, low-power, easy to use and don't wear out. For that reason they are commonly found in appliances and
gadgets used in homes or businesses. They are often referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR motion" sensors.
PIRs are basically made of a pyroelectric sensor (which you can see below as the round metal can with a rectangular crystal in the
center), which can detect levels of infrared radiation. Everything emits some low level radiation, and the hotter something is, the
more radiation is emitted. The sensor in a motion detector is actually split in two halves. The reason for that is that we are looking to
detect motion (change) not average IR levels. The two halves are wired up so that they cancel each other out. If one half sees more or
less IR radiation than the other, the output will swing high or low.
For many basic projects or products that need to detect when a person has left or entered the area, or has approached, PIR sensors
are great. They are low power and low cost, pretty rugged, have a wide lens range, and are easy to interface with. Note that PIRs
won't tell you how many people are around or how close they are to the sensor, the lens is often fixed to a certain sweep and distance
(although it can be hacked somewhere) and they are also sometimes set off by house pets. Experimentation is the key.
22. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
21
3.5 DHT Sensor
The DHT22 module contains a capacitive humidity sensor, DS18B20 temperature sensor and an unnamed 8-bit microcontroller.
According to its datasheet, it is capable of detecting 0 to 100% relative humidity and temperatures from -40 to 125 degree celsius. The
resolution for both humidity and temperature is 0.1 (RH and degree celsius) while the accuracy is +/ 2 for humidity and +/ 0.3 for
temperature.
This sensor is used in various applications such as measuring humidity and
temperature values in heating, ventilation and air conditioning systems. Weather
stations also use these sensors to predict weather conditions. The humidity sensor is
used as a preventive measure in homes where people are affected by humidity. Offices,
cars, museums, greenhouses and industries use this sensor for measuring humidity
values and as a safety measure.
23. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
22
3.6 Ultrasonic Sensor
The ultrasonic sensor (or transducer) works on the same principles as a radar system. An ultrasonic sensor can convert electrical energy
into acoustic waves and vice versa. The acoustic wave signal is an ultrasonic wave traveling at a frequency above 18kHz. The famous HC
SR04 ultrasonic sensor generates ultrasonic waves at 40kHz frequency.
Typically, a microcontroller is used for communication with an ultrasonic sensor. To begin measuring the distance, the microcontroller
sends a trigger signal to the ultrasonic sensor. The duty cycle of this trigger signal is 10µS for the HC-SR04 ultrasonic sensor. When
triggered, the ultrasonic sensor generates eight acoustic (ultrasonic) wave bursts and initiates a time counter. As soon as the reflected
(echo) signal is received, the timer stops. The output of the ultrasonic sensor is a high pulse with the same duration as the time difference
between transmitted ultrasonic bursts and the received echo signal.
•
Applications of Ultrasonic Sensor:
•
Ultrasonic Anemometers
•
Tide gauge
•
Tank level
•
Functional in sunlight
•
Web-guiding systems
•
UAV navigation
Detecting Nearby Objectes.
24. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
23
3.7 CDS Sensor
Photoresistors, also known as light dependent resistors (LDR), are light sensitive devices
most often used to indicate the presence or absence of light, or to measure the light
intensity. In the dark, their resistance is very high, sometimes up to 1 MΩ, but when the
LDR sensor is exposed to light, the resistance drops dramatically, even down to a few
ohms, depending on the light intensity. LDRs have a sensitivity that varies with the
wavelength of the light applied and are nonlinear devices. They are used in many
applications, but this light sensing function is often performed by other devices such as
photodiodes and phototransistors. Some countries have banned LDRs made of lead or
cadmium over environmental safety concerns.
What is a Illuminance (LDR) sensor used for?
• The LDR is used in the infrared astronomy.
• The LDR is used in light failure alarm circuits and used in light meter.
• The LDR used in smoke detectors.
• It is used for automatic contrast and brightness control in television receivers.
• It is used in photosensitive relay
• It is used in optical coding.
• It is used in street light control circuits.
• It is used in camera light meters.
• It is used in the security alarm.
• It is used as a proximity switch.
• It is used in light activated control circuits.
26. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
25
3.9 Sound Sensor
A sound sensor is defined as a module that detects sound waves through its intensity
and converting it to electrical signals. Sound detection sensor works similarly to our
Ears, having diaphragm which converts vibration into signals. However, what’s
different as that a sound sensor consists of an in-built capacitive microphone, peak
detector and an amplifier (LM386, LM393, etc.) that’s highly sensitive to sound.
With these components, it allows for the sensor to work:
1. Sound waves propagate through air molecules
2. Such sound waves cause the diaphragm in the microphone to vibrate, resulting in
capacitance change
3. Capacitance change is then amplified and digitalized for processing of sound
intensity
What is a sound sensor used for?
Apart from building various electronic projects with Arduino (covered
in the later section) and more, sound sensors are used in many other day
to day applications
Including:
• Consumer electronics such as phones, computers, music systems
• Security and Monitoring systems such as burglar alarms, door alarm, etc.
• Home automation such as lighting your house by detecting whistle/clap instead of
physically turning the light switch
• Ambient sound recognition and sound level recognition.
28. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
27
3.11 IR Reciever
IR technology is used in daily life and also in industries for different purposes. For example, TVs use an IR sensor to
understand the signals which are transmitted from a remote control. The main benefits of IR sensors are low power usage,
their simple design & their convenient features. IR signals are not noticeable by the human eye. The IR radiation in the
electromagnetic spectrum can be found in the regions of the visible & microwave. Usually, the wavelengths of these waves
range from 0.7 μm 5 to 1000μm. The IR spectrum can be divided into three regions like near-infrared, mid, and far-
infrared. The near IR region’s wavelength ranges from 0.75 – 3μm, the mid-infrared region’s wavelength ranges from 3 to
6μm & the far IR region’s infrared radiation’s wavelength is higher than 6μm.
29. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
28
3.12 Reed Switch
What is Reed Switch ?
Reed switches are a special kind of electrical switch, actuated (turned on and
off or change over) by magnetism. The most common type features two
thin, flexible, ferromagnetic metal wires or blades - the reeds - positioned
slightly apart in a hermetically sealed glass bubble. These function as the
reed switch contacts. It should also be noted that the change-over type has
three reeds instead of two.
Uses of Reed Switch :
• Laptops and mobile phones - reed switches are often used in clamshell
designs and cases, allowing the device screen to power off when the lid
is closed
• Automatic doors with proximity sensors, as well as things like lights
connected to fridge doors
• Tamper-proofing systems like security alarms, functioning as
proximity sensors and triggering when the magnet moves away from
the switch on a window casing or doorjamb
• Measurement, flow rate and detection devices, such as anemometers to
measure wind speed
• Auto shut-off devices, such as fluid level sensors and thermal cut-offs
in dishwashers, washing machines and showers
• Safety features that prevent a device from powering on at all if, for
example, a lid or guard is not correctly in place (e.g. food processors,
power tools, etc)
• Automotive systems such as fluid gauges, automatic braking assists,
door sensors and speedometers
30. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
29
3.13 Limit Switch
Limit switches are used to automatically detect or sense the presence of an object or
to monitor and indicate whether the movement limits of that object have been
exceeded. The original use for limit switches, as implied by their name, was to
define the limit or endpoint over which an object could travel before being stopped.
It was at this point that the switch was engaged to control the limit of travel.
In most cases, a limit switch begins operating when a moving machine or a moving
component of a machine makes contact with an actuator or operating lever that
activates the switch. The limit switch then regulates the electrical circuit that
controls the machine and its moving parts. These switches can be used as pilot
devices for magnetic starter control circuits, allowing them to start, stop, slow
down, or accelerate the functions of an electric motor. Limit switches can be
installed into machinery as control instruments for standard operations or as
emergency devices to prevent machinery malfunction. Most switches are either
maintained contact or momentary contact models.
31. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
30
3.14 Push Button
A Push Button switch is a type of switch which consists of a simple
electric mechanism or air switch mechanism to turn something on or
off.
Depending on model they could operate with momentary or latching
action function.
The button itself is usually constructed of a strong durable material
such as metal or plastic. Push Button Switches come in a range of
shapes and sizes. We have a selection of push button switches here at
Herga.
Push button switches are used throughout industrial and medical
applications and are also recognisable in everyday life.
For uses within the Industrial sector, push buttons are often part of a
bigger system and are connected through a mechanical linkage. This
means that when a button is pressed it can cause another button to
release.
32. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
31
3.15 Tilt Sensor
A tilt sensor is an instrument that is used for measuring the tilt in multiple
axes of a reference plane. Tilt sensors measure the tilting position with
reference to gravity and are used in numerous applications. They enable the
easy detection of orientation or inclination. Similar to mercury switches,
they may also be known as tilt switches or rolling ball sensors.
A tilt sensor has a metallic ball that is designed to move the two pins of the
instrument from the 'on' to the 'off' position, and vice versa, if the sensor
reaches a pre-determined angle. Tilt sensors are the environment-friendly
version of a mercury-switch.
Applications of tilt sensor:
• To monitor the angle at which a mobile phone or tablet is held for the auto-rotate function
• To detect the position of hand-held game systems and in game controllers
• To indicate the roll of boats, vehicles and aircraft
• To measure the angle at which a satellite antenna 'looks' toward a satellite
• To estimate the height of a tree or building
• To measure the steepness of a ski slope
• To provide a warning system for the surface tilt angle of cryogenic liquids during transportation
• To monitor laser levels and seismic activity
33. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
32
3.16 Touch Sensor
A touch sensor is a type of device that captures and records physical touch or
embrace on a device and/or object. It enables a device or object to detect touch or
near proximity, typically by a human user or operator. Touch sensing input devices
offer numerous possibilities for novel interaction techniques and it reliably replaces
mechanical buttons and switches to eliminate mechanical wear and tear. These can
be configured into simple sliders, rotary wheels, or touch pads for intuitive user
interfaces.
A touch sensor primarily works when an object or individual gets in physical
contact with it. Touch sensors are also called as tactile sensors and are sensitive to
touch, force or pressure. It can be implemented using Capacitive or Resistive
sensing technology.
Capacitive touch screen technology is a popular and durable technology that is
used in a wide range of applications. Capacitive touchscreens are very clear,
offering up to 90 percent transparency. Due to its higher clarity than resistive
technology it is used in smartphones.
34. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
33
3.17 Vibration Sensor
A vibration sensor is a device that measures the amount and frequency of vibration in a given system,
machine, or piece of equipment. Those measurements can be used to detect imbalances or other issues in the
asset and predict future breakdowns.
Vibration sensors or vibration transducers can be used either directly mounted on the equipment or used
wirelessly to monitor the system. When it is placed in service, the sensors will start working and measure the
displacement, velocity, or acceleration of vibration depending on the types of vibration sensors used.
Applications of vibration sensor:
• Oil and gas
• Mining
• Aerospace
• Food and beverage
• Pulp and paper
• Refining, chemical, petrochemical, and other processing industry.
• Metalworking
• Automotive & Transportation
• Power generation
• Certain manufacturing industries
• Wind power and other renewable power
• Cement
• Research and Development
35. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
34
3.18. Experiment 18: Gyroscope
Gyroscope sensor is a device that can measure and maintain the orientation and angular
velocity of an object. These are more advanced than accelerometers. These can measure
the tilt and lateral orientation of the object whereas accelerometer can only measure the
linear motion.
Gyroscope sensors are also called as Angular Rate Sensor or Angular Velocity Sensors.
These sensors are installed in the applications where the orientation of the object is
difficult to sense by humans.
Measured in degrees per second, angular velocity is the change in the rotational angle of
the object per unit of time.
Besides sensing the angular velocity, Gyroscope sensors can also measure the motion of
the object. For more robust and accurate motion sensing, in consumer electronics
Gyroscope sensors are combined with Accelerometer sensors.
36. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
35
3.19 RGB LED
An RGB LED is basically an LED package that can produce almost any color. It can be used in different
applications such as outdoor decoration lighting, stage lighting designs, home decoration lighting, LED matrix
display, and more.
RGB LEDs have three internal LEDs (Red, Green, and Blue) that can be combined to produce almost any color
output. In order to produce different kinds of colors, we need to set the intensity of each internal LED and
combine the three color outputs. In this tutorial, we are going to use PWM to adjust the intensity of the red,
green, and blue LEDs individually and the trick here is that our eyes will see the combination of the colors, instead
of the individual colors because the LEDs are very close to each other inside.
37. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
36
3.20 Relay Module
Relay is one kind of electro-mechanical component that functions as a switch. The relay coil is energized by DC so that contact switches can be
opened or closed. A single channel 5V relay module generally includes a coil, and two contacts like normally open (NO) and normally
closed(NC).A 5v relay is an automatic switch that is commonly used in an automatic control circuit and to control a high-current using a low-
current signal. The input voltage of the relay signal ranges from 0 to 5V.The relay uses the current supply for opening or closing switch contacts.
Usually, this can be done through a coil to magnetize the switch contacts & drags them jointly once activated. A spring drives them separately
once the coil is not strengthened.By using this system, there are mainly two benefits, the first one is, the required current for activating the relay is
less as compared to the current used by relay contacts for switching. The other benefit is, both the contacts & the coil are isolated galvanically,
which means there is no electrical connection among them.
• Used in over voltage/under voltage protection system
• Mains Switching
• Speed control of motors through start-delta converters
• Automatic electrical appliances
• Electrical isolation in between high & low power sources
• Lights
• AC voltage load switching using less voltage DC
• Delivery of Isolated power
• Home automation projects
• Switching with High Current
Applications of Relay Module:
38. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
37
3.21 Piezo buzzer
Piezo buzzers are like tiny little speakers, but unlike speakers they don't require an amplifier or other complex circuitry to drive them
(consequently they aren't nearly as loud as a speaker and amplifier either!). When voltage is applied to the piezo it grows and shrinks in size,
and by changing the voltage over time you can make the piezo change shape fast enough to create a pressure wave that your ears interpret as
sound. One of the most widely used applications of piezo electricity is the production of sound generators, called piezo buzzers.
so
Microcontrollers can create sound by generating a PWM (Pulse Width Modulated) signal – a square wave signal, which is a sequence of logic
zeros and ones. Frequency of the square signal determines the pitch of the generated sound, and duty cycle of the signal can be used to
increase or decrease the volume in the range from 0% to 100% of the duty cycle. You can generate PWM signal using hardware capture-
compare module, which is usually available in most microcontrollers, or by writing a custom software which emulates the desired signal
waveform. Piezo buzzer’s resonant frequency (where you can expect its best performance) is 3.8kHz, but you can also use it to create sound in
the range between 2kHz and 4kHz.
Uses of Piezo Buzzer:
• alarms / warning devices / automobile alarms
• pest deterrents
• computer devices
• telephones
• toys / games
39. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
38
3.22 LCD
An LCD (Liquid Crystal Display) screen is an electronic display module and has a wide range of applications. A 16x2 LCD display is very
basic module and is very commonly used in various devices and circuits. A 16x2 LCD means it can display 16 characters per line and there
are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. The 16 x 2 intelligent alphanumeric dot matrix display is capable
of displaying 224 different characters and symbols. This LCD has two registers, namely, Command and Data.
Command registers stores various commands given to the display. Data register stores data to be displayed. The process of controlling the
display involves putting the data that form the image of what you want to display into the data registers, then putting instructions in the
instruction register.
40. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
39
3.23 Dust Sensor
Dust particle sensors, also known as dust sensors and PM2.5 sensors, can be used to detect
the concentration of dust in the air around us, known as PM2.5.PM2.5 fine particles have
small diameter, long suspension time in the atmosphere, long propagation distance, and
usually contain a large number of toxic and harmful substances, which have a great impact
on human health.PM2.5 can enter the lungs and blood.If it carries bacteria, it can do great
harm to the human body, including our respiratory system, cardiovascular system, and
even reproductive system.
Based on the scattering principle of light, the working principle of dust particle sensor was
developed.Particles and molecules scatter light when exposed to light.At the same time,
they absorb some of the energy of the light that hits them.When a parallel beam of
monochromatic light enters the field of the particle being measured, it will be affected by
the scattering and absorption around the particle, and the light intensity will be
weakened.In this way, the relative attenuation rate of the incident light passing through the
concentration field to be measured can be obtained.The relative attenuation rate can reflect
the relative concentration of dust in the area to be measured almost linearly.According to
the algorithm and calibration method, the dust concentration can be obtained by counting
the real-time particle number concentration.
Dust particle sensors are designed to sense dust particles in the air.For example, the
structure consists of the following parts, its inner diagonal Settings have infrared light-
emitting diode and the phototransistor, infrared light-emitting diodes and phototransistor
optical axis intersection, when the airflow through the intersection area of the optical axis
intersect with dust, dust reflected infrared light, phototransistor phototransistor can detect
the reflected light, the dirt in air even can detect very small particles, such as tobacco
smoke, receiving sensors detect the reflected light intensity, the reflected light intensity is
proportional to the dust concentration, the output signal, according to the output signal
intensity of dust concentration, through the output of different pulse width modulation
signal to distinguish,Thus, PM2.5 and PM10 can be measured.
42. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
41
3.25 Stepper Motor
A stepper motor is a type of brushless synchronous DC motor that, unlike many other standard
types of electric motors, doesn’t just rotate continuously for an arbitrary number of spins until the
DC voltage passing to it is shut off.
Instead, stepper motors are a type of digital input-output device for precision starting and stopping.
They’re constructed so that the current passing through it hits a series of coils arranged in phases,
which can be powered on and off in quick sequence. This allows the motor to turn through a
fraction of a rotation at a time - and these individual predetermined phases as what we refer to as
‘steps’.
A stepper motor is designed to break up a single full rotation into a number of much smaller (and
essentially equal) part-rotations. For practical purposes, these can be used to instruct the stepper
motor to move through set degrees or angles of rotation. The end result is that a stepper motor can
be used to transfer minutely accurate movements to mechanical parts that require a high degree of
precision.
Stepper motors are typically digitally controlled, and function as key components in an open-loop
motion-control positioning system. They’re most commonly used in holding or positioning
applications where their ability to assert much more clearly defined rotational positions, speeds and
torques make them ideally suited to tasks demanding extremely rigorous movement control.
43. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
42
3.26 Servo Motor
A servo motor is a type of motor that can rotate with great precision. Normally this type
of motor consists of a control circuit that provides feedback on the current position of
the motor shaft, this feedback allows the servo motors to rotate with great precision. If
you want to rotate an object at some specific angles or distance, then you use a servo
motor. It is just made up of a simple motor which runs through a servo mechanism. If
motor is powered by a DC power supply then it is called DC servo motor, and if it is AC-
powered motor then it is called AC servo motor. For this tutorial, we will be discussing
only about the DC servo motor working. Apart from these major classifications, there are
many other types of servo motors based on the type of gear arrangement and operating
characteristics. A servo motor usually comes with a gear arrangement that allows us to
get a very high torque servo motor in small and lightweight packages. Due to these
features, they are being used in many applications like toy car, RC helicopters and planes,
Robotics, etc.
Controlling Servo Motor :
Servo motor is controlled by PWM (Pulse with Modulation) which is provided by the
control wires. There is a minimum pulse, a maximum pulse and a repetition rate. Servo
motor can turn 90 degree from either direction form its neutral position. The servo
motor expects to see a pulse every 20 milliseconds (ms) and the length of the pulse will
determine how far the motor turns. For example, a 1.5ms pulse will make the motor turn
to the 90° position, such as if pulse is shorter than 1.5ms shaft moves to 0° and if it is
longer than 1.5ms than it will turn the servo to 180°.
Servo motor works on PWM (Pulse width modulation) principle, means its angle of
rotation is controlled by the duration of applied pulse to its Control PIN. Basically servo
motor is made up of DC motor which is controlled by a variable resistor (potentiometer)
and some gears. High speed force of DC motor is converted into torque by Gears. We
know that WORK= FORCE X DISTANCE, in DC motor Force is less and distance
(speed) is high and in Servo, force is High and distance is less. The potentiometer is
connected to the output shaft of the Servo, to calculate the angle and stop the DC motor
on the required angle.
44. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
43
3.27 DC-Motor
A DC motor or direct current motor is an electrical machine that transforms
electrical energy into mechanical energy by creating a magnetic field that is
powered by direct current. When a DC motor is powered, a magnetic field is
created in its stator. The field attracts and repels magnets on the rotor; this
causes the rotor to rotate. To keep the rotor continually rotating, the
commutator that is attached to brushes connected to the power source
supply current to the motors wire windings.
Types of DC-Motor:
• Brushed DC Motor
• Separately Excited DC Motor
• Permanent Magnet DC Motor
• Self Excited DC Motor
• Brushless DC Motor (BLDC)
Uses of Dc-Motor:
• Diesel Electric Locomotives
• Electric vehicles.
• Cranes
• Conveyor Systems
• Ceiling Fans
• Pump Drives
45. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
44
3.28 Joystick
Lots of robotic projects need a joystick. This module offers an affordable solution
to that. The Joystick module is similar to analog joysticks found in game pads. It is made
by mounting two potentiometers at a 90 degrees angle. The potentiometers are
connected to a short stick centered by springs.
This module produces an output of around 2.5V from X and Y when it is in
resting position. Moving the joystick will cause the output to vary from 0v to 5V
depending on its direction. If you connect this module to a microcontroller, you can
expect to read a value of around 512 in its resting position (expect small variations due
to tiny imprecisions of the springs and mechanism) When you move the joystick you
should see the values change from 0 to 1023 depending on its position.
47. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
46
3.30 Water Sensor
The Capacitive Soil Moisture Sensor Module determines the amount
of soil moisture by measuring changes in capacitance to determine the
water content of soil. This can be used in an automatic plant watering
system or to signal an alert of some type when a plant needs watering.
This soil moisture sensor module uses capacitance rather than
resistance to determine the water content of soil. The main down-
side to the common fork type resistance sensor is that the probes
inserted into the soil must be conductive bare metal and the small
electrical current that flows between them results in corrosion of the
probes through electrolysis over time.
The capacitive probe improves that situation because the sensor metal
inserted into the soil can be covered in solder resist to minimize
corrosion and electrical current is not flowing through the soil to
induce electrolysis. The main weakness in the lifespan of the probe is
the uncoated cut sides of the PCB which can absorb moisture over
time as well as the exposed electronics at the top of the probe if they
get splashed by water. The customer can add further protective
coating such as clear fingernail polish or similar coating if desired
without seriously affecting the performance of the probe.
48. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
47
3.31 IR Reflective
A line tracking sensor and it does exactly what the name suggests it
tracks black lines against white background or white lines against
black background whatever you would like to do and it’s a pretty
simple device. This sensor is also known as hunt sensor or line
following sensor. I just want to talk a little bit about what these things
can do and how they should be used with the Arduino. This sensor
consists of IR. This is basically obstacle sensing module having built-
in receiver and transmitter that senses the IR energy and looks for the
reflected IR energy to detect the obstacle in front of the sensor
module. The sensor returns the status of the IR light reflected from
the surface. So it’s a pretty simple device it has got an infrared
receiver and an infrared transmitter. So the transmitter is constantly
transmitting infrared pulses and the receiver is looking for those
pulses to receive when reflected. When this line tracking sensor is on
a black surface then all of the radiation that’s been transmitted gets
absorbed by the surface and nothing is reflected onto the sensor and
so we get a zero output signal and when it is on a white surface the
opposite happens all of the radiation that is transmitted off the
transmitter is being detected by the receiver and then we get a
positive signal or a digital one. There is a knob that you can use it
goes from one to three and you can use this to adjust the sensitivity of
the line tracking sensor. A line tracking sensor consists of three pins
in which one pin is ground, one is VCC and other pin is the output of
the sensor.
49. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
48
3.32 Laser Module
Laser is widely used in medical treatment, military, and other fields due to its
good directivity and energy concentration. The Laser Transmitter module, as the
name suggests, is one that can emit laser.
A laser is a device that emits light through a process of optical amplification
based on the stimulated emission of electromagnetic radiation. Lasers differ
from other sources of light because they emit light coherently.
Spatial coherence allows a laser to be focused to a tight spot, enabling
applications like laser cutting and lithography, and a laser beam to stay narrow
over long distances (collimation), enabling applications such as laser pointer.
Lasers can also have high temporal coherence which allows them to have a very
narrow spectrum, i.e., they only emit a single color of light. And its temporal
coherence can be used to produce pulses of light—as short as a femtosecond.
51. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
50
1. Microphones - Take your voice varying pressure waves in the air and convert them into varying electrical signals
2. Strain Gages - Determines the amount of strain (change in dimensions) when a stress is applied
3. Thermocouple – Temperature measuring device converts thermal energy to electric energy
4. Voltmeters
3.34 ADC Module
What is an ADC (Analog to Digital Converter)?
An analog to digital converter is a circuit that converts a continuous voltage value (analog) to a binary value (digital) that can be understood by
a digital device which could then be used for digital computation. These ADC circuits can be found as an individual ADC ICs by themselves or
embedded into a microcontroller. They’re called ADCs for short.
Why analog to digital converters?
The world around us is of an analog nature, but most processing is done in digital. Since most sensing is achieved through transducers, analog-
to-digital converters (ADCs) are needed to convert those analog values to digital form for processing and decision-making. ADCs will always
be needed to bridge between these two worlds. And with the new wave of Internet of Things (IoT) and processing at the edge, more computing
based on surroundings will be needed, increasing the usage of ADCs on those systems.
What are the applications of ADC:
• ADCs are usually virtually everywhere an analog signal has to processed, stored, or transported in digital form
• some examples of ADC usage are digital voltmeters, cellphone, thermocouple, and a digital oscilloscope
Examples of A/D Applications:
52. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
51
The ADS1115 provides 16-bit precision at 860 samples/second over I2C. The chip can be configured as 4 single-ended input channels,
or two differential channels. As a nice bonus, it even includes a programmable gain amplifier, up to x16, to help boost up smaller single/
differential signals to the full range. We like this ADC because it can run from 2V to 5V power/logic, can measure a large range of
signals and its super easy to use. It is a great general purpose 16-bit converter.
The chip's fairly small so it comes on a breakout board with ferrites to keep the AVDD and AGND quiet. Interfacing is done via I2C.
The address can be changed to one of four options (see the datasheet table 5) so you can have up to 4 ADS1115's connected on a single
2-wire I2C bus for 16 single ended inputs.
The Raspberry Pi computer does not have a way to read analog inputs. It's a digital-only computer. Compare this to
the Arduino, AVR or PIC microcontrollers that often have 6 or more analog inputs! Analog inputs are handy because
many sensors are analog outputs, so we need a way to make the Pi analog-friendly.
we use ADS1115 module. It's in the following picture;
71. 5.1 What is IOT ?
BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
68
The Internet of Things, or IoT, refers to the billions of physical
devices around the world that are now connected to the
internet, all collecting and sharing data. Thanks to the arrival of
super-cheap computer chips and the ubiquity of wireless
networks, it's possible to turn anything, from something as
small as a pill to something as big as an aeroplane, into a part of
the IoT. Connecting up all these different objects and adding
sensors to them adds a level of digital intelligence to devices
that would be otherwise dumb, enabling them to communicate
real-time data without involving a human being. The Internet of
Things is making the fabric of the world around us more smarter
and more responsive, merging the digital and physical
universes.
5.2 Applications of IOT
• Smart City
• Smart Home
• Smart Self-Driving Cars
• IoT in Farming
• Fitness Trackers
• IoT-Connected Factories
• IoT Hospitality and Tourism
• Retail IoT
• Smart Grid
• IoT Applications for Health Monitoring
72. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
69
5.3 Introduction to Node Red
Node-Red in its simplest form is an open source visual editor for wiring the internet of
things produced by IBM. What does this mean? Well for someone lazy like me it means
I can spend more time making stuff "talk" to each other than worrying about all of the
interfacing code I will need to write.
The system contains "Nodes" which look simply to be icons that you drag and drop on
to the canvas and wire together. Each Node offers different functionality which can
range from a simple debug node to be able to see what's going on in your flow, through
to a Raspberry Pi node which allows you to read and write to the GPIO pins of your Pi.
5.4 How to Setup Node Red on RaspberryPI
Run the Following commands in the teriminal :
1. sudo apt update
2. sudo apt upgrade
3. sudo apt install build-essential
4. bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
Now your node red is ready to run
93. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
90
5.8 Introduction to MQTT
MQTT (Message Queuing Telemetry Transport) is a publish/subscribe
messaging protocol that works on top of the TCP/IP protocol. The first
version of the protocol was developed by Andy Stanford-Clark of IBM
and Arlen Nipper of Cirrus Link in 1999. What makes MQTT faster than
say sending HTTP requests with your IoT device is MQTT messages can
be as small as 2 bytes, whereas HTTP requires headers which contains a
lot of information that other devices might not care about. Also, if you
have multiple devices waiting for a request with HTTP, you'll need to
send a POST action to each client. With MQTT, when a server receives
information from one client, it will automatically distribute that
information to each of the interested clients.
You Must know that :
• Broker : The broker is the server that distributes the information to the interested clients connected to the server.
• Client : The device that connects to broker to send or receive information.
• Topic : The name that the message is about. Clients publish, subscribe, or do both to a topic.
• Publish : Clients that send information to the broker to distribute to interested clients based on the topic name.
• Subscribe : Clients tell the broker which topic(s) they're interested in. When a client subscribes to a topic, any message
published to the broker is distributed to the subscribers of that topic. Clients can also unsubscribe to stop receiving
messages from the broker about that topic.
• QoS : Quality of Service. Each connection can specify a quality of service to the broker with an integer value ranging from
0-2. The QoS does not affect the handling of the TCP data transmissions, only between the MQTT clients. Note: In the
examples later on, we'll only be using QoS 0.
• 0 specifies at most once, or once and only once without requiring an acknowledgment of delivery. This is often
refered to as fire and forget.
• 1 specifies at least once. The message is sent multiple times until an acknowledgment is received, known otherwise
as acknowledged delivery.
• 2 specifies exactly once. The sender and receiver clients use a two level handshake to ensure only one copy of the
message is received, known as assured delivery.
94. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
91
5.9 How MQTT works
As mentioned in the introduction, MQTT is a publish/subcribe messaging protocol. Clients will connect to the network, which can
subscribe or publish to a topic. When a client publishes to a topic, the data is sent to the broker, which then is distributed to all the
clients that are subscribed to that topic.
Topics are arranged in a directory-like structure. A topic might be "LivingRoom", or "LivingRoom/Light" if you have multiple clients
within that parent topic. The subscriber client will listen for incoming messages from the subscribed topic and react to what was
published to that topic, such as "on" or "off". Clients can subscribe to one topic and publish to another as well. If the client
subscribes to "LivingRoom/Light", it might also want to publish to another topic like "LivingRoom/Light/State" so that other clients
can monitor the state of that light.
5.10 HIVE MQ Cloud
HiveMQ is a world-class, enterprise-ready MQTT broker that provides fast, efficient, and reliable movement of data to and
from connected IoT devices.
HiveMQ fully implements the MQTT protocol (the standard messaging and data exchange protocol for IoT).
Our broker is built from the ground up with maximum scalability and enterprise-grade security concepts in mind.
Through 100% compliance with the MQTT specification, HiveMQ is a worldwide leader in the professional adoption of all the
possibilities the Internet of Things has to offer. As a member of the OASIS committee, the HiveMQ team has been directly
involved in the creation and release of MQTT 5.0, the newest version of the MQTT protocol.
• You Must create account on HIVE MQ Cloud from this link https://www.hivemq.com/mqtt-cloud-broker/
• After Creating the account you Must save the credentials (username , password ,port and your cloud url) in
order to be used in your code.
Note:
95. BEDO
®
reserves
the
right
to
change
materials
or
modify
the
design
of
its
product
without
notification
as
part
of
the
company’s
continuing
product
improvement
program
www.bedoeg.com
92
5.11 Example :
Before starting the example let us state some notes:
• In our project the raspberry pi will act as Subscriber to (pi/control) topic.
• We will download app from playstore from this link (link)to act as publisher.
• The hivemq cloud credentials (username , password , port and cloud url ) must be saved in order to be used in the code
Now lets start our example:
1. Download the mobile app from the playstore
2. Open the APP then create Broker
• Enter the Brokers name (user choice).
• Enter Cloud URL (from hivemq cloud credentials ).
• Enter Port (from hivemq cloud credentials ).
• Enter your cloud username (from hivemq cloud credentials).
• Enter password (from hivemq cloud credentials).
• Click Save.
• Broker will be created.
106. +2 01067399357
Lot 47, 29 A Badr El-Deen Complex, 4
th
Industrial Zone, 6
th
of October City, Giza, Egypt Lot 36, 4
th
Industrial Zone,6
th
of
October City,Giza,Egypt
+2 (02)38335766
Marketing@bedoeg.com
+2 (02)38847045
www.bedoeg.com