What are buttons and traffic light
great for anyone interested in learning how to solder and basic programming
Anavi Technologies designed these boards for educational purposes. They are fairly easy to put together and pretty intuitive in their usage. With these boards you can quickly add buttons and LEDs directly onto the GPIO header of your Raspberry Pi to get on with some teaching, quick coding, debugging, etc. A button and an LED are always useful!
Where can i find them
You can find these two board at Tindie where Anavi has a few items.
- Buttons either as DIY ($2.50) or pre-soldered ($4.00)
- Traffic light as DIY ($2.50) or pre-soldered ($4.00)
- As a ready made kit with the addition of an HT21D sensor ($16.00)
Note that Anavi Technologies is based in Bulgaria and the items will ship from there adding about $6.00 to your grand total.
Putting together the DiY kits
The Buttons are much easier to put together than the Traffic Lights but both kits can be done by beginners. Use particular care when dealing with the resistors of the Traffic Light as you might damage the component with a very hot soldering iron.
- Get the board with the top of the PCB facing up.
- Install all the buttons. Despite the buttons are squared shaped the pins will only go through the PCB in only either of two positions both of which are fine i.e. if it fits like Cinderella’s shoe that’s good if you need to force it as for one of the two step sisters you are doing it wrong.
- Check that all the pins are nicely sticking out at the back of the PCB.
- Solder all the pins at the back. The best way is to solder one pin, then the one diagonally opposite, then the other two. This should guarantee that the buttons lies flat on the PCB. See the picture below.
- Solder the female header. This header is placed from the back and soldered on the front of the PCB. This is especially important if you want to install several Buttons as in the this way the adjacent GPIOs won’t be obstructed by the PCB.
- With the board facing up you will need to solder the SMD resistors. The way I do it generally is to tin one of the pads then use precision tweezers to put the component in place whist keeping the iron on the soldered pad. Once the component is in place complete the soldering on the other side.
- Solder the female header. This header is placed from the back and soldered on the front of the PCB. This is especially important if you want to install several Traffic Lights as in the this way the adjacent GPIOs won’t be obstructed by the PCB.
- Place the LEDs making sure that the short leg goes in the squared pad and the long in the round one. Trim the legs after soldering them at the back.
- This is how the finished board looks like.
How do I use them?
Much of these boards is very intuitive but as they were designed with STEM in mind it is probably worth going over a couple of aspects.
Connect to GPIO
You won’t be able to connect the Buttons or the Traffic Light anywhere on the GPIO header, you will need to find an area where next to a GND you have three unused GPIO pins. In some cases it will mean to rotate the board 180 degrees like with the green rectangle on the left in the picture below.
Be careful to follow this simple requirement as in the best case things won’t work as expected and in the worst case you might see the magic white smoke that scared the lion and the scarecrow in the Wizard of OZ!
It mounts vertically on the Raspberry Pi and uses only four pins, leaving the remaining GPIO pins available for your project. You can add up to 6 ANAVI Buttons simultaneously on a single Raspberry Pi (with 40 pin header)
This is a Python GPIO Zero example for the buttons. GPIO Zero lends itself to these boards very nicely as it is very easy to use especially for beginners.
Don’t forget that GPIO Zero uses BCM notation for the pins so 13,19 and 26 in the example below are 33,35 and 37 in the picture above. If you are confused always check the good pinout.xyz without which we’d all be lost!
#!/usr/bin/env python3 from gpiozero import Button from time import sleep btnB1 = Button(13) btnB2 = Button(19) btnB3 = Button(26) print("ANAVI Buttons") print("---") print("Please press a button") print("---") while True: sleep(0.1) if btnB1.is_pressed: print("B1") if btnB2.is_pressed: print("B2") if btnB3.is_pressed: print("B3")
To turn on the LEDs on the Traffic Light (European Style:) you would instead do something like this:
#!/usr/bin/env python3 from gpiozero import LED from time import sleep ledRED = LED(13) ledYELLOW = LED(19) ledGREEN = LED(26) while True: ledRED.on() sleep(4) ledRED.off() ledGREEN.on() sleep(3) ledYELLOW.on() sleep(1) ledYELLOW.off() ledGREEN.off()
“Open Sourceness” is the way to go for Anavi which provides the design as open source under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). On Github you can find the repository for the Buttons and the Traffic Light.
The design of the boards is nice and make using them very intuitive. The hole at the top of the PCB possibly suggests that you could always have them with you with a key ring as a sort of a Swiss knife for the errand educator.
Considering that this product is mostly indicated for educational purposes the choice of such small SMD resistors for the Traffic Light board is not well placed. They are definitely too small and would present a problem for the beginner to which I would strongly advice to buy the ready made board. Maybe a bigger form factor for the pads could help. For hand soldered SMD a longer pad generally helps alternatively bigger SMD resistors could be placed at the back of the PCB or ultimately use through hole for the DiY kit. Either of these could make the Traffic Light more DiY friendly.
Placing the board on the GPIO is also not entirely foolproof and the Github page could provide a visual indication of which positions to use on the GPIO header.
In general the resources available are somewhat “minimal” and could certainly do with a bit more content especially with regards to the code available. It is a very simple set of boards but if they have to be educational providing a clear set of examples would be a must.
Cost wise I think all of the choices available are well priced exception made maybe for the Edu Kit which is probably a tad to expensive. Electronics kits these days are very very cheap and it’s not always easy to keep up with the competition especially when you need to add distribution costs which sometimes exceed the cost of the kits themselves. I know Anavi is looking for distributors so if you like his kits make sure to get in touch with him.
The whole idea for them was to make something for the workshops in Bulgaria
Overall I think these two boards are very original and deserve more popularity which hopefully will bring more energy and cash in Anavi Technologies to improve and complement the existing kits.
When I spoke to Anavi he said that these boards are a result of a workshop he was part of. Often that’s how good ideas come about, keep at it, I’ll be here for the next review 🙂