SlideShare a Scribd company logo
ET 320 – Microprocessors
Assignment #1 – LEDs with DIPs switches
By Bach Nguyen
Instructor: Dr. Cris Koutsougeras
Abstract
LEDs and DIPs switches are common electronic objects that are the foundation of
modern electronics. LED lighting products use light emitting diodes to produce light very
efficiently. An electrical current passes through semiconductor material, which illuminates the
tiny light sources we call LEDs. The heat produced is absorbed into a heat sink. Common LED
colors include amber, red, green, and blue. Colored LEDs are widely used as signal lights and
indicator lights, like the power button on a computer. LEDs are better than fluorescent and
incandescent light bulbs considering the less power and space consumption. A dip switch is a set
of small switches in a dual in-line package (DIP) that is used to change the operating mode of a
device. Dip switches are used to configure computer peripherals such as hard drives, modems,
sound cards, and motherboards.
Objective
A prototyping board will be equipped with dip switches and LEDs. An array of 4
switches which can be placed in random on-off combinations by a user. The Arduino must
continuously read the values of the 4 switches and display the array of values on a corresponding
output array of LEDs. So the LEDs must indicate the positions of the switches at all times.
Warning: there must be no direct signal path from the switches to the LEDs. The LEDs must be
under the control of the Arduino and its programming.
Methodology and Schematics
Arduino Codes:
int led1 = 2;
int led2 = 3;
int led3 = 4;
int led4 = 5;
int s1 = 6;
int s2 = 7;
int s3 = 8;
int s4 = 9;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(s1, INPUT);
pinMode(s2, INPUT);
pinMode(s3, INPUT);
pinMode(s4, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
if (digitalRead(s1) == HIGH){
digitalWrite(led1,HIGH);
}
else digitalWrite(led1,LOW);
if (digitalRead(s2) == HIGH){
digitalWrite(led2,HIGH);
}
else digitalWrite(led2,LOW);
if (digitalRead(s3) == HIGH){
digitalWrite(led3,HIGH);
}
else digitalWrite(led3,LOW);
if (digitalRead(s4) == HIGH){
digitalWrite(led4,HIGH);
}
else digitalWrite(led4,LOW);
delay(100);
}
Schematic:
The switches are wired to the Arduino as inputs and the outputs are perceiving as LEDs
according to the switches. When the switches are turn on the LEDs will be turn on according to
which ever switch is in on position.
Protoboard Application
Troubleshooting and Improvement
There are not really any inherit issues with the design since it’s quite simple and straight
forward. Improvement that could be made to the design is that the switches could be changed to
smaller DIPs switches, bigger LEDs for better viewing.
Conclusion
This project has helped myself demonstrate the use of a simple circuit that can be
controlled by an Arduino.
Work Cited
https://circuits.io/circuits/3731694-et-320-assignment-1-led-and-dips-switches#breadboard –
Circuits and schematics
"Learn About LED Bulbs." ENERGY STAR. N.p., n.d. Web. 01 Feb. 2017.
"What Is Dip Switch?" What Is Dip Switch? N.p., n.d. Web. 01 Feb. 2017.

More Related Content

What's hot

Smart Lighting Using IOT
Smart Lighting Using IOTSmart Lighting Using IOT
Smart Lighting Using IOT
Shrikant Chandan
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
Makers of India
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
Jawaher Abdulwahab Fadhil
 
Our Arduino project
Our Arduino projectOur Arduino project
Our Arduino project
Violetajeje
 
Our Arduino Project
Our Arduino ProjectOur Arduino Project
Our Arduino Project
Violetajeje
 
Unit6 p7 andrea&naila.zip.
Unit6 p7 andrea&naila.zip.Unit6 p7 andrea&naila.zip.
Unit6 p7 andrea&naila.zip.
Violetajeje
 
Arduino Uno Pin Description
Arduino Uno Pin DescriptionArduino Uno Pin Description
Arduino Uno Pin Description
Niket Chandrawanshi
 
Arduino - Block Programming using XOD IDE (No Code)
Arduino - Block Programming using XOD IDE (No Code)Arduino - Block Programming using XOD IDE (No Code)
Arduino - Block Programming using XOD IDE (No Code)
Robocraze
 
Arduino - CH 1: The Trick Switch
Arduino - CH 1: The Trick SwitchArduino - CH 1: The Trick Switch
Arduino - CH 1: The Trick Switch
Ratzman III
 
Arduino boards
Arduino boardsArduino boards
Arduino boards
RaquelLaura2
 
Arduino Mario Belinchón
Arduino Mario BelinchónArduino Mario Belinchón
Arduino Mario Belinchón
MARIOBELINCHON
 
