Smart City

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18
At a glance
Powered by AI
The document discusses a smart city prototype that uses sensors and IoT technology to optimize various city systems like traffic lights, street lighting and parking.

The smart city prototype aims to reduce traffic, improve energy efficiency through better use of solar panels, and demonstrate what a future technological city could look like.

An IoT infrastructure in a city can help optimize services like transport, lighting, maintenance and more. It can also increase transparency and promote citizen participation.

SMART CITY

Presented by:

Ahmed Mazhar Ayoub

Arkan Karim

Kamal Sabah

2nd Stage (Evening Study)

Dr. Omar Youssef


Table of Contents:

Introduction………………………………………………………….. 2-3

Supplies …………………………………………………………. 4-5

Creating method………………………………………………….5-9

Schema ………………………………………….……..9-11

Output…………………….…….11-13

Smart city lights ……………………………………………….11-12

Smart traffic lights …………………………..…..12

Solar Sun tracker………………………………………………..13

CODE…………………………………………………………..14-17

1
Smart City

Introduction:

This magnificent prototype of a smart city offers a solution in


reducing the traffic jams on the road and around the parking lots,
greater electricity savings and better use of a solar Sun power
panels. It represents a prototype of the real projection (look) of
one part of city in Croatia. It demonstrates of what a technological
future should look like. By using all the sensors, IoT and high
technology electronic boards, we are able to collect the information
in real time, which allows us to more efficiently plan and implement
utilization of the urban infrastructure as being the foundation of
every “Smart city”. In this complex scenario, the application of the
IoT paradigm to an urban context is of particular interest, as it
responds to the strong push of many national governments to
adopt ICT solutions in the management of public affairs, thus
realizing the so-called Smart City concept [4]. Although there is not
yet a formal and widely accepted definition of “Smart City,” the
final aim is to make a better use of the public resources, increasing
the quality of the services offered to the citizens, while reducing
the operational costs of the public administrations. This objective
can be pursued by the deployment of an urban IoT, i.e., a
communication infrastructure that provides unified, simple, and
economical access to a plethora of public services, thus unleashing

2
potential synergies and increasing transparency to the citizens. An
urban IoT, indeed, may bring a number of benefits in the
management and optimization of traditional public services, such
as transport and parking, lighting, surveillance and maintenance of
public areas, preservation of cultural heritage, garbage collection,
salubrity of hospitals, and school.1 Furthermore, the availability of
different types of data, collected by a pervasive urban IoT, may
also be exploited to increase the transparency and promote the
actions of the local government toward the citizens, enhance the
awareness of people about the status of their city, stimulate the
active participation of the citizens in the management of public
administration, and also stimulate the creation of new services
upon those provided by the IoT. As it was stated earlier, it is seen
in a number of cities that the street light is one of the huge
expenses in a city. The cost spent is huge that all the sodium vapor
lamps consume more power. The expense spent on the street light
can be used for other development of the nation. Currently a
manual system is used where the light will be made to switched
ON/OFF i.e the light will be made to switch ON in the evening and
switched OFF in the morning. Hence there is a lot of wastage of
energy between the ON/OFF. This is one of the major causes of
shifting to the automatic system, since there is less wastage of
power and thus saving a lot of monetary expenses.

3
A motto I liked: “We provide a solution for less pollution”

Supplies:

MATERIALS USED IN THIS PROJECT (only electronic materials):

1-Genuine Arduino Uno R3

2-Arduino ABX00011 MKR1000 Wi-Fi Enabled IoT Board 3.3V

3-SG-90 SG90 9g Micro Gear Servos Motor Car Plane Boat


Raspberry Pi

4-Hub With Power Supply 5v Vertical 7-Port USB 2.0 High-Speed


Divisor Kit

5-1m A Male to MICRO USB 2.0 Charge Cable Phone Charger Lead
Data

6- USB Cable 52cm Blue for Arduino UNO 2560 R3 Printer Scanner

7-Arduino IDE

8- Photoresistor LDR CDS 5mm Resistor Sensor Light-Dependent


GL5516 Arduino

9-Solar panels

10-5.5V 100MA Micro Mini Power Solar Cells

11-Obstacle Avoidance IR Sensor Infrared Photoelectric Module


Arduino Raspberry PI

4
12- 5 mm Ultra Bright Round Water Clear LED Bulb 3V Light
Emitting Diode

13-1/4W 0.25W Carbon Film Resistor ±5% 1K Ohm to 4.7M Ohm

14-wires

The quantity of the items is adjustable and depend on the size of


the project.

Methods of creating:

The basis for the model design is a 4 mm thick plywood with its
flyers to achieve a better and more solid structure. Connecting of
all parts of the model will be achieved by using the wood glue.

