Você está na página 1de 4

Uni-LED Traffic Light

PART NO. 2192077

This is a small scale single RGB LED traffic light with controls from AtTiny85. You will use the supplied Arduino Uno to send
instructions to the ATtiny85.

HOW IT WORKS:
1. The device starts at red LED first for about 3 seconds.
2. Then, the LED turns green for about 6 seconds.
3. Three seconds before green timeout, the green led flashes then goes orange for 1 second.
4. LED will turn red and then repeat steps 1 through four continuously.

Time Required: 30 min to 1 hour depending on experience


Experience Level: Intermediate
Required tools and parts:

-USB-A to USB-B cable to connect the Arduino to your computer.


-Computer with Arduino software installed.

Bill of Materials:

Qty Jameco SKU Component Name


1 2125181 RGB LED
This LED is the display for light status
1 2151312 At-Tiny 85
Works as CPU of the whole system
1 2151486 Arduino Uno R3
1 2155452 Solderless breadboard
1 421315 Jumper Wire test leads, 20 pack

Step 1 - Power Mapping


You will need the breadboard to distribute the jumpers and install the ATtiny.

1. Simple use a red jumper to indicate VCC (5V) and connect from +5V on the Arduino to:
a)Pin 8 At-Tiny
2. Use black jumper to indicate ground GND on Arrduino to:
a)Pin 4 ATtiny
d)Longest pin on the RGB LED (common cathode)
Step 2 - RGB Mapping

1. Connect second longest pin of RGB LED to pin 3 of At-Tiny 85 (NOTED:GREEN COLOR)
2.Connect shortest pin of RGB LED to pin 2 of At-Tiny 85 (NOTED:RED COLOR)

Step 3 - Arduino Warming-up

1. Invoke Arduino software that installed from your computer


2. Select File -> Examples -> ArduinoISP
3.Using Orange jumper wires:(mine,using Arduino Uno)
a) Pin 10 Arduino Uno to Pin 1 At-Tiny 85.
b) Pin 11 Arduino Uno to Pin 5 At-Tiny 85.
c) Pin 12 Arduino Uno to Pin 6 At-Tiny 85.
d) Pin 13 Arduino Uno to Pin 7 At-Tiny 85.
4.Upload the sketch. Make sure board chosen is Arduino Uno (in my case)
Step 4 - Insert Module to At-Tiny 85

1. After completing step 3. Open a new sketch.


2. Select Tools -> Board -> At-Tiny 85 (1Mhz internal clock)
* if your Arduino software does not have board type At-Tiny 85 and stuff..you can visit this MIT High-Low Tech page to get file ATtiny
master.zip and follow steps shown in the website.
http://hlt.media.mit.edu/?p=1695
3. Insert source code.

int R=3,G=4; // PIN 2 AT-TINY =3 , PIN 3 AT-TINY = 4 (REFER PICTURE)


void setup()
{
pinMode(R, OUTPUT);
pinMode(G, OUTPUT);
}

void loop()
{
digitalWrite(R, HIGH);
delay(4000); // MILI-SECONDS FOR RED LED ON
digitalWrite(R, LOW);
digitalWrite(G, HIGH);
delay(3000); // MILI-SECONDS FOR LED ON MINUS 3 SECONDS (6000-3000=3000)

digitalWrite(G,LOW); // BLINKING CONDITION


delay(500);
digitalWrite(G,HIGH);
delay(500);
digitalWrite(G,LOW);
delay(500);
digitalWrite(G,HIGH);
delay(500);
digitalWrite(G,LOW);
delay(500);
digitalWrite(G,HIGH);
delay(500);

digitalWrite(R, HIGH); // YELLOW LIGHT (R+G=Y)


delay(1000); // YELLOW TO ON IN MILI-SECONDS
digitalWrite(G, LOW);// TURNS BACK TO RED
}

4. UPLOAD sketch.
5. Your comments below the source code space will give output almost likely as this.
'Done uploading'

'Binary sketch size: 990 bytes (of a 8,192 byte maximum)


avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85'
*it is normal and it shows that your sourcecode sucessfully programmed into At-Tiny 85.
Step 5 - [OPTIONAL] Soldering to PCB

1. Additional material, that not included from the main project:


a) Mini-a usb female port
b) 8 pin IC socket
c) and of course..a PCB.

2. Solder mini-a usb female,8 pin IC Socket and rgb led to the PCB
3. Attach At-Tiny 85 to the IC socket.
4. All ready to go. Plug in male mini-a usb to the female that is on board.

Você também pode gostar