0% found this document useful (0 votes)
89 views19 pages

Day 5

This document provides instructions for building a traffic light simulator using an Arduino Uno. It lists the required components which include an Arduino Uno, breadboard, LEDs, jumper wires, resistors, and power source. It includes the code to program the Arduino to turn the LEDs representing the traffic lights on and off in sequence, simulating a traffic light. It also provides a schematic diagram to show how to connect the components on the breadboard.

Uploaded by

Guna sekaran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views19 pages

Day 5

This document provides instructions for building a traffic light simulator using an Arduino Uno. It lists the required components which include an Arduino Uno, breadboard, LEDs, jumper wires, resistors, and power source. It includes the code to program the Arduino to turn the LEDs representing the traffic lights on and off in sequence, simulating a traffic light. It also provides a schematic diagram to show how to connect the components on the breadboard.

Uploaded by

Guna sekaran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

DAY 5 :

TRAFFIC LIGHT SIMULATOR :

COMPONENTS REQUIRED:
1. Arduino UNO R3
2. Breadboard
3. LEDs (red, green, blue)
4. Jumper wires as required
5. Resistors (100/200 Ohm)
6. Power cable/ 9V dc battery
7. Program dumping cable
8. Arduino IDE latest version
Detail about Arduino:

__Arduino Uno is a microcontroller board based on the


ATmega328P. It has 14 digital input/output pins (of which 6 can be used
as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator
(CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP
header and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or
power it with a AC-to-DC adapter or battery to get started. You can
tinker with your Uno without worrying too much about doing something
wrong, worst case scenario you can replace the chip for a few dollars
and start over again.

"Uno" means one in Italian and was chosen to mark the release of
Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino
Software (IDE) were the reference versions of Arduino, now evolved to
newer releases. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform; for an
extensive list of current, past or outdated boards see the Arduino index
of boards.
Pinout diagram:
About this project:
This simple little project uses an Arduino and some LEDs to
replicate a traffic light. It uses code as an internal timer and continues
to run until you cut the Arduino's power supply .

Source code:
void setup() {
pinMode(10,OUTPUT); //for red light
pinMode(11,OUTPUT); //for yellow light
pinMode(12,OUTPUT); //for green light
Serial.begin(9600); // optional it is to monitor how our code is
//running
}
void loop() {
digitalWrite(10,HIGH); //Red light will turned on for 10 seconds
delay(10000); // delay time declaration
digitalWrite(10,LOW); // after 10 seconds red light will turned off
digitalWrite(11,HIGH); );//Yellow light will turned on for 10 seconds
delay(10000);
digitalWrite(11,LOW); // after 10 seconds yellow light will turned off
digitalWrite(12,HIGH); );//Green light will turned on for 10 seconds
delaly(10000);
digitalWrite(12,LOW);//after 10 seconds green light will turned off
delay(10000); // time for people cross the road
Serial.println(“people can cross the road”);
}

To view the serial monitor window click serial monitor lens icon
on top right corner.

SCHEMATIC:
Connect the jumpers as per our code.
Step1: Connect the ground pin
Yes, I know that there's only one wire where there would usually be two,
but trust me: Follow this exactly the way you see it. I've revised this post over
and over, it's completely correct.
Insert one side of the jumper wire into GND on the board. Lead the other side
to the breadboard. Put it on the far right column on the breadboard, at the top.
This is the ground column. ALL the way to the right. Take a look at the picture
and/or the schematics if you don't understand.
Step 2: Adding the LEDs
Yes, I know that there's only one wire where there would usually be two,
but trust me: Follow this exactly the way you see it. I've revised this post over
and over, it's completely correct.
Insert one side of the jumper wire into GND on the board. Lead the other side
to the breadboard. Put it on the far right column on the breadboard, at the top.
This is the ground column. ALL the way to the right. Take a look at the picture
and/or the schematics if you don't understand.
Step 3: Adding the LEDs
Alright. This is the last part. Take another jumper wire, put it on the same
row that you have an LED on. This is where the wires will go:
Green LED: Port 12, Digital PWM section
Yellow LED, Port 11, Digital PWM section
Red LED, Port 10, Digital PWM section
If you don't understand, check the schematics are refer to the pictures.
Now, upload your code and you're finished!