The model is made from two parts. The basis of the model
dimensions 750 x 720 mm will feature a promenade along the River

5
for which I used the Arduino Uno board, a photo resistor, infrared
sensors and LED lighting. At the position of the upper surface of
the load bearing part of the model, I created the basis for the main
part of the model according to instructions. The main part of the
model (detachable) will be 750 x 500 mm in size and will present
the prototype the county road in a city. The cutting of plywood
according to dimensions is done by an angle grinder. In the step 1,
after measuring, cutting and connecting all the cut parts on the
lower bearing structure, a 2 cm Styrofoam is placed with a net in
the riverbed, which is strengthened and crossed by flexible tile
glue, while in the main part of the model there is an artificial grass
on the slope facing the promenade. Artificial grass is attached to
the slope using the transparent silicone.

6
At the same time as the entire model is built, a solar tracker
construction is made from wooden flyers. During the production of
all wooden parts, all defects are removed, correction and
adjustment is done.

In the 1st step, after all modelling work, the design of the model is
followed by painting according to the actual appearance of the road
and the promenade of the Smart City.

7
These surfaces are first painted with the core color, followed by
synthetic enamel paint for the final appearance and strength. All
the painting is done manually by brush or with a paint roller. After
two final color layers, a decorative granulate is applied in the place
where the solar Sun tracker will be attached to the main surface.
For strengthening the granulate I used the super glue.

the final look should be this.

8
In the 2nd step, Arduino codes are being programmed for smart
lighting, smart parking, smart traffic lights and a solar Sun tracker.
In addition to programming, drawings are made on the 3D printer,
brackets and traffic lights are printed for the intersection on the
main road. Except programming, all other necessary parking
spaces and accompanying facilities on the main road are made.

The 3rd step includes the installation the installation of the Arduino
boards and all other electronic components for the final appearance
of smart city model.

Schema:

Smart City lights schema.

9
Smart City traffic lights schema.

Smart City smart parking schema.

10
Smart City solar sun tracker schema.

Output:

Smart city lights

SMART CITY LIGHTS along the river which use the photo resistor,
infrared sensors, led lights, and Genuine Arduino UNO board. The
main principle is that the LED lights are on with a reduced
brightness, but as the person approaches every light, the infrared
sensor activates the program which turns on the light much
brighter. As you leave, it comes back to reduced brightness. At this

11
point of our Humanity, in the 21st Century, we have to look for a
new ways and solutions on how the save more energy to avoid
power outages and to bring electricity to rural areas on this Planet.
Our smart city lights offer tremendous savings in electricity
consumption.

Smart traffic lights:

SMART TRAFFIC LIGHTS are very adaptive to the current traffic.


By using the infrared sensor placed in the asphalt before the traffic
light, it senses the movement, and according to the current
situation regulates the traffic. Smart traffic lights let us avoid
situations where the driver would have to sit in the car and wait for
a green light to come up when there is no one around at the
intersection. By using this type of the traffic lights, we can
drastically reduce traffic jams. For this project I used Genuine
Arduino MKR 1000 board.

Smart parking:

SMART PARKING uses an infrared sensor to determine whether


here is an empty parking space available and how many are left at
the parking lot. As the vehicle approaches the parking, the sensor
gets activated showing available spaces on the LCD display, opens
the ramp and enables the entrance into the parking lot. As soon as

12
the vehicle enters the ramp goes down to its normal position. The
same procedure is when vehicles leave the parking lot. For this
project I used Genuine Arduino MKR 1000 board.

Solar Sun tracker:

SOLAR SUN TRACKER uses a photo resistor to adjust the angle of


the solar panels according to the strongest source of the Sun light.
This way of tracking the Sun light gives us the opportunity to
increase the percentage of using the Sun energy which is stored in
a power bank for later use and distribution of electricity to the city
lights. For this project I used Genuine Arduino MKR 1000 board.

Code:

13
Smart city lights code:

