Step 6: Mounting the switch
Most of these small pushbuttons come with four pins. By now, you now which two pins you're going to use (since you've tested the circuit) - usually it's two on the same side of the body. Trim off any unused pins.
Measure the size of the part of the button that you actually press. On mine, it was a circle roughly 5mm in diameter. You want this hole to be as snug a fit as possible (remember the childproofing - you don't want drool getting inside!), so choose a drill bit that's as close as possible in size. Using an appropriate drill, drill a hole into the cone where you want the button. Check that it fits from the outside first, and make any necessary adjustments.
Solder the remaining two wires from the microcontroller onto the switch. Stuff it inside the base, and check that the button can still be pressed (though you might need to stick a finger inside the base to hold it still at this stage. Now that all the electrical connections are made, you can test the circuit again to be sure that it's still working, and that the switch does the right thing. At this point, once you've verified that everything is still working, it's a good idea to stick a copious amount of hot glue over the pins of the ATTiny. That helps to avoid the stresses of being stuffed into the base from dislodging any of the connections.
All fine? Good, now you need to make sure that the switch is now secured in position. I used a large blob of Blu Tack, stuffing it into the top of the base, behind and around the switch, bit by bit, until the switch was securely wedged into position. Now stuff the battery holder (making sure you've inserted the battery) and microcontroller assembly into the base, maybe adjusting the Blu Tack wadding as necessary. You need to end up with everything packed in as tightly as possible, at a minimum with nothing protruding beyond the level of the bottom of the base - you should be able to stand it on the table, and it should make full contact. I found that I could just achieve this - but that I wasn't able to attach the cone properly on top of a Duplo brick - the battery holder poked down onto the studs of the brick and stopped them from fully engaging with the cone.
At this point, if this isn't to give to kids, and you're not worried about being able to stand the traffic light properly onto Duplo, then you could stop and consider the project finished. But I needed to be able to seal the base from prying fingers, whilst still being able to change the battery occasionally, and be able to attach it to Duplo. Read on for how I achieved that...
Remove these ads by
Signing Up


























Not Nice












Visit Our Store »
Go Pro Today »



