Band 1 · Signal Tower
Swap The traffic light module
The same sequence you built by hand, on a module with four wires. Then find the resistors somebody fitted for you.
Sketches for this project
Every file opens with a plain-English header saying what it does and how to wire it, hole by hole.
Do this one second, not first
This is a Swap with a condition attached, and the condition matters.
Build the three loose LEDs by hand first. Wire the resistors yourself, get one of them backwards, find out why nothing lit, fix it. Then come here.
The module is four wires and no resistors. It is faster, tidier, and it works first time. All of which makes it a bad way to learn what a resistor is for, and a very good way to find out what a module is once you already know.
The question this build exists to ask
Your hand-wired tower needed three resistors. This module needs none.
So where did they go?
They did not go anywhere. Somebody fitted them, on the board, before it reached you, and charged you for the convenience. Part of this build is going to find them with your eyes.
Five wires, no resistors
20 minj, the same pair Band 1 uses. Put every rail wire on that pair and it works; split them across both and nothing lights, with nothing visibly wrong.Read your own module before you wire it
The pins are marked on the board itself, next to the header. Look at yours rather than trusting any page, including this one.
The common kind, and what the sketch assumes. The three colour pins go to Arduino pins and GND goes to the − rail.
→ Wire it as the table says. Nothing to change.
A common-anode module. The fourth pin goes to 5V instead, and the lights come on when the sketch says LOW rather than HIGH.
→ Swap every HIGH and LOW in the sketch. Everything else is identical.
| Module pin | Arduino pin | Which light |
|---|---|---|
R | 9 | Red |
Y | 8 | Yellow |
G | 7 | Green |
GND | the − rail | the shared return path |
Then one wire from the − rail to a GND pin, as always. That is five wires in all, or four if you take the module's GND straight to an Arduino GND pin and skip the rail. The hand-wired tower took seven, plus three resistors and three LEDs to place the right way round.
Push the module into the breadboard so its four pins land side by side in four different columns, one pin per column, all at the same row letter. If the pins are on a right-angle header instead, run jumper wires straight to them and skip the breadboard.
Upload b1_05_traffic_module.ino.
GND or VCC: if it is VCC it goes to 5V, and with it on the − rail the module is simply not powered.HIGH and LOW in the sketch and it comes right.Find the resistors
20 minTurn the module over, or look closely at the front near the lights.
221, 102 or 101.Those are your resistors. They were there all along.
Reading a surface-mount resistor
They do not use colour stripes at this size. They use three digits: the first two are the number, and the third says how many zeros to add.
221means 22 with 1 zero, so 220 ohms. The same value you used by hand.102means 10 with 2 zeros, so 1000 ohms. That would make the lights noticeably dimmer.101means 10 with 1 zero, so 100 ohms. This one is worth stopping at. With five volts on the pin and about two across a red LED, 100 ohms lets through roughly 30 thousandths of an amp, and an Arduino pin is rated for 20. It works, it is bright, and it is over the line. You would not choose it. Somebody did, to make the module look good on a shelf.
If yours says 101, the module is still safe enough to use for this build, because only one or two lights are on at a time and the pin survives being pushed a little. It is a good example of the difference between works and right, and of what you give up when the choice is made for you. Write it in your log.
Write down what yours say. Then compare your module's brightness with your hand-wired tower's. If the numbers differ, you should be able to see the difference, and you now know exactly why.
Now compare the two sketches
Open b1_05_traffic_module.ino and b1_03_signal_variables.ino side by side. Not b1_02: that is the hard-coded one, and against it almost everything changed.
Answer these in your build log
- What actually changed between the two sketches?
- Did you learn a new idea to do this build, or point an old one at new hardware?
- The module took five wires and no resistors. The tower took seven wires and three resistors. Name one thing you gave up in exchange.
- If a module's resistor turned out to be the wrong value for your LEDs, what could you do about it?
Something to check yourself against
1. Look properly, because the answer is stranger than you expect. Nothing changed. Not the pin numbers, not the timings, not the states. b1_05 is b1_03 with the four repeated blocks folded into one showState function called four times, and that tidying has nothing whatever to do with the module. The board could not tell the difference between your tower and this module if it tried, because from the pin's point of view there is no difference: three pins, three lights, one shared return.
2. An old one at new hardware. That is worth noticing, because most of what looks like new learning in electronics turns out to be this.
3. The choice. You cannot pick the resistor, you cannot use a different colour LED, and you cannot move one light somewhere else on the board. A module trades flexibility for speed, and that is a fine trade as long as you make it knowingly.
4. Almost nothing, short of unsoldering it. That is the honest answer, and it is the reason a hand-wired circuit is not simply a worse version of a module.
Make it yours
25 min- Bronze
- Give the module a real crossing's fifth state: a flashing green just before the yellow, three flashes in one second, warning drivers that the light is about to change. You will need more
showStatecalls, not new ideas. Say in your log how many lines you added. - Silver
- You need the hand-wired tower back on the board for this. If you took it down for room, rebuild it from your photograph first: that is a fair fifteen minutes, and it is also the last time you will ever wire three LEDs from nothing. Run the module and the tower at the same time, as two crossings on the same road, so that one is red while the other is green. They cannot share a single pin. Look at your tower and write down which three pins it is actually on: if you did Band 1's Bronze task, its yellow light is on pin 12 rather than pin 8. Then move the module to pins
4,3and2, which nothing else uses, change its three wires, and change the three lines at the top of the sketch that name them. Then you need six pin names, not three, and that is the moment naming your variables stops being a style rule and starts being the only way to keep track. Six pins, one sketch, and a real reason for the states to have names. - Gold
- Make the yellow light on the module flash three times during the change state without altering how long that state lasts, and do it while the other tower's lights carry on correctly. This is the Band 1 Gold task with something else that must not be interrupted, which is a hint about Band 5.
This does not replace the band's evidence
The module build is a Swap in the sense that it teaches the same sequence, but Band 1's evidence is about the hand-wired tower, because that is where the resistor lesson lives.
Claim Band 1 with your hand-wired tower. Add this one to the same folder as a second piece, with your note about what the module's resistors turned out to be. A facilitator seeing both learns more about what you understood than either alone would tell them.
Ship it
One video under sixty seconds, and one post of five lines. You built something different from the person next to you, so your video is the one nobody else in the room can post. Say in the post which build you chose and why — that choice is itself worth a line.
The four shots: three seconds of the thing still, fifteen of you doing something to it, fifteen of it responding all the way to the end, and ten of your measurement or the thing that went wrong first.
Show your work has the template and the three checks to
make before anything goes public. Tag it #BozomaBuilds.