#include<FadeLed.h>//It }
adds library for LED diode if (digitalRead(sensPin1) }
management. == LOW) { //It checks if
the sensor is voidprog4() { //The fourth
FadeLed leds[5] = {3, 5, 6, electromagnetically loop.
9, 10}; //It adds LED pins stimulated.
to the "leds" object. if (digitalRead(sensPin4)
leds[0].set(100); //It == LOW) {
unsignedlong millisLast; gradually sets the LEDs
//variable millisLast intensity at 100%. leds[3].set(100);

int resPin = A1; //It } else { //function } else {


defines photoresistor pin. "else"
int resValue = 0; //A leds[3].set(10);
variable for storing the leds[0].set(10); //It
value of photoresistors. gradually sets the LEDs }
int sensPin1 = 2; //It intensity at 10%. }
defines infrared sensor
pins. } voidprog5() { //The fifth
int sensPin2 = 4; } loop.
int sensPin3 = 7;
int sensPin4 = 8; voidprog2() { //The second if (digitalRead(sensPin5)
int sensPin5 = 12; loop program. All loops are == LOW) {
the same, but they are
voidsetup() { //The initial defining other sensors and leds[4].set(100);
set up for loop. LEDs.
} else {
pinMode(sensPin1, INPUT); if (digitalRead(sensPin2)
//It defines pins of == LOW) { leds[4].set(10);
infrared sensors as input. }
pinMode(sensPin2, INPUT); leds[1].set(100); }
pinMode(sensPin3, INPUT);
pinMode(sensPin4, INPUT); } else { voidloop() { //The main
pinMode(sensPin5, INPUT); loop.
leds[1].set(10);
leds[0].setTime(2000); FadeLed::update(); //It
//It sets the time to } refreshes the state of the
change the intensity of } LEDs.
light
leds[1].setTime(2000); voidprog3() { //The third resValue =
//from 0% to 100% for 2 loop. analogRead(resPin); //It
seconds (relatively fast!). defines the variable as the
leds[2].setTime(2000); if (digitalRead(sensPin3) value of the photoresistor.
leds[3].setTime(2000); == LOW) {
leds[4].setTime(2000); if (resValue < 50) { //It
leds[2].set(100); checks whether it is day or
} night.
} else {
voidprog1() { //The first prog1(); //If detects the
loop program. leds[2].set(10); night, calls for other
loops.

14
prog2(); leds[4].set(0);
prog3(); leds[0].set(0); //If
prog4(); detects the daylight, the }
prog5(); LEDs remain turned off. } //that is it!!!
leds[1].set(0);
} else { //function leds[2].set(0);
"else" leds[3].set(0);
Smart traffic lights code:

int crvenoGlavna = 2; delay(1000);


int zutoGlavna = 1; if (digitalRead(senzor1) digitalWrite(zelenoGlavna,
int zelenoGlavna = 0; == LOW) { LOW);
delay(1000);
int crvenoSporedna = 5; delay(500); digitalWrite(zelenoGlavna,
int zutoSporedna = 4; semaforGlavna(); HIGH);
int zelenoSporedna = 3; //It initiates the traffic delay(1000);
light loop. digitalWrite(zelenoGlavna,
int senzor1 = 6; LOW);
int senzor2 = 7; } elseif delay(1000);
(digitalRead(senzor2) == digitalWrite(zelenoGlavna,
voidsetup() { LOW) { HIGH);
pinMode(crvenoGlavna, digitalWrite(zutoGlavna,
OUTPUT); delay(500); LOW);
pinMode(zutoGlavna, semaforGlavna(); delay(2000);
OUTPUT); //It initiate the traffic digitalWrite(zutoGlavna,
pinMode(zelenoGlavna, light loop. HIGH);
OUTPUT); digitalWrite(crvenoGlavna,
} elseif LOW);
pinMode(crvenoSporedna, ((digitalRead(senzor1) && delay(1000);
OUTPUT); digitalRead(senzor2)) == digitalWrite(zutoSporedna,
pinMode(zutoSporedna, HIGH) { LOW);
OUTPUT); delay(3000);
pinMode(zelenoSporedna, digitalWrite(zelenoGlavna, digitalWrite(zutoSporedna,
OUTPUT); LOW); //While HIGH);
there's no traffic on the digitalWrite(zelenoSporedn
pinMode(senzor1, INPUT); side road, the traffic a, LOW);
pinMode(senzor2, INPUT); light digitalWrite(crvenoSporedn
digitalWrite(crvenoSporedn a, HIGH);
digitalWrite(zelenoGlavna, a, LOW); //is delay(5000);
HIGH); //All states constantly on to the digitalWrite(zelenoSporedn
must be turned on, because benefit of the main road. a, HIGH);
the LEDs are connected to digitalWrite(crvenoGlavna, delay(1000);
digitalWrite(crvenoGlavna, HIGH); digitalWrite(zelenoSporedn
HIGH); //the common digitalWrite(zelenoGlavna, a, LOW);
anode and then LEDs are HIGH); delay(1000);
turned off. digitalWrite(zutoGlavna, digitalWrite(zelenoSporedn
digitalWrite(zutoGlavna, HIGH); a, HIGH);
HIGH); //The state of digitalWrite(zutoSporedna, digitalWrite(zutoSporedna,
the program is different HIGH); LOW);
from that of the LEDs. delay(3000);
} digitalWrite(zutoSporedna,
} HIGH);
digitalWrite(zelenoSporedn digitalWrite(crvenoSporedn
a, HIGH); voidsemaforGlavna() { a, LOW);
digitalWrite(crvenoSporedn //Traffic light loop. delay(1000);
a, HIGH); digitalWrite(zutoGlavna,
digitalWrite(zutoSporedna, digitalWrite(crvenoGlavna, LOW);
HIGH); HIGH); delay(3000);
digitalWrite(zutoGlavna, digitalWrite(zutoGlavna,
} HIGH); HIGH);
digitalWrite(zelenoGlavna,
voidloop() { HIGH); }//this is it!!!

