CS3691 Emb & Iot Manual PDF
CS3691 Emb & Iot Manual PDF
8051 Assmebly
1
LanguageExperiments
Using Keil
Software
Data Transfer
2
BetweenRegisters
And Memory
3 Perform Alu Operations
BinaryArithmetic
4A.
ProgramsUsing Embedded
C
Binary Arithmetic
4B ProgramsUsing Embedded
C
Introduction to Arduino
5 platform and
programming
Interfacing Arduino
6 toZigbeemodule
AIM:
To perform the following operation using assembly language in keil ide.
Sum of n number
Addition of two arrays
Multiplication of 2 2-type number.
SOFTWARE REQUIREMENTS
Keil µvision 4
STEP 2: Select “New µvision Project” from project in the menu bar.
STEP 3: Browse and create a new project in the required location.
STEP 4: Select the target device(here,LPC1768 from NXP) from the list or type the exact name of the
device.Press OK.
STEP 5: Copy start up to Project folder and add to project file”?- Press NO.
STEP 6: In the project window, right click on source and select Add new item to group “source group 1”
STEP 7: Select Asm file and give name of the file with .s extension and press ADD.
STEP 10: Check for errors and warnings in the bottom window.
STEP 11: If no error,Select “Build” icon from tool bar or from menu bar.
STEP 14: Press function key F11 or select “step” option under Debug menu for single step
executionand verify the output inregister window/Memory window/xPSR.
1. SUM OF N NUMBERS:
ALGORITHM:
ASSEMBLY CODE:
ORG 000H
MOV A,#00H
MOV R0,#40H
MOV R1,#05
INC R0
DJNZ R1,LABEL
MOV R2,A
END
INPUT:
I40:01 I41:02 I42:03
I43:04 I44:05
OUTPUT:
R2:0F
2. ADDITION OF TWO ARRAYS:
ALGORITHM:
ASSEMBLY CODE:
ORG 000H
MOV RO,#50H
MOV R1,#60H
MOV R2,#05
ADD A,@R0
MOV @R0,A
INC R0
INC R1
DJNZ R2,LABEL
END
INPUT
I63:04 I64:05
OUTPUT:
ALGORITHM:
ORG 000H
MOV R1,#3fH
MOV R2,#23H
MOV R3,#11h
MOV R4,#2fH
B,R4 MUL AB
MOV
R0,#40HMOV
@R0,A INC R0
MOV @R0,B
MOV A,R4
MOV B,R1
MUL AB ADD
A,@R0 MOV
@R0,A INC R0
MOV
@R0,BMOV
A,R2 MOV
B,R3 MUL AB
DEC R0 ADD
A,@R0 MOV
@R0,AINC R0
,@R0 MOV
@R0,A MOV
A,R2 MOV
B,R1 MUL AB
ADD A,@R0
MOV @R0,A
MOV A,B
ADDC A,#00H
INC R0 MOV
@R0,AEND
OUTPUT:
I43:08VALUE: 08AAE71F
RESULT:
Simple operation using assembly language in KEIL IDE is executed
successfully.
EX.NO:02 DATA TRANSFER BETWEEN REGISTERS AND MEMORY
DATE:
AIM:
In this program explain about how to test data transfer between registers and
memory
SOFTWARE REQUIREMENTS
Keil µvision 4
PROCEDURE:
STEP 1: Double click on µvision 4 icon in the desktop.
STEP 2: Select “New µvision Project” from project in the menu bar.
STEP 3: Browse and create a new project in the required location
STEP 4: Select the target device(here,LPC1768 from NXP) from the list or type the
exact nameof the device. Press OK.
STEP 5: Copy start up to Project folder and add to project file”?- Press NO.
STEP 6: In the project window, right click on source and select Add new item to
group“source group1”
STEP 7: Select Asm file and give name of the file with .s extension and press ADD.
STEP 8: Type the program in the editor space and save.
STEP 9: Translate the program by select the icon from tool bar or from
menu bar.STEP 9: Translate the program by select the icon from tool bar
or from menu bar.STEP 10: Check for errors and warnings in the bottom
window.
STEP 11: If no error,Select “Build” icon from tool bar or from menu bar.
STEP 12: Start the debug session from Menu bar.
STEP 13: Press OK
STEP 14: Press function key F11 or select “step” option under Debug menu for single step
execution and verify the output inregister window/Memory window/xPSR.
CODING:
Result:
INPUT: 00000011h,00000022h,00000033h,00000044h,00000055h.
OUTPUT at dst :
00000011h,00000022h,00000033h,00000044h,00000055h.
RESULT:
AIM:
To perform the addition, subtraction, multiplication of two 16-bit numbers and to
performlogical operations AND, OR, XOR on two eight bit numbers using keil ide.
SOFTWARE REQUIREMENTS
Keil µvision 4
PROCEDURE:
STEP 1: Double click on µvision 4 icon in the desktop.
STEP 2: Select “New µvision Project” from project in the menu bar.
STEP 3: Browse and create a new project in the required location
STEP 4: Select the target device(here,LPC1768 from NXP) from the list or type the
exactname of the device. Press OK.
STEP 5: Copy start up to Project folder and add to project file”?- Press NO.
STEP 6: In the project window, right click on source and select Add new item to
group“source group1”
STEP 7: Select Asm file and give name of the file with .s extension and press ADD.
STEP 8: Type the program in the editor space and save.
STEP 9: Translate the program by select the icon from tool bar or from
menu bar.STEP 9: Translate the program by select the icon from tool bar
or from menu bar.STEP 10: Check for errors and warnings in the bottom
window.
STEP 11: If no error,Select “Build” icon from tool bar or from menu bar.
STEP 12: Start the debug session from Menu bar.
STEP 13: Press OK
STEP 14: Press function key F11 or select “step” option under Debug menu for single
stepexecution and verify the output inregister window/Memory window/xPSR.
Result:
Input: Output:
SUBTRACTION OFTWO 16-BIT NUMBERS.
Result:
Note: Try with different data. Ex: (Smaller number) – (larger number).
mov r0,#34h
/5678*1234mov r1,#12h
mov
r2,#78hmo
v
r3,#56hmo
va,r0 mov
b,r2 mul ab
mov
33h,amov
r4,b mov
a,r0 mov
b,r3 mul
ab
add a,r4
mov r5,a
mov a,b
addc
a,#00hmo
vr6,a mov
a,r1 mov
b,r2 mul
abadd a,r5
mov
32h,a
mov a,b
addc
a,r6 mov
00h,cmo
vr7,a
mov a,r3
mov b,r1
mul ab
add a,r7
mov
31h,amo
va,b
addc
a,20hmo
v
30h,aend
Result:
Note: Write the logic of the program. Try with some other logic.
Result:
Before Execution: D: 21H = 22H =
SOFTWARE REQUIREMENTS
Keil µvision 4
PROCEDURE:
STEP 1: Double click on µvision 4 icon in the desktop.
STEP 2: Select “New µvision Project” from project in the menu bar.
STEP 3: Browse and create a new project in the required location
STEP 4: Select the target device(here,LPC1768 from NXP) from the list or type the
exact nameof the device. Press OK.
STEP 5: Copy start up to Project folder and add to project file”?- Press NO.
STEP 6: In the project window, right click on source and select Add new item to
group“source group1”
STEP 7: Select Asm file and give name of the file with .s extension and press ADD.
STEP 8: Type the program in the editor space and save.
STEP 9: Translate the program by select the icon from tool bar or from
menu bar.STEP 9: Translate the program by select the icon from tool bar
or from menu bar.STEP 10: Check for errors and warnings in the bottom
window.
STEP 11: If no error,Select “Build” icon from tool bar or from menu bar.
STEP 12: Start the debug session from Menu bar.
STEP 13: Press OK
STEP 14: Press function key F11 or select “step” option under Debug menu for single step
execution and verify the output inregister window/Memory window/xPSR.
THEORY :
Arithmetic Operators are the type of operators in C that are used to
perform
mathematical operations in a C program. They can be used in programs to define
expressions and mathematical formulas. The C arithmetic operators are the symbols that
are used to perform mathematical operations on operands. There are a total of 9
arithmetic operators in C to provide the basic arithmetic operations such as addition,
subtraction, multiplication, etc.
CODING:
C
// C program to demonstrate syntax of binary arithmetic
// operators
#include
<stdio.h>
int main()
{
int a = 10, b = 4, res;
// printing a and b
printf("a is %d and b is %d\n", a, b);
res = a + b; // addition
printf("a + b is %d\n",
res);
res = a - b; //
subtraction printf("a - b
is %d\n", res);
res = a * b; //
multiplicationprintf("a * b
is %d\n", res);
res = a / b; // division
printf("a / b is %d\n",
res);
res = a % b; // modulus
Output
a is 10 and b is
4a + b is 14
a - b is 6
a * b is
40a / b is
a % b is 2
Result:
AIM:
To write a program in basic arithmetic programs using embedded C.
SOFTWARE REQUIREMENTS
Keil µvision 4
PROCEDURE:
STEP 1: Double click on µvision 4 icon in the desktop.
STEP 2: Select “New µvision Project” from project in the menu bar.
STEP 3: Browse and create a new project in the required location
STEP 4: Select the target device(here,LPC1768 from NXP) from the list or type the
exact nameof the device. Press OK.
STEP 5: Copy start up to Project folder and add to project file”?- Press NO.
STEP 6: In the project window, right click on source and select Add new item to
group“source group1”
STEP 7: Select Asm file and give name of the file with .s extension and press ADD.
STEP 8: Type the program in the editor space and save.
STEP 9: Translate the program by select the icon from tool bar or from
menu bar.STEP 9: Translate the program by select the icon from tool bar
or from menu bar.STEP 10: Check for errors and warnings in the bottom
window.
STEP 11: If no error,Select “Build” icon from tool bar or from menu bar.
STEP 12: Start the debug session from Menu bar.
STEP 13: Press OK
STEP 14: Press function key F11 or select “step” option under Debug menu for single step
execution and verify the output inregister window/Memory window/xPSR.
THEORY
2. Post Increment
When it is placed after the variable name (also called post-increment operator), its
value ispreserved temporarily until the execution of this statement and it gets updated
before the execution of the next statement. For example: a = x++;
It can be expanded
toa = x;
x = x + 1;
Decrement Operator in C
The ‘–‘ operator is used to decrement the value of an integer. Just like the
incrementoperator, the decrement operator can also be used in two ways:
1. Pre-Decrement
When placed before the variable name (also called the pre-decrement operator),
its valueis decremented instantly. For example, – – x.
2. Post Decrement
When it is placed after the variable name (also called post-decrement operator),
its valueis preserved temporarily until the execution of this statement and it gets updated
before the execution of the next statement. For example, x – –.
C
// C program to demonstrate working
// of Unary arithmetic
// operators #include
<stdio.h>intmain()
{
inta = 10, b = 4, res;
printf("Post Increment and Decrement\n");
// post-increment example:
// res is assigned 10 only, a is not updated yetres = a++;
printf("a is %d and result is %d\n", a,res); // a
becomes 11 now
// post-decrement example:
// res is assigned 11 only, a is not updated yetres = a--;
printf("a is %d and result is %d\n", a,res); // a
becomes 10 now
return0;
}
Output
Post Increment and
Decrementa is 11 and result
is 10
a is 10 and result is 11
Result:
AIM:
In this program explain about how to develop an embedded application using arduino.
SOFTWARE REQUIREMENTS
Arduino IDE software
HARDWARE REQUIREMENTS
Arduino UNO
Breadboard
Jumper wires
Resistor
LED lights
USB cable
PROCEDURE:
STEP 1: Download and install Arduino IDE software
STEP 2: Connect arduino UNO to
breadboardPin 6 35
Pin 7 40
Pin 8 45
STEP 3: 3 Resistor are connected in
breadboard3 LED lights are connected in
breadboard STEP 4: Write a program
STEP 5: Debug the program. You will see all LED lights are on
CODING:
RESULT:
Successfully installed arduino IDE software and we will see all LED lights are on.
EX.NO:06 Interfacing Arduino to Zigbee module
DATE:
AIM:
To write a program in interface XBee module with Arduino Uno board.
HARDWARE REQUIREMENTS
1 x Arduino Uno
2 x XBee Pro S2C modules (any other model can be used)
1 x Xbee explorer board (optional)
1 x Xbee Breakout board (optional)
USB cables
LEDs
SOFTWARE REQUIREMENTS
Arduino IDE
XCTUSoftware
PROCEDURE:
Connections:
Step 1:- Now, click on the search button. This will show you all the RF devices
connectedwith your laptop. In our case, it will show only one XBee module.
Step 2:- Select the Serial port of the Explorer board/Arduino board and click on Next.
Step 3:- In the next window, set the USB port parameters as shown below and click on
Finish.
Step 4:- Select the Discovered device and click on Add selected device. This process
will addyour XBee module to XCTU dashboard.
Step 5:- Now, you can configure your XBee module in this window. Use either AT commands
or putthe data manually. As you can see, there is R showing on the left panel which means
Xbee is in router mode. We have to make it Coordinator for the transmitter part.
First, update the Firmware by clicking on the Update firmware
.
Step 6:- Choose the Product family of your device which is available on back of XBee
module.Select function set and firmware version as highlighted below and click on
Update.
Step 7:- Now, you have to give ID, MY and DL data to make connection with other
XBee. ID remain same for both the modules. Only MY and DL data interchange i.e.
MY for the receiver XBee becomes DL of the transmitter XBee (coordinator) and DL
for the receiver XBee becomes MY of the transmitter XBee. Make CE as
Coordinator and then hit the Write button. As shown below.
Step 8:- After writing the above data to the transmitter part, plug out it from the
explorer board and plug it in the second XBee module. Repeat the same process as
above only changes are the DL, MY, and CE. As we will make the second XBee as End
device so in CE drop down menu, select the End device and hit the Write button.
Step 9:- Now, our XBee modules are ready to interface with the Arduino board.
We will connect the transmitter XBee to the laptop and receiver XBee with the
Arduino board. Then give commands to the receiver part using laptop.
PROGRAM:
Output:
RESULT:
Successfully write a program in interface XBee module with Arduino Uno board.
EX.NO:07 Interfacing Arduino to GSM module
DATE:
AIM
To write a program in interface arduino to GSM module.
HARDWARE REQUIREMENTS
Arduino UNO
2G SIM
12V Power supply
900 GSM module
Jumper wires
SOFTWARE REQUIREMENTS
Arduino IDE
PROCEDURE:
PROGRAM
Result
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
Arduino IDE
PROCEDURE
Step 1: Connection
Output
Result
AIM:
To write a program to implement LED blinking application using
Raspberry Pi.
HARDWARE REQUIREMENTS:
Raspberry Pi 3 Model B
5mm LED x 1
1KΩ Resistor (1/4 Watt) x 1
Mini Breadboard x 1
Connecting wires
Miscellaneous (Computer, Ethernet cable, Power Supply for Raspberry Pi etc.)
SOFTWARE REQUIREMENTS:
Vim Editor(Command Line Editor) Login in to your Raspberry Pi using SSH
PROCEDURE:
Step 1: Connect the LED to the Raspberry Pi.
Step 2: Anode of the LED is connected to the 3.3V supply pin of the Raspberry Pi
throughthe1KΩ resistor.
Step 3: The cathode of the LED is connected to GPIO25 (Physical Pin 22).
Step 4: To install the Vim Editor (by default, Raspbian has Vi editor and to get full
featuresofVim)
Step 5: Enter the following code in the SSH Terminal
sudo apt-get install vim
Step 6: Now open a blank Python file using Vim editor with the file name being
blinkLed.py. Step 7: Use the following command
sudo vim blinkLed.py
Step 8: Save the blinkLed.py file and close the Vim Editor. To check the code, use the
following command in the SSH Terminal (Putty).
sudo python blinkLed.py
Step 9: Finally LED should blink at an interval of 1 second
CODING:
#!/usr/bin/env python
import RPi.GPIO as GPIO # RPi.GPIO can be referred as GPIO from nowimport
timeledPin = 22 # pin22def setup():
GPIO.setmode(GPIO.BOARD) # GPIO Numbering of Pins GPIO.setup(ledPin, GPIO.OUT)
#Set ledPin as output GPIO.output(ledPin, GPIO.LOW) # Set ledPin to LOW to turn Off
the LED
def loop():
while True:
print 'LED on'
GPIO.output(ledPin, GPIO.HIGH) # LED Ontime.sleep(1.0) # wait 1
secprint 'LED off'
GPIO.output(ledPin, GPIO.LOW) # LED Offtime.sleep(1.0) # wait 1 sec
def endprogram():
GPIO.output(ledPin, GPIO.LOW) # LED OffGPIO.cleanup() # Release
resourcesif name== ' main ':# Program starts from
heresetup()
try:
loop()
except KeyboardInterrupt: # When 'Ctrl+C' is pressed, the destroy() will be
executed.endprogram()
OUTPUT:
RESULT:
Successfully implemented LED blinking application using Raspberry Pi.
EX.NO:10 Interfacing sensors to Raspberry PI
DATE:
AIM:
To write a program how to interface IR sensor with Raspberry Pi.
HARDWARE REQUIREMENTS
Raspberry Pi
Breadboard
IR sensor
Jumper wires
SOFTWARE REQUIREMENTS
Raspberry pi VNC viewer
PROCEDURE
Step 1: To place the IR sensor in to breadboard
Step 2: IR sensor Raspberry PiOUT
pin 8GNDpin 39
VCCpin 2
Step 3:To connect Raspberry pi and system Step 4: Write a program and run the script
Step 5:
You will see the output in shell monitor
PROGRAM
Output
RESULT
Successfully implement to IR sensor with Raspberry pi
EX.NO:11 Communicate between Arduino and Raspberry PI using any wireless
DATE: medium
AIM:
To Write a program to wireless Communication between Arduino & Raspberry
Pi usingLoRa Module SX1278.
HARDWARE REQUIREMENTS:
Raspberry Pi 4
Arduino Uno
SX1278 433MHz LoRa Transmitter- Receiver Module
DHT11
SOFTWARE REQUIREMENTS:
Cayene IoT platform Raspberry pi
PROCEDURE:
3.3V 3.3V
GND GND
NSS D10
DIO0 D2
SCK D13
MISO D12
MOSI D11
RST D9
VCC 3.3V
GND GND
DATA A0
Step 2: Connect Raspberry pi and Module
3.3V 3.3V
Ground Ground
GPIO 10 MOSI
GPIO 9 MISO
GPIO 11 SCK
GPIO 4 DIO 0
GPIO 17 DIO 1
GPIO 18 DIO 2
GPIO 27 DIO 3
GPIO 22 RST
Step 6: Upload the Arduino code to the Arduino board and launch the python code in Pi.
Step 7: You should see the temperature and humidity values received in pi though
the shellwindow.
PROGRAM:
Arduino Code:
#include <SPI.h> #include <RH_RF95.h>#include "DHT.h"
#define DHTPIN A0 // what pin we're connected to#define DHTTYPE DHT11 // DHT
typeDHT dht(DHTPIN, DHTTYPE);
int hum; //Stores humidity value int temp; //Stores temperature valueRH_RF95
rf95;void setup()
{
Serial.begin(9600);dht.begin();
if (!rf95.init()) Serial.println("init failed");
// Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4/5, Sf =
128chips/symbol,CRC on
}
void loop()
{
temp = dht.readTemperature();hum = dht.readHumidity();
String humidity = String(hum); //int to StringString temperature =
String(temp);String data = temperature + humidity;Serial.print(data);
char d[5];
data.toCharArray(d, 5); //String to char arraySerial.println("Sending to
rf95_server");rf95.send(d, sizeof(d)); rf95.waitPacketSent();
delay(400);
}
Output:
Result:
Software Requirements:
Google cloud platform
Procedure:
Step 4: Click the name of the service account to open the settings. Then click “KEYS”
=>“ADD
(base) $conda create --name gcp_logging python=3.10
KEY” => “Create new key” => “JSON” to create a
(base) $ conda activate gcp_logging
key.
(gcp_logging) $ pip install -U google-cloud-logging
(gcp_logging) $ pip install ipython
Step 6: To check Logs Explorer
Step 7: the following query expressions will all find our log:
# No equal sign or colon:
"This is a warning!"# With equal sign: jsonPayload.message = "This is a warning!"#
Withcolon:
jsonPayload.message : "This is"# A more explict one with logical
operators:jsonPayload.message = "This is a warning!"
logName: "python"
Step 8: use the log_structmethod:
json_payload = {"message": "This is a warning from
'python_application_name'!"} logger.log_struct(json_payload,
severity=severity.WARNING)
Program:
*setup_logging*
import logging
import google.cloud.logging
client = google.cloud.logging.Client()
# Alternatively, but not recommended. It's helpful when you can't set an
environmentvariable. service_key_path = "/home/lynn/Downloads/temp-project-for-
logging-ff33f97cf72f.json"client
= google.cloud.logging.Client.from_service_account_json(service_key_path)
client.setup_logging()
logging.warning("This is a warning!")
*built-in logging module and add the handlers to a logger create from it*
import logging
import google.cloud.logging
from google.cloud.logging.handlers import CloudLoggingHandlerlog_name =
"python_application_name"
# Create a handler for Google Cloud Logging. gcloud_logging_client =
google.cloud.logging.Client()gcloud_logging_handler =
CloudLoggingHandler(gcloud_logging_client, name=log_name
)
# Create a stream handler to log messages to the
console.stream_handler =logging.StreamHandler()
stream_handler.setLevel(logging.WARNING)
# Now create a logger and add the handlers:
logger = logging.getLogger(log_name) logger.setLevel(logging.DEBUG)
logger.addHandler(gcloud_logging_handler)logger.addHandler(stream_handler)
*Google Logging:*
In [1]: logger.info("This is DEBUG.")In [2]: logger.info("This is INFO.")
In [3]: logger.warning("This is WARNING.")# This is WARNING.
In [4]: logger.error("This is ERROR.")# This is ERROR.
Output:
All messages were sent to Google Logging, but only some are printed in the console.
Result:
Successfully write a program Google Cloud Logging and to check the logs in the
LogsExplorer.
EX.NO:13 Log Data using Raspberry PI and upload to the cloud platform
DATE:
Aim:
To write a program to log data using Raspberry pi and upload to the cloud platform.
Hardware Requirements:
1. Raspberry Pi
2. Power Cable
Software Requirements:
1. Raspberry pi
2. Thingspeak IOT platform
Procedure:
Now copy your “Write API Key”. We will use this API key in our code.
Program:
Output:
AIM:
To write a program to develop a commercial IOT application.
HARDWARE REQUIREMENTS:
NodeMCU ESP8266 Board or Wemos D1 Mini
BME680 Sensor
Connecting Wires
Breadboard
Micro-USB Cable
SOFTWARE REQUIREMENTS:
Arduino IDE tool
PROCEDURE:
Step 1: Connect Wemos D1 Mini or ESP8266 & BME680 Sensor.
Connect the BME680 SCL & SDA Pin to D4 & D3 of Wemos Board. Supply thesensor as
3.3VVCC through 3.3V Pin of Wemos Board.
Step 2: Connect the SDO to GND. Connecting the SDO pin from the BME680 to the
GND is important because the original code was programmed to use the alternative
I2C address (0x77).Access this I2C address from the BME680 sensor by connecting
the SDO pin to the Ground.
Step 3:
CODING:
#include "bsec.h" #include <Blynk.h>
#include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h>
char auth[] = "***********************"; // You should get Auth Token in the
BlynkApp.char ssid[] = "***********************"; // Your WiFi credentials.char pass[]
= "***********************";
// Helper functions declarations void checkIaqSensorStatus(void);void errLeds(void);
// Create an object of the class BsecBsec
iaqSensor;String output;
// Entry point for the examplevoid setup(void)
{
Serial.begin(115200);Wire.begin(0, 2);
iaqSensor.begin(BME680_I2C_ADDR_PRIMARY, Wire);
output = "\nBSEC library version " + String(iaqSensor.version.major) + "." +
String(iaqSensor.version.minor) + "." + String(iaqSensor.version.major_bugfix) + "." +
String(iaqSensor.version.minor_bugfix);
Serial.println(output); checkIaqSensorStatus(); bsec_virtual_sensor_t sensorList[10] =
{ BSEC_OUTPUT_RAW_TEMPERATURE,
BSEC_OUTPUT_RAW_PRESSURE, BSEC_OUTPUT_RAW_HUMIDITY,
BSEC_OUTPUT_RAW_GAS, BSEC_OUTPUT_IAQ, BSEC_OUTPUT_STATIC_IAQ,
BSEC_OUTPUT_CO2_EQUIVALENT, BSEC_OUTPUT_BREATH_VOC_EQUIVALENT,
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE,
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY,
};
iaqSensor.updateSubscription(sensorList, 10,
BSEC_SAMPLE_RATE_LP);checkIaqSensorStatus();
// Print the header
output = "Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity
[%],gas[Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2
equivalent, breath VOC equivalent";
Serial.println(output);
}
// Function that is looped forevervoid loop(void)
{
unsigned long time_trigger = millis();
if (iaqSensor.run()) { // If new data is availableoutput = String(time_trigger);
output += ", " + String(iaqSensor.rawTemperature);output += ", " +
String(iaqSensor.pressure);output += ", " + String(iaqSensor.rawHumidity); output += ", " +
String(iaqSensor.gasResistance);output += ", " + String(iaqSensor.iaq);
output += ", " + String(iaqSensor.iaqAccuracy); output += ", " +
String(iaqSensor.temperature);output += ", " + String(iaqSensor.humidity); output += ", "
+ String(iaqSensor.staticIaq); output
+= ", " + String(iaqSensor.co2Equivalent);
output += ", " + String(iaqSensor.breathVocEquivalent);Serial.println(output);
if (iaqSensor.bme680Status != BME680_OK)
{
if (iaqSensor.bme680Status < BME680_OK)
{
output = "BME680 error code : " +
String(iaqSensor.bme680Status);Serial.println(output);for (;;)
errLeds(); /* Halt in case of failure */
}
else
{
output = "BME680 warning code : " + String(iaqSensor.bme680Status);
Serial.println(output);
}
}
}
void errLeds(void)
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);delay(100); digitalWrite(LED_BUILTIN, LOW);
delay(100);
}
OUTPUT:
RESULT:
Successfully create a IOT application.
VIVA QUESTIONS
1) What is Arduino?
Arduino is an open-source electronics platform based on easy-to-use hardware
andsoftware.Arduino boards are able to read inputs - light on.
12) What are the most common uses for Raspberry Pi?
1. Desktop PC. Using Raspberry Pi, the microSD card, and a power supply, a simple
desktopcan be made. ...
2. Wireless print server. ...
3. Media Usage. ...
4. Game Servers. ...
5. Retro Gaming Machine. ...
6. Robot Controller. ...
7. Stop Motion Camera. ...
8. Time-lapse CameraCCombiningge.