0% found this document useful (0 votes)
33 views6 pages

Practical Notes

The document outlines practical exercises for electronics circuit design using microcontrollers, specifically focusing on projects like a blinking LED, one-way traffic light, and four-way traffic lights. Each project includes a list of components, circuit diagrams, and Arduino code for implementation and simulation using software like Proteus. Additionally, it emphasizes the importance of simulating Kirchhoff's laws and using virtual instruments for measurements.

Uploaded by

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

Practical Notes

The document outlines practical exercises for electronics circuit design using microcontrollers, specifically focusing on projects like a blinking LED, one-way traffic light, and four-way traffic lights. Each project includes a list of components, circuit diagrams, and Arduino code for implementation and simulation using software like Proteus. Additionally, it emphasizes the importance of simulating Kirchhoff's laws and using virtual instruments for measurements.

Uploaded by

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

COMPUTER AND HAND-ON PRACTICALS FOR ELECTRONICS

CIRCUIT DESIGN
1. Blinking Led
Aim: To impart knowledge on working of simple digital circuit using microcontroller.
Components and Devices:
a) Arduino Uno Borad
b) Jumper Wires
c) Breadboard
d) 1 Light Emitting Diode (LED)
e) 9V battery or 5V Dc power supply
f) Simulation Software (Proteus or LT-Spice)
g) 220Ω
Circuit Diagram:

Codes for Blinking LED:


Procedures
a) Prepare required components as listed above for the actual practical then connect them
according to the circuit diagram.
b) Open Proteus software and then in component mode select the required components
then draw the circuit.
c) Write code in Arduino IDE then very and compile them then copy .hex file path then
paste as editing properties to Arduino in proteus, then perform simulation. For actual
component connect 5V Power supply to Arduino board, or use 9V battery and connector
or connect directly with the computer using UART, then upload the codes and see the
result.

Results:

At the coded delay the LED will turn ON and OFF.

2. One Way Traffic Light


Aim: To impart knowledge on working of simple digital circuit using microcontroller.
Components and Devices:
h) Arduino Uno Borad
i) Jumper Wires
j) Breadboard
k) 1 LED each for GREEN, YELLOW and RED
l) 9V battery or 5V Dc power supply
m) Simulation Software (Proteus or LT-Spice)
n) Three 220Ω Resistors
Circuit Diagram:
Codes:
int LedGreen = 9;
int LedYellow = 10;
int LedRed = 11;

void setup() {
pinMode(LedGreen, OUTPUT);
pinMode(LedYellow, OUTPUT);
pinMode(LedRed, OUTPUT);
}

void loop() {
// GREEN Light is ON for 1000ms
digitalWrite(LedGreen, HIGH);
digitalWrite(LedYellow, LOW);
digitalWrite(LedRed, LOW);
delay(1000);

// YELLOW Light is ON for 200ms (transition)


digitalWrite(LedGreen, LOW);
digitalWrite(LedYellow, HIGH);
digitalWrite(LedRed, LOW);
delay(200);

// RED Light is ON for 1000ms


digitalWrite(LedGreen, LOW);
digitalWrite(LedYellow, LOW);
digitalWrite(LedRed, HIGH);
delay(1000);

// YELLOW Light is ON for 200ms (transition)


digitalWrite(LedGreen, LOW);
digitalWrite(LedYellow, HIGH);
digitalWrite(LedRed, LOW);
delay(200);
}
Procedures:
Use the above procedure in practical one.
Results:
3. 4-Way Traffic Lights
Aim: To impart knowledge on working of simple digital circuit using microcontroller.
Components and Devices:
a) Arduino Uno Borad (2)
b) Jumper Wires
c) Breadboard
d) 4 LED each for GREEN, YELLOW and RED Light.
e) 9V battery or 5V Dc power supply
f) Simulation Software (Proteus or LT-Spice)
g) Twelve 220Ω

Circuit Diagram:

Code:

Codes for Arduino 1 (ARD 1) Codes for Arduino 2 (ARD 2)


// For Kange Road // For Kange Road
int kRed = 7; int mRed = 7;
int kYellow = 8; int mYellow = 8;
int kGreen = 9; int mGreen = 9;
//For Forodhani Road //For Forodhani Road
int fRed = 10; int sRed = 10;
int fYellow = 11; int sYellow = 11;
int fGreen = 12; int sGreen = 12;

