Posted on Leave a comment

How to make a simple Traffic Light using Arduino UNO

Everyone must have seen those big lights in red, yellow, and green color at the corner of every road. Some even flash. Some stay lit all day long.

Big junctions have a separate controller which synchronizes these lights. So that the traffic flows smoothly. And the possibility of having a deadlock is minimized. That is very complex and requires a deep understanding of road traffic and human perception.

To make a simple traffic light. You will require three LED in RED, Yellow, and Green color.

Components Required:

Arduino
Red 5mm LED
Yellow 5mm LED
Green 5mm LED
330-ohm resistor
Jumper wires
Breadboard small

Arduino Code

#define red 8
#define yellow 7
#define green 4

void setup()
{
  pinMode(red, OUTPUT);
  pinMode(yellow, OUTPUT);
  pinMode(green, OUTPUT);
}

void loop()
{
  digitalWrite(green, HIGH);
  delay(10000); // Wait for 10 second(s)
  digitalWrite(green, LOW);
  digitalWrite(yellow, HIGH);
  delay(4000); // Wait for 4 second(s)
  digitalWrite(yellow,LOW);
  digitalWrite(red, HIGH);
  delay(5000);
  digitalWrite(red,LOW);
}
Posted on Leave a comment

How to make a plant watering system using Arduino Uno

Sometimes we are so busy in our work or in our day-to-day life that we forget to water our plants on time. Or in the summertime when the plants need additional water to sustain themselves in the high-temperature region like New Delhi.

This is a simple project that one can assemble and implement within a few minutes.

To make this project you will need some modules which are readily available in the market.

Arduino UNO x 1

Moisture Sensor x 1

A 5V relay x 1

5V water pump x 1

A short length of plastic or rubber tube x 1 – 1.5m

Rechargeable Power Bank x 1

#define sense A0
#define relay 9
void setup() {
  // put your setup code here, to run once:
pinMode(sense, INPUT);
pinMode(relay, OUTPUT);

Serial.begin(9600);
}
int val;
void loop() {
  // put your main code here, to run repeatedly:
val = analogRead(sense);
Serial.println(val);

if (val < 600)        /*  adjust this value to control how much soil must be moist */
{
  digitalWrite(relay, HIGH);
}
else
{
  digitalWrite(relay, LOW);
}
delay(400);
}