DAY:
Detail about Arduino:

__Arduino Uno is a microcontroller board based on the


ATmega328P. It has 14 digital input/output pins (of which 6 can be used
as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator
(CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP
header and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or
power it with a AC-to-DC adapter or battery to get started. You can
tinker with your Uno without worrying too much about doing something
wrong, worst case scenario you can replace the chip for a few dollars
and start over again.

"Uno" means one in Italian and was chosen to mark the release of
Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino
Software (IDE) were the reference versions of Arduino, now evolved to
newer releases. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform; for an
extensive list of current, past or outdated boards see the Arduino index
of boards.
Pinout diagram:
RASBERRY PI:
What is Raspberry Pi 4? Pinout, Specs, Projects & Datasheet
 Raspberry Pi 4 is a dual-display, single-board computer (introduced on
24th June, 2019) and is widely used in automation and robotics. It is
highly economical and has a leg over previous modules in terms of
speed and performance.
 This module is tiny, robust, and can fit into difficult-to-reach places. It
is laced with GPIO pins and can be employed for several typical
computer operations i.e. surfing the web, writing programs and
document writing etc.
 Raspberry Pi 4 features Gigabit Ethernet, coupled with Bluetooth and
onboard wireless networking.
 This device comes with a powerful and efficient 1.5GHz quad-core
processor which is considered the brain of this device. It features
everything needed to process input and store information. This CPU
executes the number of instructions consisting of a computer program.

The CPU clock frequency of this machine is 1.5GHz which plays a


key role in the synchronization of internal functions.

This module is available with variants of RAM including 1GB, 2GB,


4GB and 8GB which you can select based on your requirements. The
RAM temporarily stores the information and with the removal of the
power supply from the module, this memory is also wiped off, the
reason it is called volatile memory.

 Two mini HDMI ports are available on the board. These ports are
employed for transmitting audio and video signal between devices.
 This machine supports different communication protocols
including I2C, SPI, and UART which are used to lay out the
communication with external devices.

 Raspberry Pi 4 comes with three USB ports out of which one is a


USB-C power port used to power up the module. While others
are USB 2.0 and USB 3.0 ports. In these USB ports, you can connect
external peripheral devices like mice, webcams, and keyboards for
additional functionality.
 Using this tiny computer you can make a range of embedded projects. Just
connect this module with the computer through the USB port and start
playing with it as you like better.
 Raspberry Pi 4 is normally used in Robotics, IoT and Embedded Projects.
The following represent the Pin diagram of raspberry pi 4,

RPi4

This board comes with three types of power pins.


1. 5V
2. 3V3 (3.3V)
3. Ground (0V)

For example, if you have PIR or humidity sensors, you can use these
power pins to power up those sensors.
GPIO Pins In Raspberry Pi 4
 GPIO pins are general-purpose input/output pins that are used for
connection with external devices. These pins can be configured to
either general-purpose input or general-purpose output pins or as one of
up to six special settings those functions are pin-dependent.

 External labels (from GPIO2 to GPIO27) come with the Broadcom


(BCM) naming convention. This convention is useful when you are
going to program with Python libraries.
 Internal labels (from 1 to 40) project the Board naming convention.
This convention is useful when BCM is not supported. It is used with
some programming libraries.

 This Raspberry Pi 4 module comes with SPI (serial peripheral interface)


communication protocol. This is the type of communication protocol
that is used for master-slave communication.
 It is employed to layout the communication between the controller and
other peripheral devices like shift registers and sensors. Two Pins are
used for SPI communication… i.e. MOSI (master output slave input)
and MISO (master input slave output)
 The data synchronization is done by using a clock (SCLK at GPIO11)
from the master (RPi) and the data is conveyed to the SPI component
from the module using the MOSI pin. If the component needs to reply
to our module, then it sends back data through the MISO pin.i

 This RPi4 module is incorporated with the I2C communication


protocol. That comes with two pins SDL and SCL.
 The SCL is the serial clock line that ensures the synchronization of data
transfer over the I2C bus and the SDL is the serial data pin that carries
the data while. This communication protocol requires master-slave
roles between the devices.

 This board also features UART serial communication protocol. The


UART serial port comes with two pins Rx and Tx.
 The Tx is the transmission pin that is used for the transmission of serial
data and Rx is the receiving pin that guarantees the receiving of serial
data.

Raspberry Pi 4 Datasheet

Before incorporating this device into your project, it’s wise to scan
through the Raspberry Pi 4 datasheet. The datasheet comes with the
main characteristics of the device. You can download the Raspberry Pi 4
datasheet by clicking the link below.
Raspberry Pi 4 Specs
The following are the specs of Raspberry Pi 4.
 Comes with Broadcom BCM2711, Quad-core Cortex-A72 (ARM v8)
64-bit SoC 1.5GHz processor
 4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
 Carries Gigabit Ethernet to connect computers in physical space
 RAM is available with different memories. Pick from 2GB, 4GB, or
8GB LPDDR4-3200 SDRAM (depending on model)
 2-lane MIPI DSI display port
 2-lane MIPI CSI camera port
 One USB 3.0 port; One USB 2.0 port and One USB-C power port.
 2 × micro-HDMI ports that can support 4K display

 4-pole stereo audio and composite video port


 H264 (1080p60 decode, 1080p30 encode), H.265 (4kp60 decode)
 OpenGL ES 3.0 graphics
 Raspberry Pi standard 40 pin GPIO header (which is compatible with
previous modules)
 Contains Micro-SD card slot for loading operating system and data
storage
 5V DC via GPIO header (minimum 3A*)
 Power over Ethernet (PoE) enabled (requires separate PoE HAT)
 Operating temperature: 0 – 50 degrees C ambient
 5V DC via USB-C connector (minimum 3A*)

Difference between Raspberry Pi Zero and Raspberry Pi 4

 You’ll find a range of tiny computers in the Raspberry series. They are
used to develop embedded systems and automation projects.
 Raspberry Pi Zero is the earlier version of the Raspberry Pi series that
was introduced in Nov 2015. This machine is incorporated with a
single-core 1GHz processor with no Ethernet and WiFi modules on the
board. Moreover, there is only one mini HDMI port available on the
board. And the RAM of this module is 512MB.
 While Raspberry Pi 4 is the advanced version of the Raspberry Pi series
and was introduced in June 2019. It is better in terms of speed and
performance compared to the Pi Zero module.
 Raspberry Pi4 features a quad-core dual display processor with a CPU
clock speed of 1.5GHz. Plus, it also incorporates an Ethernet port
which is the traditional way to connect devices in a wired local
area network (LAN) or wide area network (WAN), allowing devices to
communicate with each other via a protocol. An Ethernet is a physical
wire on which the data transmits.
 Raspberry Pi 4 comes with two HDMI ports that can support two 4K
displays. Plus, the RAM of this module comes in variant i.e. pick from
1GB, 2GB, and 4GB LPDDR4.
Raspberry Pi 4 Applications

The following are the Raspberry Pi 4 Applications.


 Used in making a portable game console
 Employed in-network Ad-blocker
 Used in Airplay speaker
 Used in wearable timelapse camera
 Incorporated in-home network music system
 Used in embedded system IoT projects
 Employed in making guitar pedal
 Used in making FPV robot
 Incorporated in WiFi security camera

You might also like