void setup () { void setup () {


pinMode (kRed, OUTPUT); pinMode (mRed, OUTPUT);
pinMode (kYellow, OUTPUT); pinMode (mYellow, OUTPUT);
pinMode (kGreen, OUTPUT); pinMode (mGreen, OUTPUT);

pinMode (fRed, OUTPUT); pinMode (sRed, OUTPUT);


pinMode (fYellow, OUTPUT); pinMode (sYellow, OUTPUT);
pinMode (fGreen, OUTPUT); pinMode (sGreen, OUTPUT);
} }

void loop() { void loop() {


// Kange Road Vehicle Allowed //Both Mkwakwani and Stand Road are
digitalWrite (kRed, LOW); not Allowed
digitalWrite (kYellow, LOW); digitalWrite (mRed, HIGH);
digitalWrite (kGreen, HIGH); digitalWrite (mYellow, LOW);
digitalWrite (mGreen, LOW);
//Forodhani Vehicle not allowed //Forodhan cars allowed
digitalWrite (fRed, HIGH); digitalWrite (sRed, HIGH);
digitalWrite (fYellow, LOW); digitalWrite (sYellow, LOW);
digitalWrite (fGreen, LOW); digitalWrite (sGreen, LOW);
delay (1000); delay (2200);

//Lights Shifts //Light Shifts


digitalWrite (kRed, LOW); digitalWrite (mRed, LOW);
digitalWrite (kYellow, HIGH); digitalWrite (mYellow, HIGH);
digitalWrite (kGreen, LOW); digitalWrite (mGreen, LOW);
digitalWrite (fRed, LOW); digitalWrite (sRed, HIGH);
digitalWrite (fYellow, HIGH); digitalWrite (sYellow, LOW);
digitalWrite (fGreen, LOW); digitalWrite (sGreen, LOW);
delay (200); delay (200);

//Kange Cars not allowed // Mkwakwani Road Vehicle Allowed


digitalWrite (kRed, HIGH); digitalWrite (mRed, LOW);
digitalWrite (kYellow, LOW); digitalWrite (mYellow, LOW);
digitalWrite (kGreen, LOW); digitalWrite (mGreen, HIGH);

//Forodhan cars allowed //Stand Vehicle not allowed


digitalWrite (fRed, LOW); digitalWrite (sRed, HIGH);
digitalWrite (fYellow, LOW); digitalWrite (sYellow, LOW);
digitalWrite (fGreen, HIGH); digitalWrite (sGreen, LOW);
delay (1000); delay (1000);

//Light shifts //Lights Shifts


digitalWrite (kRed, HIGH); digitalWrite (mRed, LOW);
digitalWrite (kYellow, LOW); digitalWrite (mYellow, HIGH);
digitalWrite (kGreen, LOW); digitalWrite (mGreen, LOW);
digitalWrite (fRed, LOW); digitalWrite (sRed, LOW);
digitalWrite (fYellow, HIGH); digitalWrite (sYellow, HIGH);
digitalWrite (fGreen, LOW); digitalWrite (sGreen, LOW);
delay (200); delay (200);

//Both Forodhani and Kange Road are //Mkwakwani Cars not allowed
not Allowed digitalWrite (mRed, HIGH);
digitalWrite (kRed, HIGH); digitalWrite (mYellow, LOW);
digitalWrite (kYellow, LOW); digitalWrite (mGreen, LOW);
digitalWrite (kGreen, LOW);
digitalWrite (fRed, HIGH); //Stand cars allowed
digitalWrite (fYellow, LOW); digitalWrite (sRed, LOW);
digitalWrite (fGreen, LOW); digitalWrite (sYellow, LOW);
delay (2200); digitalWrite (sGreen, HIGH);
delay (1000);
//Light Shifts
digitalWrite (kRed, LOW); //Light shifts
digitalWrite (kYellow, HIGH); digitalWrite (mRed, HIGH);
digitalWrite (kGreen, LOW); digitalWrite (mYellow, LOW);
digitalWrite (fRed, HIGH); digitalWrite (mGreen, LOW);
digitalWrite (fYellow, LOW); digitalWrite (sRed, LOW);
digitalWrite (fGreen, LOW); digitalWrite (sYellow, HIGH);
delay(200); digitalWrite (sGreen, LOW);
} delay (200);

RESULTS:

Note:

Also perform simulations of the Kirchhoff’s laws and analysis and be able to perform
measurement using different virtual instruments in Proteus software.

You might also like