Arduino board
Arduino boardArduino board
Arduino board
CenoaBenipez
 
Robotics and Embedded Systems
Robotics and Embedded SystemsRobotics and Embedded Systems
Robotics and Embedded Systems
Ankan Naskar
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
Rahat Sood
 
Arduino embedded systems and advanced robotics
Arduino embedded systems and advanced roboticsArduino embedded systems and advanced robotics
Arduino embedded systems and advanced robotics
Shubham Bhattacharya
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
student
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
Ravi Phadtare
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'
tsyogesh46
 
Porte à puce - Smart Safety Door based on Arduino UNO R3
Porte à puce - Smart Safety Door based on Arduino UNO R3Porte à puce - Smart Safety Door based on Arduino UNO R3
Porte à puce - Smart Safety Door based on Arduino UNO R3
Meifani Sumadijaya
 

What's hot (20)

Smart Lighting Using IOT
Smart Lighting Using IOTSmart Lighting Using IOT
Smart Lighting Using IOT
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
Our Arduino project
Our Arduino projectOur Arduino project
Our Arduino project
 
Our Arduino Project
Our Arduino ProjectOur Arduino Project
Our Arduino Project
 
Unit6 p7 andrea&naila.zip.
Unit6 p7 andrea&naila.zip.Unit6 p7 andrea&naila.zip.
Unit6 p7 andrea&naila.zip.
 
Arduino Uno Pin Description
Arduino Uno Pin DescriptionArduino Uno Pin Description
Arduino Uno Pin Description
 
Arduino - Block Programming using XOD IDE (No Code)
Arduino - Block Programming using XOD IDE (No Code)Arduino - Block Programming using XOD IDE (No Code)
Arduino - Block Programming using XOD IDE (No Code)
 
Arduino - CH 1: The Trick Switch
Arduino - CH 1: The Trick SwitchArduino - CH 1: The Trick Switch
Arduino - CH 1: The Trick Switch
 
Arduino boards
Arduino boardsArduino boards
Arduino boards
 
Arduino Mario Belinchón
Arduino Mario BelinchónArduino Mario Belinchón
Arduino Mario Belinchón
 
Arduino board
Arduino boardArduino board
Arduino board
 
Robotics and Embedded Systems
Robotics and Embedded SystemsRobotics and Embedded Systems
Robotics and Embedded Systems
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Arduino embedded systems and advanced robotics
Arduino embedded systems and advanced roboticsArduino embedded systems and advanced robotics
Arduino embedded systems and advanced robotics
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'
 
Porte à puce - Smart Safety Door based on Arduino UNO R3
Porte à puce - Smart Safety Door based on Arduino UNO R3Porte à puce - Smart Safety Door based on Arduino UNO R3
Porte à puce - Smart Safety Door based on Arduino UNO R3
 

Similar to LEDs and DIPs Switches

Interfacing of a LED display with laptop using Arduino
Interfacing of a LED display with laptop using ArduinoInterfacing of a LED display with laptop using Arduino
Interfacing of a LED display with laptop using Arduino
Diksha Prakash
 
SKAD Electronics Training Manual.pdf
SKAD Electronics Training Manual.pdfSKAD Electronics Training Manual.pdf
SKAD Electronics Training Manual.pdf
KadiriIbrahim2
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptx
Mokete5
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensors
saritasapkal
 
Chapter 5 Arduino Microcontroller Systems .pptx
Chapter 5 Arduino Microcontroller Systems .pptxChapter 5 Arduino Microcontroller Systems .pptx
Chapter 5 Arduino Microcontroller Systems .pptx
khgh7
 
IOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfIOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdf
MayuRana1
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
SanthanaMari11
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
 
Arduino - Ch 2: Sunrise-Sunset Light Switch
Arduino - Ch 2: Sunrise-Sunset Light SwitchArduino - Ch 2: Sunrise-Sunset Light Switch
Arduino - Ch 2: Sunrise-Sunset Light Switch
Ratzman III
 
Neno Project.docx
Neno Project.docxNeno Project.docx
Neno Project.docx
AditiBhushan3
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
ssuser0e9cc4
 
How to hack electronics
How to hack electronics How to hack electronics
How to hack electronics
Planning-ness
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
Kishor Mhaske
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
ZainIslam20
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
AkhandPratapSingh86
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbook
Felipe Belarmino
 
IOTC08 The Arduino Platform
IOTC08 The Arduino PlatformIOTC08 The Arduino Platform
IOTC08 The Arduino Platform
Eoin Brazil
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
salih mahmod
 
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
Jayanthi Kannan MK
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch example
mraziff2009
 

