Harsh Jee
Published

PIEZO-street

A smart street system which uses Piezoelectric cells to generate power.

IntermediateFull instructions provided440
PIEZO-street

Things used in this project

Hardware components

Piezo Sensor
ControlEverything.com Piezo Sensor
×30
Arduino UNO
Arduino UNO
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
5 mm LED: Red
5 mm LED: Red
×3
LDR, 5 Mohm
LDR, 5 Mohm
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Grove - Gas Sensor(MQ2)
Seeed Studio Grove - Gas Sensor(MQ2)
MQ135/ MQ138 sensor can be used as well.
×1
Jumper wires (generic)
Jumper wires (generic)
Normal wires will be needed for pizo connection, female wires will be needed for connecting some sensor modules with arduino.
×1
Capacitor 220 µF
Capacitor 220 µF
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Li-Ion Battery 1000mAh
Li-Ion Battery 1000mAh
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematics

Consider the LED as street lamp

Code

Arduino code for Smart Piezo-street

Arduino
#include <LiquidCrystal.h>
const int trigPin = 9;
const int echoPin = 10;
int digpin= 8;
unsigned int count = 0;
int airpin= A0;
int anapin= A1;
int sensorValue;
int digitalValue;
int airsensorValue;
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup()
{
Serial.begin(9600);
pinMode(airpin, INPUT);
pinMode(anapin, INPUT);
pinMode(digpin, OUTPUT);
pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);
lcd.begin(16, 2);
lcd.print("MQ135 Sensor");
delay(2000);
lcd.clear();
}
void loop()
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
unsigned long pulseDuration = pulseIn(echoPin, HIGH);
float distance = pulseDuration / 2.0 * 0.0343;
sensorValue = analogRead(anapin);
if(sensorValue<200){
digitalWrite(digpin,HIGH);
}
else{
digitalWrite(digpin,LOW);
}
Serial.println(sensorValue);
if (distance > 5 && distance < 20) {
count++;
lcd.setCursor(0, 0);
lcd.print("Object detected. Count: ");
lcd.setCursor(0, 1);
lcd.print(count);
delay(1000);
lcd.clear();
}
airsensorValue = analogRead(airpin);
lcd.setCursor(0, 0);
lcd.print("Pollution level- ");
lcd.setCursor(0, 1);
lcd.print(airsensorValue);
delay(1000);
lcd.clear();
}

Credits

Harsh Jee
3 projects • 1 follower
Electronics Engineer | super interested in VLSI and semiconductor industry.
Contact

Comments

Please log in or sign up to comment.