I’ve been exploring the concept of creating a decorative traffic light. Using TinkerCad’s circuit designer, I successfully designed a circuit that incorporates an Arduino Microcontroller, three N-type MOSFETs, and several bulbs. The Arduino code is straightforward:
#define RED 2
#define YELLOW 3
#define GREEN 4
void setup() {
pinMode(RED, OUTPUT);
pinMode(YELLOW, OUTPUT);
pinMode(GREEN, OUTPUT);
}
void loop() {
digitalWrite(RED, HIGH);
digitalWrite(YELLOW, LOW);
digitalWrite(GREEN, LOW);
delay(30000);
digitalWrite(RED, LOW);
digitalWrite(YELLOW, LOW);
digitalWrite(GREEN, HIGH);
delay(10000);
digitalWrite(RED, LOW);
digitalWrite(YELLOW, HIGH);
digitalWrite(GREEN, LOW);
delay(30000);
}
You can view the project here.
Currently, I’m uncertain whether the MOSFETs can handle the required amperage for the bulbs. I’m considering adding heat sinks to the MOSFETs to help dissipate any heat generated and potentially using LED bulbs for efficiency.