Quantanics Report
Quantanics Report
Quantanics Report
AN INTERNSHIP REPORT
Submitted by
TAMILSELVAN G 731121105044
PAVISH S 731121105027
SIGNATURE SIGNATURE
iii
iv
v
ACKNOWLEDGEMENT
Last, but not the least, we take this opportunity to thank our family, classmates
and friends who offered an unconditional moral support during this internship.
vi
TABLE OF CONTENT
CHAPTER NO TITLE PAGE NO
LIST OF FIGURES vii
ABSTRACT x
1 IOT BASED ENERGY METER 11
1.1 ENERGY METER 11
1.2 MULTIFUNCTION METER 12
1.3 SMART METERS 12
1.3.1 COMPONENTS 12
1.3.2 ELITE 440 13
1.3.3 ARCHITECTURE OF IOT 13
1.4 PROTOCOLS 14
1.4.1 UART 14
1.4.2 I2C 15
1.4.3 SPI 16
1.5 MODBUS 18
1.6 MQTT 25
2 HACKATHON 27
2.1 INSTALLATION OF RASPBERRY 36
2.2 ADVANCED IP SCANNER 37
2.3 PUTTY 38
2.4 XAMPP 40
3 CONCLUSION 44
4 FEEDBACK 45
vii
LIST OF FIGURES
FIG. NO FIGURE NAME PAGE NO
1.1 OUTLINE OF THE INTERNET OF THINGS 11
1.3.1.1 ELITE 440 13
1.3.3.1 ARCHITECTURE OF IOT 13
1.5.1 MODBUS POLL 18
1.5.2 MODBUS INSTALLATION 19
1.5.3 MODBUS APPLICATION 19
1.5.4 MODBUS RETRIVAL MODBUS 20
1.5.5 MODBUS CONNECTIONS 20
1.5.6 MODBUS DATA SETUP 21
1.5.7 MODBUS DATA TRAFFIC 21
1.5.8 MODBUS FUNCTION CODE 22
1.5.9 MODBUS PARAMETERS 23
1.5.10 MODBUS ERRORS 24
1.6.1 MQTT SETUP 25
1.6.2 MQTT CLIENT 25
1.6.3 MQTT CONNECTION 26
2.1 ARDUINO 28
2.2 DHT11 SENSOR 29
2.3 CONNECTIONS DIAGRAM 30
2.4 ARDUINO SETUP 31
2.1.1 RASPBBERRY PI SETUP 36
2.1.2 RASPBERRY PI OS 36
2.2.1 ADVANCE IP SETUP 37
2.2.2 IP ADDRESS 38
2.3.1 PUTTY SETUP 38
2.3.2 PUTTY SCANNING 39
2.4.1 XAMPP DATA SHEET 40
viii
2.4.2 XAMPP TABLE 40
2.4.3 XAMPP OUTPUT 41
2.4.4 GRAFANA DATA FEED 42
2.4.5 GRAFANA DATABASE SELECTION 42
2.4.6 GRAFANA DATABASE SELECTION-2 43
2.4.7 GRAFANA OUTPUT GRAPH 43
ix
ABSTRACT
Over the past few years, IoT has become one of the most important
technologies of the 21st century. Now it connects everyday objects—kitchen
appliances, cars, thermostats, baby monitors—to the internet via embedded devices,
seamless communication is possible between people, processes, and things. By
means of low-cost computing, the cloud, big data, analytics, and mobile
technologies, physical things can share and collect data with minimal human
intervention. In this hyperconnected world, digital systems can record, monitor, and
adjust each interaction between connected things. The physical world meets the
digital world—and they cooperate. IoT applications use machine learning
algorithms to analyse massive amounts of connected sensor data in the cloud. Using
real-time IoT dashboards and alerts, it gains visibility into key performance
indicators, statistics for mean time between failures, and other information. Machine
learning–based algorithms can identify equipment anomalies and send alerts to users
and even trigger automated fixes or proactive counter measures. Hence the internet
of thing is useful to monitoring the live data in wireless from all over the world.
x
CHAPTER 1
WEEK 1-ACTIVITIES
IOT BASED ENERGY METER
1.1 ENERGY METER
An energy consumption meter or power meter is a device used to measure and monitor
the energy consumption of electrical application in a building (home or industry)
• It can measure active power (W), apparent power (VAR), voltage (V),
current(A) and power factor.
• It is ideal to say that a normal EB meter does not consist of COMPORT
(communication port).
A normal EB meter can only read lesser detailing compared to a multifunction meter. A
normal meter requires manual support to read data.
11
1.2 MULTIFUNCTION METER
A multifunction meter is an advanced version of the available power meter which can
give great detailing compared to the older one. It can measure Active power (Watts),
Reactive power (VAR), Apparent Power (VA), Voltage (Volts), Current (Amperes), power
Factor, Frequency (Hertz). In addition to reading data, multifunction meters consist of COM
ports which can be used to send data to a client using different protocols and hence doesn’t
need manual support for data measurement.
Smart meters are an extended version of the MFM, which facilitates two-way data
transmission it can both send and receive data through the presence of COM Port. For
example, when there is high power consumption the external software sends an alert signal
to the meter. Here the data transmission is done through MODBUS PROTOCOL which
transmits data from the smart meter to the raspberry for further processing.
1.3.1 COMPONENTS
A smart meter can be both AC or DC based on the requirements. ELITE 440 is the
smart meter used here.
12
The schematic diagram of the smart meter is given below:
The above image is elite 440 smart energy meter it will measure the voltage, current
and power, kWH etc... The above reading directly sent to MODBUS protocol to see the live
data using raspberry pi. This energy meter is generally used in the industrial application.
The above-mentioned elite 440 is a 3-phase meter. By using VNC viewer and putty we will
get the IP address of the raspberry pi connected to the elite 440.
13
1.4 PROTOCOLS
Peripheral device refers to an external hardware input or output device. These are the
major types of serial bus protocols.
• UART
• I2 C
• SPI
1.4.1 UART
UART stands for universal asynchronous receiver transmitter protocol. It is used for
serial communication between two devices.
• Rx
• Tx
• 5V
• Ground
• General purpose.
• Industrial purpose.
When a protocol is used for general purposes like household purpose data loss is not given
much importance, it is not a closed loop (i.e.) there is no feedback to ensure there is
successful transmission of data. And the distance of transmission is comparatively low.
But an industrial application protocol cannot encourage data loss and has to operate
over long distances. Hence, it has to be closed loop to ensure feedback message has been
received.
14
MAJOR INFORMATIONS FOR A UART:
1. Baud rate:
The number of bits transmitted or received per second. It is usually 9600.
2. Start bit:
It is usually 7 or 8. Out of these 7 or 8 bits the last bit acts as the Cyclic redundancy
check or error bit. Which shows the end of data.
3. Parity bit:
Parity bit is used for error checking purposes by detecting error in the transmitted
data. It can be of three types:
• Even parity.
• Odd parity.
• None parity.
4. Stop bit:
It can be 1.5 or 1 or 2.
It is usually a 1 stop bit for RS-485 and 2 stop bits for RS-232.
RS-232 is also a type of MODBUS protocol in which the slave sends data without the master
requesting for data. Hence, there is much data loss in a RS-232 Modbus protocol.
1.4.2 I2C
Here SDA stand for serial data which transfers data and SCL stands for serial clock which
carries out the clock signal. These kinds of I2C compatible devices are found in embedded
systems that include EEPROMS.
I2C is a serial bus protocol it can transmit ‘n’ amount of data. It has minimal data loss as it
times the data transmission using a clock. The clock decides the amount of time through
15
which data has to be transmitted hence the receiver waits until the complete transmission of
data which helps in minimizing data loss.
SPI stands for serial peripheral interface. SPI is a synchronous serial communication
interface commonly used for short distance communication between microcontrollers,
sensors, and other peripheral devices. The SPI communication protocol allows data to be
simultaneously transmitted and received.
16
SPI (Serial Peripheral Interface)
17
1.5 MODBUS
• MODBUS RTU
• MODBUS TCP/IP
MODBUS POLL:
Installation process:
18
FIG 1.5.2: MODBUS INSTALLATION
19
FIG 1.5.4: MODBUS RETRIVAL MODBUS
20
FIG 1.5.6: MODNUS DATA SETUP
21
In the above data of “Tx”-03 represents the register used to retrieve data. From the
specification of ELITE 440 here read holding register is used. The below table gives
reference to the different register in RS-485 MODBUS and their representative number.
In the next set of data in “Tx”-00 0A represents the number of data requested and the last
set of data represent error checking pair. In the response line of the slave:
The first data “03” represent the register type, the next pair of data represents the
number of bits to be reported and then each pair of consecutive data represents the output of
each corresponding description for the given offset MODBUS register number.
22
FIG 1.5.9: MODBUS PARAMETERS
23
In the next set of data in “Tx”-00 0A represents the number of data requested and the last
set of data represent error checking pair. In the response line of the slave:
The first data “03” represent the register type, the next pair of data represents the
number of bits to be reported and then each pair of consecutive data represents the output of
each corresponding description for the given offset MODBUS register number.
24
1.6 MQTT (Message Queueing Telemetry Transmission)
25
FIG 1.6.3: MQTT CONNECTION
26
CHAPTER 2
WEEK 2-ACTIVITIES
HACKATHON
Components used:
• DHT11 sensor
• Arduino UNO
Software’s used:
• Arduino IDE
• Xampp server
• Grafana
Arduino UNO:
27
Layout and production files for some versions of the hardware are also available.
The word "uno" means "one" in Italian and was chosen to mark a major redesign of the
Arduino hardware and software. The Uno board was the successor of the Duemilanove
release and was the 9th version in a series of USB-based Arduino boards. Version 1.0 of the
Arduino IDE for the Arduino Uno board has now evolved to newer releases. The
ATmega328 on the board comes pre-programmed with a bootloader that allows uploading
new code to it without the use of an external hardware programmer.
While the Uno communicates using the original STK500 protocol, it differs from all
preceding boards in that it does not use a FTDI USB-to-UART serial chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial converter.
28
DHT11 sensor:
This is a calibrated digital temperature and humidity module with onboard sensor
DHT11. It can be used for detecting ambient temperature and humidity, through the standard
single-wire interface.
• Sensor: DHT11
• Working Voltage: 3.3V-5.5V
• Temperature
o Resolution: 1°C
o Accuracy: ±2℃
o Measuring range: 0°C ~ 50°C
• Humidity
o Resolution: 1%RH
o Accuracy: ±5%RH (0~50°C)
o Measuring range: 20%RH ~ 90%RH (25°C)
29
• Fixed Hole Size: 2.0mm
Connection:
Arduino IDE:
The Arduino IDE is an open-source software, which is used to write and upload
code to the Arduino boards. The IDE application is suitable for different operating systems
such as Windows, Mac OS X, and Linux. It supports the programming languages C and
C++. Here, IDE stands for Integrated Development Environment.
The program or code written in the Arduino IDE is often called sketching. We need to
connect the Genuino and Arduino board with the IDE to upload the sketch written in the
Arduino IDE software. The sketch is saved with the extension '.ino.'
The Upload button compiles and runs our code written on the screen. It further
uploads the code to the connected board. Before uploading the sketch, we need to make sure
that the correct board and ports are selected.
We also need a USB connection to connect the board and the computer. Once all the
above measures are done, click on the Upload button present on the toolbar. The latest
Arduino boards can be reset automatically before beginning with Upload. In the older
30
boards, we needed to press the Reset button present on it. As soon as the uploading is done
successfully, we can notice the blink of the Tx and Rx LED.
#include <dht11.h>
#define DHTPIN 8
dht11 DHT11;
int x;
int t;
void setup() {
Serial.begin(115200);
void loop() {
x = DHT11.read(DHTPIN);
31
t = millis();
Serial.println(data);
delay(1000);
*After upload this program open the serial monitor and select the baud rate it shows the
output.
Xampp server:
32
PROCEDURE:
*Open the Xampp application, turn on the Apache and MySQL then click Admin.
*Enter the Table name and select the no. of table then click create.
*After entering all the parameters click GO and the Xampp file is created.
PYTHON:
import serial
import MySQL.connector
def insert_data(mydata):
mydb = mysql.connector.connect(
host="localhost",
user="root",
password="",
database="mq6"
my_arr = mydata.split(',')
33
mycursor = mydb.cursor()
mycursor.execute(sql)
mydb.commit()
print("insertion success")
while True:
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS)
line = (myser.readline())
data = line.decode('utf-8')
print(data)
insert_data(data)
myser.close()
Grafana:
34
is stored, whether that’s traditional server environments, Kubernetes clusters, or various
cloud services, etc.
You’re then more easily able to analyse the data, identify trends and inconsistencies,
and ultimately make your processes more efficient. Grafana was built on open principles
and the belief that data should be accessible throughout an organisation, not just to a small
handful of people. This fosters a culture where data can be easily found and used by anyone
who needs it, empowering teams to be more open, innovative, and collaborative.
Grafana’s dashboards give a new level of meaning to data collected from various sources.
Those dashboards can then be shared with other team members and other teams, allowing
collaboration and more extensive exploration of the data and its implications. Build
dashboards specifically for you and your team and customise your panels to create the
visualisations you want, using advanced querying and transformation capabilities.
PROCEDURE:
35
2.1 INSTALLATION OF RASPBERRY PI
Search raspberry pi imager in browser
Choose an OS with desktop environment so that viewing it becomes easier. Choose the
settings options below to get the advanced options:
1. Enable SSH.
2. Enter password.
3. Enter host name.
36
Choose the storage where the SD card has been fitted in the system and click write data.
This writes all the data to SD card.
Advanced IP scanner is used to find the IP address of the raspberry we are using. It
scans all the devices connected to a network.
Steps:
Enter the IP address range 192.168.29.1-247 and enter scan. The list of all IP address
connected to the particular network will list down below. In the select and copy the IP
address of our raspberry pi. Find your IP address by using command prompt by entering IP
config.
37
FIG 2.2.2: IP ADDRESS
2.3 PUTTY
Putty is a free open-source application. It used file transfer protocol. PUTTY can
connect to a remote machine through SSH. SSH (secure shell) is a protocol that allows a
secure connection. In this way, a PC can securely send and receive data from a remote.
38
Install the application from the web browser and open it. After that enter the host name enter
the IP address of our raspberry pi obtain from the “Advanced IP Scanner” app.
DATABASE:
A database is a structured collection of data where the data can be modified and stored
in way which is suitable for visualization, retrieval, updating and analyzation. A database
system consists of 2 main components: a DBMS and actual database. They are organized
into table which are rows and columns. We have MySQL database to store data in the form
of tables, mangrove DB database to store in file format and JSON or CSV database to store
data in JSON format.
39
2.4 Xampp
40
FIG 2.4.3: XAMPP OUTPUT
PYTHON IDLE:
GRAFANA:
Grafana is an online open-source data visualization tool used to visualize data from
various source data visualization tool used to visualize data from various source in a
graphical format. We Grafana here to graphically represent the data from the smart meter
which is stored in the MySQL database. By creating a new panel and importing the database
and the table name and by specifying the value that we need to represent in our visualized
chart we can visualize it.
41
VISUALIZATION:
• Open Grafana.
• Open the new dashboard and select the new panel.
• Select the database and table and columns.
• All setups finished to click to run the query.
• The panel click to zoom in data visual the data.
42
FIG 2.4.6: GRAFANA DATABASE SELECTION-2
43
CHAPTER 3
CONCLUSION
This internship experience in the real time of Industrial Internet of Things (IoT) has
been a profound journey of professional and personal growth. Throughout the duration of
this internship, privilege of working alongside a dedicated team of experts in the field,
allowing to gain invaluable insights into the intricate workings of IoT technologies and their
applications within the industrial sector.
44
CHAPTER 4
FEEDBACK
2. What did you learn and how did it help you develop your skills and knowledge?
The core concepts of the IoT and the hardware implementation was taught. It helps
improve in both hardware and software in the domain of IoT.
3. What were your biggest task and how did you overcome that?
The hackathons were the biggest task and challenge to face and complete the program.
Most of the time was spent in the learning process but still the hackathon part was the
craziest part of the internship.
4. How did the internship prepare you for your future career?
Apart from the skill and core knowledge, to collaborate with the people who are new
has given immense inspirations. Single heartedly the hackathons were solved. This
will help to connect and develop the network in our future.
5. What do you feel about your mentors in the internship and how the internship
differs from your college procedure of learning?
The amount of knowledge and skills that gained from the mentor in the internship
was good. This internship helped a lot to gain new experience and gave the clear-cut
idea for the future career.
45