Similar to LEDs and DIPs Switches (20)

Interfacing of a LED display with laptop using Arduino
Interfacing of a LED display with laptop using ArduinoInterfacing of a LED display with laptop using Arduino
Interfacing of a LED display with laptop using Arduino
 
SKAD Electronics Training Manual.pdf
SKAD Electronics Training Manual.pdfSKAD Electronics Training Manual.pdf
SKAD Electronics Training Manual.pdf
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptx
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensors
 
Chapter 5 Arduino Microcontroller Systems .pptx
Chapter 5 Arduino Microcontroller Systems .pptxChapter 5 Arduino Microcontroller Systems .pptx
Chapter 5 Arduino Microcontroller Systems .pptx
 
IOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdfIOT WORKSHEET 1.4.pdf
IOT WORKSHEET 1.4.pdf
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Arduino - Ch 2: Sunrise-Sunset Light Switch
Arduino - Ch 2: Sunrise-Sunset Light SwitchArduino - Ch 2: Sunrise-Sunset Light Switch
Arduino - Ch 2: Sunrise-Sunset Light Switch
 
Neno Project.docx
Neno Project.docxNeno Project.docx
Neno Project.docx
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
 
How to hack electronics
How to hack electronics How to hack electronics
How to hack electronics
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbook
 
IOTC08 The Arduino Platform
IOTC08 The Arduino PlatformIOTC08 The Arduino Platform
IOTC08 The Arduino Platform
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch example
 

LEDs and DIPs Switches

  • 1. ET 320 – Microprocessors Assignment #1 – LEDs with DIPs switches By Bach Nguyen Instructor: Dr. Cris Koutsougeras
  • 2. Abstract LEDs and DIPs switches are common electronic objects that are the foundation of modern electronics. LED lighting products use light emitting diodes to produce light very efficiently. An electrical current passes through semiconductor material, which illuminates the tiny light sources we call LEDs. The heat produced is absorbed into a heat sink. Common LED colors include amber, red, green, and blue. Colored LEDs are widely used as signal lights and indicator lights, like the power button on a computer. LEDs are better than fluorescent and incandescent light bulbs considering the less power and space consumption. A dip switch is a set of small switches in a dual in-line package (DIP) that is used to change the operating mode of a device. Dip switches are used to configure computer peripherals such as hard drives, modems, sound cards, and motherboards. Objective A prototyping board will be equipped with dip switches and LEDs. An array of 4 switches which can be placed in random on-off combinations by a user. The Arduino must continuously read the values of the 4 switches and display the array of values on a corresponding output array of LEDs. So the LEDs must indicate the positions of the switches at all times. Warning: there must be no direct signal path from the switches to the LEDs. The LEDs must be under the control of the Arduino and its programming. Methodology and Schematics Arduino Codes: int led1 = 2; int led2 = 3; int led3 = 4; int led4 = 5; int s1 = 6; int s2 = 7;
  • 3. int s3 = 8; int s4 = 9; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); pinMode(led4, OUTPUT); pinMode(s1, INPUT); pinMode(s2, INPUT); pinMode(s3, INPUT); pinMode(s4, INPUT); } // the loop routine runs over and over again forever: void loop() { if (digitalRead(s1) == HIGH){ digitalWrite(led1,HIGH); } else digitalWrite(led1,LOW); if (digitalRead(s2) == HIGH){ digitalWrite(led2,HIGH); } else digitalWrite(led2,LOW); if (digitalRead(s3) == HIGH){ digitalWrite(led3,HIGH); } else digitalWrite(led3,LOW); if (digitalRead(s4) == HIGH){ digitalWrite(led4,HIGH); } else digitalWrite(led4,LOW); delay(100); } Schematic:
  • 4.
  • 5. The switches are wired to the Arduino as inputs and the outputs are perceiving as LEDs according to the switches. When the switches are turn on the LEDs will be turn on according to which ever switch is in on position. Protoboard Application
  • 6.
  • 7. Troubleshooting and Improvement There are not really any inherit issues with the design since it’s quite simple and straight forward. Improvement that could be made to the design is that the switches could be changed to smaller DIPs switches, bigger LEDs for better viewing. Conclusion This project has helped myself demonstrate the use of a simple circuit that can be controlled by an Arduino.
  • 8. Work Cited https://circuits.io/circuits/3731694-et-320-assignment-1-led-and-dips-switches#breadboard – Circuits and schematics "Learn About LED Bulbs." ENERGY STAR. N.p., n.d. Web. 01 Feb. 2017. "What Is Dip Switch?" What Is Dip Switch? N.p., n.d. Web. 01 Feb. 2017.