15
Smart parking code:

#include<Servo.h>//It adds B01110, delay(500);


the library to the //necessary to print the slobodnaMjesta--;
program. message “Unfortunately,
#include<LiquidCrystal.h> there are no vacancies”. rampa.write(dignuto);
B00000, lcd.print("Slobodna
Servo rampa; B11111, mjesta:");
//It creates a servo B00110, lcd.setCursor(5, 1);
object that manages the B01100,
servo. B11111, lcd.print(slobodnaMjesta);
}; delay(3000);
int izlaz = 0;
//Pin attached to the voidsetup() { rampa.write(spusteno);
sensor at the exit. rampa.attach(9); } else {
int ulaz = 1; //It connects the servo. delay(500);
//Pin attached to the lcd.print("Na");
sensor at the entrance. pinMode(izlaz, INPUT); lcd.write(byte(0));
//It sets the pins' of the lcd.print("alost,
int spusteno = 177; sensors for entrance and nema");
//Position of the ramp exit as input. lcd.setCursor(0, 1);
down. pinMode(ulaz, INPUT); lcd.print("slobodnih
int dignuto = 90; rampa.write(spusteno); mjesta");
//Position of the ramp up. //It sets the ramp to the delay(2000);
down position. }
int kapacitet = 6; }
//The capacity of the if (digitalRead(izlaz) ==
parking. lcd.begin(16, 2); 0)
int slobodnaMjesta = 6; //It sets the number of {
//The number of vacancies characters and rows on the if (slobodnaMjesta !=
(the parking lot is LCD. kapacitet) {
initially empty). lcd.setCursor(2, 0); delay(500);
lcd.print("Super Mega"); slobodnaMjesta++;
constint rs = 7, en = 6, //It prints the message on
d4 = 5, d5 = 4, d6 = 3, d7 the LCD. rampa.write(dignuto);
= 2; //It lcd.setCursor(4, 1); lcd.print("Slobodna
initializes the library by lcd.print("PARKING"); mjesta:");
adding required pins for delay(2000); lcd.setCursor(5, 1);
LCD lcd.clear();
LiquidCrystal lcd(rs, en, lcd.print(slobodnaMjesta);
d4, d5, d6, d7); lcd.createChar(0, znak); delay(3000);
//to the pin to which lcd.begin(16, 2);
Arduino is connected. rampa.write(spusteno);
} }
byte znak[8] = { }
//It creates the data for voidloop() { lcd.clear();
a character that is }//this is it!!!
printed on if (digitalRead(ulaz) ==
B11011, 0)
//LCD, but it is not a {
standard alphanumeric (Z) if (slobodnaMjesta != 0) {

16
Solar Sun tracker code:

#include<Servo.h> if(tragacPoz<=160) //It


voidloop() confirms that the tracker
Servo tragac; //It { is not in the far East
creates a servo object istokVal = kalibracija + position.
that manages the servo. analogRead(istokPin); {
//It reads the values of tragacPoz++;
int istokPin = 1; //It the east and west sensors.
adds analog pins connected zapadVal = tragac.write(tragacPoz);
to the light sensor analogRead(zapadPin); //It moves the tracker to
int zapadPin = 2; if(istokVal<350 && the East.
zapadVal<350) //It checks }
int istokVal = 0; //It if both sensors receive a }
creates variables that little light, it's dark! elseif(greska<-15) //If
store sensor values. { the error is negative and
int zapadVal = 0; while(tragacPoz<=160) lower than -15, it moves
//It moves the tracker to the tracker to the West.
int greska = 0; the far Eastern position {
int kalibracija = 204; to greet the dawn. if(tragacPoz>20) //It
//Calibration shift that { confirms that the tracker
sets the error to zero tragacPoz++; is not in the far West
when both sensors receive position.
the same amount of light. tragac.write(tragacPoz); {
int tragacPoz = 90; delay(100); tragacPoz--;
//It creates a variable }
that stores the } tragac.write(tragacPoz);
positioning of the servo. greska = istokVal - //It moves the tracker to
zapadVal; //It the West.
voidsetup() determines the difference }
{ between two sensors. }
tragac.attach(11); //It if(greska>15) //If delay(100);
adds an object to the the error is positive and }//this is it!!!
servo connected to pin 11. bigger than 15, it moves
} the tracker to the East.
{

17

You might also like