Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Find temperature of human body using suitable sensors

Code:
#include <Adafruit_MLX90614.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
void setup() {
Serial.begin(9600);
mlx.begin();
}
void loop() {
float bodyTemp = mlx.readObjectTempC();
Serial.print("Body Temperature: ");
Serial.print(bodyTemp);
Serial.println(" °C");
delay(1000);
}

Output:
Body Temperature: 36.8 °C
Body Temperature: 36.9 °C
Body Temperature: 37.0 °C
Body Temperature: 36.9 °C
...

Communication between Iot and GSM

Communication between an IoT device and a GSM module enables data transmission over cellular
networks. The IoT device collects data, sends it to the GSM module, which then establishes a cellular
connection and transmits the data to a remote server/platform. Commands can also be sent from
the server/platform to the GSM module, which forwards them to the IoT device for execution. This
communication flow facilitates remote monitoring, control, and data exchange with IoT devices in
various environments.

Code:
#include <SoftwareSerial.h>
SoftwareSerial gsm(7, 8);
void setup() {
Serial.begin(9600); // Serial monitor
gsm.begin(9600); // GSM module
}
void loop() {
float sensorData = readSensor();
gsm.print("AT+CMGS=\"+1234567890\"\r");
delay(1000);
gsm.print("Sensor data: ");
gsm.print(sensorData);
gsm.write(26);
delay(1000);
if (gsm.available()) executeCommand(gsm.readStringUntil('\n'));
delay(5000);
}
float readSensor() {
return random(0, 100);
}
void executeCommand(String command) {
Serial.println("Command received: " + command);
}

