1 / 2
New York City Pedestrian Traffic Light — image 1
1 / 2

New York City Pedestrian Traffic Light

Order a print of this model

We calculate the final price from your selected file. You review and accept it before payment.

Saved on this device.

This is my interpretation of the classic New York City pedestrian traffic light.

Rating
0 / 5
Likes
67
Downloads
197
Makes
1
Views
1,610
Reviews
0

Updated at source:

Model information

Category
Home Decor
License
Creative Commons — Attribution — Noncommercial

This decorative lamp is meant to represent a pedestrian traffic light. Inside the housing there is space for LED Strips. I powered my version with an ATTINY 13a, which runs a little script for the light sequence. The code can be found below.

The model can be printed entirely on the Prusa Mini, though you need to turn off the skirt for some parts. The housing needs to be printed with a layer height of 0.15mm, otherwise the slicer will place some of the support material outside of the build volume.

To finish the build you'll need m3x10 thread cutting screws, a micro-USB breakout board (such as:  https://tinyurl.com/USBbreakout) and a little switch. To stop the light from shining through the walls, I used ducktape.

Code:

#define pinRed 3
#define pinWhite 4
#define pinSwitch 2

unsigned long lastTime = 0; // Keeps track of the time

void setup() { // setup code: pinMode(pinRed, OUTPUT); pinMode(pinWhite, OUTPUT); pinMode(pinSwitch, INPUT); digitalWrite(pinRed, LOW); digitalWrite(pinWhite, LOW); }

void loop() { if(digitalRead(pinSwitch) == HIGH){ // If the switch is on, both red and white are turned on digitalWrite(pinRed, HIGH); digitalWrite(pinWhite, HIGH); }else{ // If the switch is off, the traffic light sequence is used digitalWrite(pinRed, LOW); digitalWrite(pinWhite, HIGH); lastTime = millis(); while(millis() - lastTime < 30000){ // White is turned on for 30 seconds if(digitalRead(pinSwitch) == HIGH){ // If the switch is turned on, the sequence is aborted and the program returns to the beginnig of loop() return; } } digitalWrite(pinWhite, LOW); for(int i = 0; i<7; i++){ // Red blinks 6 times before being turned on continuesly digitalWrite(pinRed, HIGH); lastTime = millis(); while(millis() - lastTime < 500){ if(digitalRead(pinSwitch) == HIGH){ // If the switch is turned on, the sequence is aborted and the program returns to the beginnig of loop() return; } } digitalWrite(pinRed, LOW); lastTime = millis(); while(millis() - lastTime < 500){ if(digitalRead(pinSwitch) == HIGH){ // If the switch is turned on, the sequence is aborted and the program returns to the beginnig of loop() return; } } } digitalWrite(pinRed, HIGH); lastTime = millis(); while(millis() - lastTime < 30000){ // Red is turned on for 30 seconds if(digitalRead(pinSwitch) == HIGH){ // If the switch is turned on, the sequence is aborted and the program returns to the beginnig of loop() return; } } } }

Tags