IoT Final PSEE
IoT Final PSEE
Q. What is Tinkercard ?
For those related to IoT, Tinkercad is a good place to design and prototype your projects. Some possible
areas where Tinkercad might relate to IoT are as following:
- 1. Plastic Enclosures: Design and print custom plastic enclosures for ingtevariants, sensor nodes,
micro-controllers or SBCs.
- 2. Building and testing prototypes: With something like Tinkercad you can easily prototype IoT
projects - from home automation systems to wearables.
- 3. Sensor holders/mounts - Create your own customized holder or mount for sensors like
temperature, humidity or motion sensor.
- 4. IoT for Everyone - She then played with the idea of showing people how to build custom IoT
devices like connected smart home items and environmental monitoring systems using things
they could easily design in Tinkercad and make on a 3d printer.
- 5. Fast prototyping: The easiness of use and 3D printing feature make it able to design an IoT
device rapidly with Tinkercad.
- 6. List of IoT device housings to design and printCustom housing, complete with a rain shield
suitable for outdoors (IP66)
- 7. Build wearable IoT devices - I have built my own smartwatch or a fitness tracker using the help
of Tinkercad and it has been 3D printed.
There are several ways that Tinkercad can be used in IoT projects. This includes:
int ledPin = 9;
void setup() {
pinMode(ledPin, OUTPUT); // Set the pin as an output
}
void loop() {
for (int brightness = 0; brightness <= 255; brightness++) {
analogWrite(ledPin, brightness);
delay(10);
}
for (int brightness = 255; brightness >= 0; brightness--) {
analogWrite(ledPin, brightness);
delay(10);
}
}
Devices Used :
1. Server
2. Laptop
3. Wireless Router
4. Ceiling Fan
5. Door
6. Window
7. Light
8. Garage Door
1. Garage Door
- A garage door opener.
Features:
• Registration Server Compatible
• Ability to vent Carbon Dioxide and Carbon Monoxide
Usage:
• N/A
Direct Control:
• ALT-click to interact
Local Control:
• Connect device to MCU/SBC/Thing.
• Use the customWrite API per Data Specifications
Remote Control:
• Connect device to Registration Server using Config Tab
Data Specifications:
• Input Slot: D0
• Message Format: [state]
state: 0 = closed, 1 = open
2. Light
- A lamp that can be turned on or off.
Features:
• Registration Server Compatible
• Off
• Dim
• On
• Emits light to the environment
Usage:
• N/A
Direct Control:
• ALT-click to interact
Local Control:
• Connect device to MCU/SBC/Thing.
• Use the "customWrite" API per Data Specifications
Remote Control:
• Connect device to Registration Server using Config Tab
Data Specifications:
Message Format: [state]
state: 0 = off, 1 = dim, 2 = on
3. Window
- A window that can open or close
Features:
• Registration Server Compatible
• Ability to vent Carbon Dioxide and Carbon Monoxide
Usage:
• Window works with Environment object. It reads CARBON_DIOXIDE and CARBON_MONOXIDE
variables set in the Environment object and change these variables when users activate window
opening/closing
Direct Control:
• ALT-click to open and close
Local Control:
• Connect device to MCU/SBC/Thing. Use the "customWrite" API per Data Specifications
Remote Control:
• Connect device to Registration Server using Config Tab
Data Specifications:
Message Format: [state]
state: 0 = closed, 1 = open
4. Door
Open / Close / Unlock / Lock
Features:
• Registration Server Compatible
• Ability to vent Carbon Dioxide and Carbon Monoxide
Usage:
• Connect to the Door from SBC/MCU/Thing with IoT Custom Cable
• Use customWrite function to control the door and lock
Direct Control:
• ALT-click on keyhole to lock/unlock
• ALT-click on door to open/close
Local Control:
• Connect device to SBC/MCU/Thing. Use the "customWrite" API per Data Specifications
Remote Control:
• Connect device to Registration Server using Config Tab
NOTE: opening and closing the door is not remote controllable
Data Specifications:
Message Format: [door],[lock]
door: 0 = closed, 1 = open, -1 = don't care
lock: 0 = unlock, 1 = lock, -1 = don't care
5. Fan
- Ceiling Fan
Features:
• Registration Server Compatible
• Off
• Low Speed
• High Speed
Usage:
• Connect to the Fan with custom cable from MCU/SBC/Thing
• In the script, write the data to the Fan with customWrite function to turn Fan off, set low
speed/high speed
Direct Control:
• ALT-click to interact
Local Control:
• Connect device to MCU/Thing/SBC. Use the "customWrite" API per Data Specifications
Remote Control:
• Connect device to Registration Server using Config Tab
Data Specifications:
Message Format: [state]
state: 0 = off, 1 = low speed, 2 = high speed
Server Ip Configuration
Laptop Ip Configuration
Device Used :
1. Server
2. Access point
3. Lawn sprinkler
4. Smoke detector
5. Old cars
1. Lawn Sprinkler
Features:
• Registration Server Compatible
• Raises the water level
Usage:
• N/A
Direct Control:
• ALT-Click to interact
Local Control:
• Connect device to MCU/SBC/Thing. Use the "customWrite" API per Data Specifications.
Remote Control:
• Connect device to Registration Server using Config Tab
Data Specifications:
• Input Slot: D0
• Message Format: [state]
state: 0 = off, 1 = on
2. Smoke Detector
Features:
• Registration Server Compatible
• Alarm will go off when it detects the environment variable SMOKE at the level of 40%.
Usage:
• Use an Old Car to change the Smoke level
Direct Control:
• N/A
Local Control:
• N/A
Remote Control:
• N/A
Data Specifications:
Message Format: [state],[level]
state: 0 = alarm off, 1 = alarm on
level: a positive number
3. Old Car
Features:
• Off
• On
• Increases Carbon Dioxide
• Increases Carbon Monoxide
• Increases Smoke
Usage:
• N/A
Direct Control:
• ALT-click to interact
Local Control:
• N/A
Remote Control:
• N/A
Data Specifications:
• N/A
Example:
1. Place a CO detector and a CO2 detector within the same container as the car.
2. Turn on the car and notice the alarm indicators go off on the detectors.
Server Configuration:
Access point configuration :
Before smoke :
After Smoke:
Experiment: 04
Implement Wind Detection System using Cisco packet tracer.
Solution:-
Hardware Devices :-
- Server-PT
- Wireless Router
- Laptop-PT
- Door
- Window
- Wind Detector
Description of Devices:-
Server-PT:
• A server in Cisco Packet Tracer that simulates various network services such as DHCP, DNS, HTTP,
FTP, and more. It acts as a central node to manage and distribute data across the network,
providing essential services to other devices.
Wireless Router:
• A device in Cisco Packet Tracer that functions as both a router and a wireless access point. It
connects to the internet and provides Wi-Fi connectivity to various devices within its range,
facilitating wireless network access and communication.
Laptop-PT:
• A simulated laptop in Cisco Packet Tracer used to represent a user's computer. It can be
configured to access network services, perform tasks like browsing the internet, and interact
with other networked devices, demonstrating user endpoints in a network.
Door:
• A smart door in Cisco Packet Tracer that can be integrated into an IoT network. It can be
controlled and monitored remotely, often used in security systems to allow or restrict access,
demonstrating smart home automation.
Window:
• A smart window in Cisco Packet Tracer that can be controlled remotely within an IoT network. It
can be opened or closed based on user commands or automated settings, used to regulate
indoor conditions or enhance security.
Wind Detector:
• An IoT device in Cisco Packet Tracer designed to detect wind speed and direction. It can be used
in various applications, such as weather monitoring and smart home automation, to trigger
actions based on wind conditions, like closing windows or adjusting HVAC systems.
Connection:-
Configuration :-
- Server-PT :-
Services -> FTP -> Services On
- Wireless Router :-
- Laptop-PT :-
1. Server
2. Access point
3. Motion detector
4. Web cam
1. Webcam
- A camera device that records and sends data
Features:
• Registration Server Compatible
• Off
• On
• Video recording
Usage:
• N/A
Direct Control:
• ALT-click to interact
Local Control:
• Connect device to MCU/SBC/Thing. Use the "customWrite" API per Data Specifications
Remote Control:
• Connect device to Registration Server using Config Tab
Data Specifications:
Message Format: [state]
state: 0 = off, 1 = on
2. Motion Detector
Features:
• Registration Server Compatible
• Detects motion from mouse movement.
• Automatically deactivates after 5 seconds without any mouse movement.
Usage:
• N/A.
Direct Control:
• Alt-mouse move to interact.
Local Control:
• N/A
Remote Control:
• N/A
Data Specifications:
Message Format: [state]
state: HIGH=activated, LOW=inactive
Connection display
Raspberry Pi Home Automation: LED and Garage Door Control with Python
Device Used :
1. SBC board
2. Garage door
3. LED
4. Push button
1. SBC board
- SBC stands for Single Board Computer, which is a complete computer built on a single circuit
board. SBCs are typically small, low-power, and low-cost computers used for various applications
2. Garage Door
4. Push Button
Hardware Requirements:
Arduino Uno : 1
Bread Bors : 1
Ultrasonic Sensor : 1
Jumper Wires : 6
Cable : 1
Pin Configuration :
Vcc -5V
Source Code:
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
distance = (duration*.0343)/2;
Serial.print("Distance: ");
Serial.println(distance);
delay(100);
}
Output :
Experiment: 08
Implement Soil moisture Sensor to measure water level using Arduino UNO.
Solution:
● Hardware Devices
● Source code
Design:
Code:
int moisture=0;
void setup()
pinMode(A0,INPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
pinMode(12,OUTPUT);
pinMode(13,OUTPUT);
void loop()
moisture = analogRead(A0);
digitalWrite(9,LOW);
digitalWrite(10,LOW);
digitalWrite(11,LOW);
digitalWrite(12,LOW);
digitalWrite(13,LOW);
digitalWrite(13,HIGH);
else
if(moisture <400)
{
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
else
if(moisture <600)
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
digitalWrite(11,HIGH);
else
if(moisture <800)
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
digitalWrite(11,HIGH);
digitalWrite(10,HIGH);
else
digitalWrite(9,HIGH);
digitalWrite(10,HIGH);
digitalWrite(11,HIGH);
digitalWrite(12,HIGH);
digitalWrite(13,HIGH);
delay(100);
}
Experiment: 09
Solution :
• Hardware
• Pin Configuration of PIR sensor:
• Arduino Uno Diagram
• Application of PIR sensor
Output:
Code :
int detect=0;
void setup()
pinMode(2,OUTPUT); //LED DE
pinMode(7,INPUT); //PIR D7
void loop()
detect=digitalRead(7);//input from d7
if(detect==HIGH)
digitalWrite(2,HIGH);//on led
else
digitalWrite(2,LOW);//off led
delay(10); //10ms
}
Experiment: 10
Implementation of Temperature Sensor using Arduino Uno.
Solution:
Hardware:
Arduino Uno -1
Bread Board -1
Temperature Sensor -1
Jumper Wire
Anond-5V
Ground-GND (-ve)
The Temperature Sensor LM35 series are precision integrated-circuit temperature devices with an
output voltage linearly proportional to the Centigrade temperature.
The LM35 device has an advantage over linear temperature sensors calibrated in Kelvin, as the user is
not required to subtract a large constant voltage from the output to obtain convenient Centigrade
scaling. The LM35 device does not require any external calibration or trimming to provide typical
accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature
range.
Source Code:
int baselineTemp = 0;
int celsius = 0;
int fahrenheit = 0;
void setup()
pinMode(A0, INPUT);
Serial.begin(9600);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
void loop()
baselineTemp = 40;
// convert to Fahrenheit
Serial.print(celsius);
Serial.print(" C, ");
Serial.print(fahrenheit);
Serial.println(" F");
if (celsius < baselineTemp) {
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
}
delay(1000); // Wait for 1000 millisecond(s)
Output:
Experiment: 11
Implement gas sensor using Arduino Uno
Solution :
• Hardware
• Pin Configuration of PIR sensor:
• Arduino Uno Diagram
• Application of PIR sensor
Output:
Code :
void setup() {
Serial.begin(9600);
void loop() {
float sensorValue,MQ2pin;
digitalWrite(LED,HIGH);
Serial.print(sensorValue);
else{
digitalWrite(LED,LOW);
Serial.println(sensorValue);
delay(1000);
return (analogRead(pin));
}
PCIE EXAM
Implementation of Temperature Sensor, Ultrasonic sensor, Motion Sensor, Soil Moisture using single
Arduino Uno. Use Bread Board and LED pin for Output.
Solution:
❖ Pin Configuration
❖ Output
❖ Code
Link :
https://www.tinkercad.com/things/1TRseSjQgxo-daring-bruticus-
waasa/editel?returnTo=%2Fthings%2F1TRseSjQgxo-daring-bruticus-
waasa&sharecode=01A6YOQVvIWYmbPvXLtH2UYhgVnDGH3_EYOii1fd3WU
Pin Configuration :
o VCC: 5V
o GND: GND
o Trig: Pin 9
o Echo: Pin 8
o VCC: 5V
o GND: GND
o Output: A0
o VCC: 5V
o GND: GND
o Output: Pin 7
o VCC: 5V
o GND: GND
o Output: A1
• LEDs
o LED1: Pin 2
o LED2: Pin 3
o LED3: Pin 4
o LED4: Pin 5
Output:
// Pin Definitions
const int trigPin = 9; // Ultrasonic Sensor Trig Pin
const int echoPin = 10; // Ultrasonic Sensor Echo Pin
const int tempSensorPin = A0; // Temperature Sensor Pin
const int pirPin = 8; // PIR Sensor Pin
const int soilMoisturePin = A1; // Soil Moisture Sensor Pin
void setup() {
// Initialize serial communication
Serial.begin(9600);
void loop() {
// Ultrasonic Sensor Operation
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
long duration = pulseIn(echoPin, HIGH);
long distance = (duration / 2) / 29.1; // Convert to centimeters