Output:
Command received: [if there's any command received]
Sensor data: 42.60

Communication between Arduino and Raspberry pi using Bluetooth and GSM

The communication setup between Arduino and Raspberry Pi using Bluetooth and GSM:

1. Bluetooth Communication:
- Establish a short-range communication link between Arduino and Raspberry Pi.
- Enables data exchange over short distances.
- Suitable for communication within the same vicinity.

2. GSM Communication:
- Utilize GSM module connected to Arduino for long-range communication.
- Enables data transmission over cellular networks.
- Ideal for remote communication where Wi-Fi or wired internet is unavailable.

3. Data Transfer:
- Exchange data between Arduino and Raspberry Pi using both Bluetooth and GSM.
- Bluetooth for short-range communication and GSM for long-range communication.

4. Integration:
- Develop scripts for Arduino and Raspberry Pi to handle Bluetooth and GSM communication
protocols respectively.
- Ensure compatibility and interoperability between the two systems.

5. Protocols:
- Implement appropriate communication protocols (e.g., Serial, MQTT) for data exchange over
Bluetooth and GSM networks.
- Select protocols based on requirements such as reliability, efficiency, and ease of implementation.
6. Message Routing:
- Configure message routing mechanisms to direct data between Bluetooth and GSM
communication channels as needed.
- Ensure seamless data flow between the two communication modes.

7. Error Handling:
- Implement error handling mechanisms to manage communication errors and ensure reliable data
transfer.
- Handle network fluctuations and interruptions to maintain communication integrity.

Conclusion:
By combining Bluetooth and GSM communication, a robust communication system is established
between Arduino and Raspberry Pi, facilitating data exchange over both short and long distances.

Transfer of data between two registers

Org 00h
mov r0,#40h
mov r1,#50h
mov r7,#07h
mov a,@r0
mov @r1,a inc r0
inc r1
djnz r7
back
Set platform to store data

STEP 1:
Browse google cloud platform and click on to the link Free Trial and Free Tier Services and Products |
Google Cloud.
STEP 2:
After entering into the link this screen will be displayed where there will be a option for a free trial so
click on the "start free" button.
STEP 3:
After giving the free trial you need to fill the following where payment profile which requires the
details about the user and payment method where it needs either the debit card or the credit card
details
Once completing the requirements just give "start free".
STEP 4:
When all your given details are correct and it gets verified and then your account is created.
STEP 5:
Here click on to the cloud storage, and then enter into the option bucket which is displayed on the
screen.
STEP 6:
Give create a new bucket.
STEP 7:
Here where provide the unique name to the bucket and then give create so that bucket is created.
Then click on the upload option.
STEP 8:
Now drag the file from your device which you want to upload into the cloud and open.
Thus the chosen file started uploading.
CONCLUSION:
Thus finally the file gets uploaded successfully.

Automatic irrigation system using Iot

1. Sensor Integration:
○ Utilize soil moisture, temperature, humidity, and rain sensors.
2. Data Collection:
○ Sensors collect environmental data.
○ Data is sent to a microcontroller with IoT capabilities.
3. Data Transmission:
○ Microcontroller sends data to the cloud or local server via Wi-Fi, Ethernet, or
GSM.
4. Data Analysis:
○ Analyze data to determine watering needs based on predefined thresholds
and plant requirements.
5. Control Mechanism:
○ Microcontroller triggers irrigation valves/pumps to water plants as needed.
6. Remote Monitoring and Control:
○ Users monitor and control the system remotely via web or mobile app.
7. Alerts and Notifications:
○ System sends alerts for low moisture levels or malfunctions.
8. Power Management:
○ Implement power-efficient design and energy-saving techniques.
9. Feedback Loop:
○ Continuous monitoring and user feedback optimize system efficiency over
time.
Code:
import time
import requests
def check_soil_moisture():
return False
def water_plants():
print("Watering the plants...")
time.sleep(5)
while True:
if check_soil_moisture():
water_plants()
else:
print("Soil moisture level is adequate. No need to water.")
time.sleep(3600)

Output:
Soil moisture level is adequate. No need to water.
Soil moisture level is adequate. No need to water.
Soil moisture level is low. Watering the plants…

Swap numbers between register and accumulator

AREA SwapNumbers, CODE, READONLY


ENTRY
MOV R0, #10
MOV R1, #20
MOV R2, R0
MOV R0, R1
MOV R1, R2
END

Output:
Divide two no using embedded C

#include <stdio.h>
float divide(float dividend, float divisor) {
if (divisor != 0) {
return dividend / divisor;
} else {
printf("Error: Division by zero\n");
return 0;
}
}
int main() {
float num1 = 10.0;
float num2 = 5.0;
float result;
result = divide(num1, num2);
printf("Result of division: %.2f\n", result);
return 0;
}

Output:
Result of division: 2.00

Communication between IoT devices and BT

Communication between IoT devices and Bluetooth-enabled devices allows for wireless data
exchange over short distances. Here's an overview of how it works:

1. IoT Device Integration:


○ IoT devices are equipped with sensors, microcontrollers, and communication
modules (e.g., Wi-Fi, GSM, LoRa, etc.).
○ These devices collect data from sensors and process it for various applications
(e.g., environmental monitoring, home automation, healthcare, etc.).
2. Bluetooth Integration:
○ Bluetooth modules are integrated into IoT devices to enable wireless
communication with other Bluetooth-enabled devices.
○ Bluetooth Low Energy (BLE) is commonly used for IoT applications due to its
low power consumption and compatibility with smartphones, tablets, and
other Bluetooth devices.
3. Data Exchange:
○ IoT devices can transmit sensor data, commands, and status updates to
Bluetooth-enabled devices using BLE.
○ Bluetooth-enabled devices, such as smartphones or tablets, can also send
commands or configuration settings to IoT devices via Bluetooth.
4. Protocols and Profiles:
○ IoT devices and Bluetooth-enabled devices communicate using predefined
protocols and profiles.
○ GATT (Generic Attribute Profile) is commonly used for data exchange
between IoT devices and smartphones/tablets over BLE.
5. Applications:
○ IoT devices can communicate with smartphones, tablets, smartwatches, and
other Bluetooth-enabled devices to provide real-time data monitoring,
control, and interaction.
○ Examples include smart home systems, wearable devices, healthcare
monitoring solutions, industrial automation, and asset tracking.
6. Security:
○ Security measures such as encryption, authentication, and authorization are
implemented to ensure secure communication between IoT devices and
Bluetooth-enabled devices.
○ This prevents unauthorized access, data breaches, and tampering with
sensitive information.
7. Interoperability:
○ Standards such as Bluetooth SIG (Special Interest Group) ensure
interoperability between different Bluetooth devices and IoT ecosystems.
○ This allows seamless integration and communication between devices from
different manufacturers.

Find largest no in group

#include <stdio.h>
int findLargest(int arr[], int n) {
int max = arr[0];
for (int i = 1; i < n; i++) {
if (arr[i] > max) {
max = arr[i];
}
}
return max;
}
int main() {
int numbers[] = {10, 5, 20, 15, 25};
int size = sizeof(numbers) / sizeof(numbers[0]);
int largest = findLargest(numbers, size);
printf("The largest number in the group is: %d\n", largest);
return 0;
}

Output:
The largest number in the group is: 25

Deliver patient condition to doctor using Iot

Delivering patient condition to a doctor using IoT involves collecting health data from the
patient, transmitting it securely over the internet to a central server or cloud platform, and
providing access to the data to authorized healthcare professionals such as doctors.

1. Health Monitoring Devices: Equip the patient with IoT health monitoring devices
such as wearable fitness trackers, medical-grade sensors, or smart medical devices
that can measure vital signs like heart rate, blood pressure, blood glucose levels,
oxygen saturation, etc.
2. Data Collection: Collect real-time health data from the patient using IoT devices. This
data could include continuous monitoring of vital signs, medication adherence,
activity levels, sleep patterns, and other relevant health metrics.
3. Data Transmission: Transmit the collected health data securely over the internet
using wireless communication protocols such as Wi-Fi, Bluetooth, or cellular
networks (e.g., GSM, 3G, 4G, or 5G). Ensure data encryption and adherence to
healthcare data privacy regulations (e.g., HIPAA) to protect patient privacy and
confidentiality.
4. Cloud Platform: Store the transmitted health data in a secure cloud-based platform
or server. Utilize scalable and reliable cloud services such as Amazon Web Services
(AWS), Microsoft Azure, or Google Cloud Platform (GCP) to store and process the
data.
5. Data Processing and Analysis: Analyze the collected health data using machine
learning algorithms, artificial intelligence, or predictive analytics to identify patterns,
trends, and anomalies in the patient's condition. This analysis can provide valuable
insights into the patient's health status and help detect potential health risks or
medical emergencies.
6. Alerts and Notifications: Implement alerting mechanisms to notify healthcare
professionals, including doctors, nurses, or caregivers, about significant changes or
abnormalities in the patient's health condition. Alerts can be sent via email, SMS, or
push notifications to ensure timely intervention and medical attention.
7. Doctor Access: Provide authorized doctors and healthcare professionals with secure
access to the patient's health data through a web-based or mobile application. This
access allows doctors to remotely monitor the patient's condition, review historical
health data, track treatment progress, and make informed medical decisions.
8. Telemedicine Consultations: Facilitate telemedicine consultations between doctors
and patients using video conferencing or telehealth platforms. Doctors can interact
with patients in real-time, discuss treatment plans, prescribe medications, and
provide medical advice based on the patient's health data and current condition.
9. Integration with Electronic Health Records (EHR): Integrate IoT health data with
electronic health record (EHR) systems to maintain comprehensive and centralized
patient health records. Seamless integration ensures continuity of care, improves
care coordination, and enables healthcare professionals to access patient
information across different healthcare settings.

Compare numbers using assembly language program

AREA CompareNumbers, CODE, READONLY


ENTRY
NUM1 EQU 10
NUM2 EQU 20
MOV R0, #NUM1
CMP R0, #NUM2
BEQ equal
BGT greater
BLT lesser
MOV R0, #1
B print_message
MOV R0, #2
B print_message
MOV R0, #3
MOV R1, #1
SVC 0
B end
END

Output:
● If the first number (NUM1) is equal to the second number (NUM2), the output might

be:

● Equal
● If the first number (NUM1) is greater than the second number (NUM2), the output

might be:

● Greater

Transfer data between memory and accumulator

AREA TransferData, CODE, READONLY


ENTRY
DATA_ADDR EQU 0x20000000
ACC EQU R0
LDR ACC, =DATA_ADDR
LDR ACC, [ACC]
ADD ACC, ACC, #10
STR ACC, [DATA_ADDR]
END

Output:
Memory at address 0x20000000: 30

Communication between Iot and Zigbee

Zigbee
ZigBee is similar to Bluetooth and is majorly used in industrial settings. It has some significant advantages
in complex systems offering low-power operation, high security, robustness and high and is well
positioned to take advantage of wireless control and sensor networks in IoT applications. The latest
version of ZigBee is the recently launched 3.0, which is essentially the unification of the various ZigBee
wireless standards into a single standard.
Bluetooth
An important short-range IoT communications Protocols / Technology. Bluetooth,
which has become very important in computing and many consumer product markets. It is expected to be
key for wearable products, again connecting to the IoT albeit probably via a smartphone in many cases.
Step 1: Connect the Bluetooth module to the Arduino like so
RX-pin2
TX-pin 3
GND-GND
VCC-5v
Step 2: Plug in the Arduino and Upload the Sketch
Download the ino file and upload it to the arduino.
(DOWNLOAD THIS FILE FROM :https://www.instructables.com/How-to-Set-Up-and-Test-
Arduino-Bluetooth-Connection//)
Step 3: Connect to the Bluetooth on Your Phone
Open up the bluetooth settings on your phone and look for the module. Mine is named Sailfish but yours
should be named either hc-05 or hc-06. The password is almost always 1234, if not, try 0000.
Step 4: Connect to the Bluetooth Module
Download a Bluetooth terminal app from the Appstore, this one work great:
https://play.google.com/store/apps/details?id=Qwerty.BluetoothTerminal&hl=en and open it up. Open
the app, hit connect to a device - insecure and select your Bluetooth module from the list.
Step 5: Ready to Go!
Finally open up the Serial Monitor in the Arduino IDE by hitting the magnifying glass in the top right
corner, and you should be good to go. You now have a back and forth extremely simple connection
between your phone and your Arduino via Bluetooth.

Add 2 no using embedded C

#include <stdio.h>
int main() {
int num1 = 10;
int num2 = 20;
int sum;
sum = num1 + num2;
printf("The sum of %d and %d is: %d\n", num1, num2, sum);
return 0;
}

Output:
The sum of 10 and 20 is: 30

Smart City system

A smart city system utilizes advanced technologies to improve the efficiency, sustainability,
and quality of life for residents.

1. Internet of Things (IoT) Sensors: Deploy sensors throughout the city to collect
real-time data on various aspects such as air quality, temperature, humidity, traffic
flow, waste management, energy consumption, and more.
2. Data Analytics and Visualization: Analyze the data collected from IoT sensors to gain
insights into city operations and citizen behaviors. Visualize data through dashboards
and reports to make informed decisions and optimize city services.
3. Smart Mobility: Implement intelligent transportation systems to manage traffic flow,
reduce congestion, and improve public transportation efficiency. This may include
traffic signal optimization, smart parking systems, real-time public transit tracking,
and ride-sharing platforms.
4. Smart Energy Management: Optimize energy usage and promote sustainability
through smart energy grids, renewable energy sources, and energy-efficient
infrastructure. Implement smart meters, demand-response systems, and energy
monitoring solutions to reduce energy consumption and costs.
5. Urban Planning and Infrastructure: Use data-driven insights to plan and design
sustainable urban infrastructure, including buildings, roads, parks, and utilities.
Incorporate green spaces, pedestrian-friendly areas, and smart building technologies
for energy efficiency and environmental sustainability.
6. Safety and Security: Enhance public safety and security through smart surveillance
systems, emergency response coordination, and crime prevention measures.
Implement video analytics, facial recognition, and gunshot detection technologies to
monitor public spaces and respond to incidents effectively.
7. Citizen Engagement and Participation: Empower citizens to actively participate in city
governance and decision-making processes through digital platforms and mobile
applications. Provide channels for feedback, community forums, and citizen-led
initiatives to address local issues and improve civic engagement.
8. Environmental Sustainability: Promote environmental sustainability through
initiatives such as waste management optimization, water conservation, pollution
monitoring, and green infrastructure development. Encourage eco-friendly practices
among residents and businesses to reduce the city's ecological footprint.
9. Healthcare and Well-being: Enhance healthcare services and promote public health
through telemedicine, remote patient monitoring, and health data analytics.
Implement smart healthcare systems to improve access to healthcare resources,
track disease outbreaks, and manage population health.
10. Resilience and Disaster Management: Build resilience against natural disasters and
emergencies through early warning systems, disaster recovery plans, and crisis
response coordination. Utilize data analytics and predictive modeling to assess risks
and mitigate the impact of disasters on the city.

Program to find ascending order using embedded C

#include <stdio.h>
int main() {
int arr[] = {64, 34, 25, 12, 22, 11, 90};
int n = sizeof(arr)/sizeof(arr[0]);
int i, j, temp;
for (i = 0; i < n-1; i++) {
for (j = 0; j < n-i-1; j++) {
if (arr[j] > arr[j+1]) {
// Swap arr[j] and arr[j+1]
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
}
printf("Array in ascending order: \n");
for (i = 0; i < n; i++) {
printf("%d ", arr[i]);
}
printf("\n");
return 0;
}

Output:
Array in ascending order:
11 12 22 25 34 64 90

Program to identify particular no in group using embedded C

#include <stdio.h>
int main() {
int arr[] = {10, 20, 30, 40, 50};
int n = sizeof(arr) / sizeof(arr[0]);
int target = 30;
int found = 0;
for (int i = 0; i < n; i++) {
if (arr[i] == target) {
found = 1;
break;
}
}
if (found) {
printf("The target number %d is found in the group.\n", target);
} else {
printf("The target number %d is not found in the group.\n", target);
}
return 0;
}

Output:
The target number 30 is found in the group.

You might also like