Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Importance and usefulness of LED Street Lights LED street lights have become increasingly popular due to their energy efficiency and longevity compared to traditional street lighting options. LED lights consume less energy, have a longer lifespan, and provide better illumination. This makes them a cost-effective and environmentally friendly choice for street lighting. In this article, we will explore a project using Arduino to control LED street lights and showcase the benefits of this technology.
Project: Controlling LED Street Lights with Arduino In this project, we will create a system to control LED street lights using an Arduino board. The objective is to demonstrate how Arduino can be used to automate street lighting, allowing for energy-saving features such as dimming or turning off lights when not needed.
The functionality of the project includes:
List of components:
You can purchase these components from the following links:
Examples: Example 1: Turning on/off LED street lights
const int streetLightPin = 9;
void setup() {
pinMode(streetLightPin, OUTPUT);
}
void loop() {
digitalWrite(streetLightPin, HIGH); // Turns on the street lights
delay(5000); // Wait for 5 seconds
digitalWrite(streetLightPin, LOW); // Turns off the street lights
delay(5000); // Wait for 5 seconds
}
Example 2: Dimming LED street lights
const int streetLightPin = 9;
void setup() {
pinMode(streetLightPin, OUTPUT);
}
void loop() {
analogWrite(streetLightPin, 128); // Sets the brightness to half (0-255 range)
delay(5000); // Wait for 5 seconds
analogWrite(streetLightPin, 255); // Sets the brightness to full
delay(5000); // Wait for 5 seconds
}
Example 3: Automatic control using a light sensor
const int streetLightPin = 9;
const int lightSensorPin = A0;
void setup() {
pinMode(streetLightPin, OUTPUT);
pinMode(lightSensorPin, INPUT);
}
void loop() {
int lightLevel = analogRead(lightSensorPin); // Read the light sensor value
if (lightLevel < 500) {
digitalWrite(streetLightPin, HIGH); // Turns on the street lights
} else {
digitalWrite(streetLightPin, LOW); // Turns off the street lights
}
delay(1000); // Wait for 1 second
}