• Models
  • Contests
  • Slicer
  • Login
  • Start Here
    thingiverse-iconprintables-iconcults3d-iconmakerworld-iconmyminifactory-icon

    3D GO

    3D ModelsContestsCollectionsSaved ModelsOn a mobile device?

3D GO

Privacy Policy
Traffic light model  3D Printer File Image 1
Traffic light model  3D Printer File Image 2
Traffic light model  3D Printer File Image 3
Traffic light model  3D Printer File Thumbnail 1
Traffic light model  3D Printer File Thumbnail 2
Traffic light model  3D Printer File Thumbnail 3

Traffic light model

Jimnythecar avatarJimnythecar

May 16, 2024

makerworld-icon
DescriptionCommentsTags

Description

Boost MeIf you liked it, please support me with boosts!

Arduino-powered traffic light toy for kids diecast car.

 

It's not perfect for publishing here, but I upload this since someone may be think it's useful.

This is an initial version and many things need to be improved.

But, what's important, it's working!

 

Below is the latch power circuit for the button.

 

Personally, I added a piezo speaker's positive end to pin 2 so that it makes sounds.

3, 4, 5 are for red, orange, and green positive LED leeds located oppose direction.

6, 7, 8 are red, orange, and green of orthogonal direction to the above ones.

 

I used SeeduinoXiao RP 2040, but any small Arduino fits inside the case should work with appropriate pin mapping.

It works with two AAA battries.

 

I purchased these springs for batteries.

https://www.amazon.com/dp/B08Y5HVKLH?ref=ppx_yo2ov_dt_b_product_details&th=1

 

and these red, orange, green leds.

https://www.amazon.com/dp/B09MWJ7SGF?ref=ppx_yo2ov_dt_b_product_details&th=1

https://www.amazon.com/dp/B09MWGTBW6?ref=ppx_yo2ov_dt_b_product_details&th=1

https://www.amazon.com/dp/B09MWGRRTP?ref=ppx_yo2ov_dt_b_product_details&th=1

 

Below is the source code for running the light.

 

void setup() {

pinMode(D0, OUTPUT);

digitalWrite(D0, HIGH);

 

pinMode(D2, OUTPUT);

pinMode(D3, OUTPUT);

pinMode(D4, OUTPUT);

 

pinMode(D5, OUTPUT);

 

pinMode(D6, OUTPUT);

 

pinMode(D7, OUTPUT);

}


 

void loop() {

for (int i = 0; i < 20; i++) {

change(0, 0);

change(1, 2);

alarm(250, 0);

change(1, 1);

delay(2000);

change(1, 0);

delay(2000);

change(0, 2);

alarm(150, 175);

change(0, 1);

delay(2000);

change(0, 0);

delay(2000);

}

 

digitalWrite(D0, LOW);

}


 

void change(int group, int color) {

if (group == 0) {

digitalWrite(D2, color == 0 ? HIGH : LOW);

digitalWrite(D3, color == 1 ? HIGH : LOW);

digitalWrite(D4, color == 2 ? HIGH : LOW);

} else if (group == 1) {

digitalWrite(D5, color == 0 ? HIGH : LOW);

digitalWrite(D6, color == 1 ? HIGH : LOW);

digitalWrite(D7, color == 2 ? HIGH : LOW);

}

}


 

void alarm(int duration, int gap) {

for (int i = 0; i < 5; i++) {

tone(D1, 4000, duration);

delay(gap);

tone(D1, 4000, duration);

delay(1000);

}

 

for (int i = 0; i < 5; i++) {

tone(D1, 4000, 250);

delay(500);

}

}

 

I'll try to update so that everyone not familiar to this can enjoy it.

License:

BY-NC

Related Models

V29 preview image

V29

jzisa profile image

jzisa

81,266

DUMMY 13 Printable Jointed Figure (BETA FILES) preview image

DUMMY 13 Printable Jointed Figure (BETA FILES)

soozafone profile image

soozafone

23,207

Lightsaber Keychain (Retractable) preview image

Lightsaber Keychain (Retractable)

JosayaJosh profile image

JosayaJosh

12,166

Self-Watering Planter (Small) preview image

Self-Watering Planter (Small)

parallelgoods profile image

parallelgoods

73,060

LUCKY 13 Printable Jointed Figure preview image

LUCKY 13 Printable Jointed Figure

soozafone profile image

soozafone

20,202

Tiny Ball Python Flexi Snake preview image

Tiny Ball Python Flexi Snake

Paulies Prints profile image

Paulies Prints

1,532

Modular Mounting System preview image

Modular Mounting System

HeyVye profile image

HeyVye

69,071

Rotating Rings Toy preview image

Rotating Rings Toy

Marvin profile image

Marvin

21,785