Sometimes I've to do a little bit of soldering. Usually only a few wires and since at present I have no place to leave an iron set up permanently this requires for me to either unpack my rework station or even just a simple mains powered soldering iron.
Even doing this has resulted in me pushing back soldering jobs as the extra time for setup
as a ratio against actual build time doesn't feel like time well spent.
Then on eBay UK I came across a listing for USB soldering iron for £3.39
Since my electronics is usually tied to an Arduino or Raspberry Pi project I will have a computer up and running and I thought for less than £4.00 including shipped from Hong Kong it was worth a punt.
Well, it arrived this week and as per the picture it includes the soldering iron with a plastic cover for the top. A USB to 3.5mm jack for power. A really small stand made from a folded piece of metal with a bit taken out and just enough solder to know it's working. Actually I soldered about 30 wires using the solder provided and have a bit left over. Still you'll need to get some solder.
First impressions were positive. Packed in a proper retail packaging box and not just a jiffy bag like many cheap things on eBay from Hong Kong.
The iron heated up quickly and has a red LED to let you know it's on.
It was definitely hot enough to melt the solder and do the job I required.
Since the original outing I have used it again to replace some current limiting resistors for 5 LEDs in a project I'm working on. Again all worked great.
As I've only used it twice I can't speak for the long term reliability but from first impressions it is well worth the £3.39 it cost me.
The only things I would change are:
I would have liked the power to be microUSB and not 3.5mm jack. I've loads of microUSB cables but this is my only USB-3.5mm cable. If I lose it I'll have to get a new kit. Probably not a disaster at £3.39 and then I'd have a backup.
The tip on the iron is a needle tip. My personal preference is a bevel tip. The ones where it's like they cut a diagonal slice off a flat tip.
Here is a nice instructable explaining the different tips. My preference is called a C series tip in the guide. Rarely do really fine work and even then a bevel can still be used quite well for most things.
Saying all this for less than £4.00 it feels nice to use and means I can set up, do the rework and pack away in minutes. Which is ideal when only soldering a few wires at any one time.
UPDATE: after posting this I was sent a link to a great video by bigclivedotcom where he tests, tearsdown reverse engineers the circuit diagram. Let's just say his review is way better than mine.
Here's the video.
Update: 3rd March 2017. I resurrected ZeroBall today in preparation for Guildford Innovate on Saturday and did a video.
Trivia: Previously ZeroBall ran from a Raspberry Pi A+. With the new PiZero W I thought it would be perfect to pair with the NexDock. The NexDock has Bluetooth keyboard and trackpad and the PiZero W now has Bluetooth, so can be paired to the keyboard easily. Making a nice compact solution.
On with the actual blog post.
For the recent Egham Raspberry Jam that I organised the theme was Gamification.
I already posted aboutsensecave a Raspberry Pi Sense Hat game but I wanted to do something a bit more physical and real world.
That got me thinking about Fairgrounds and the kinds of games you play there.
The final decision was a ball throwing game. Get the ball in the cups and you get points. For those who watch US teen movies the principle is similar to beer pong, but without the beer and with points and scores....
Next exercise was to figure out how to detect a ping pong ball going into a cup.
I spent a lovely afternoon trying out PIR (Passive Infrared Sensor) sensors at HackWimbledon. If you're near Wimbledon in the UK check them out. Great bunch of people and the events are every 2 weeks on a Saturday.
After an enjoyable day I figured out the PIR sensors are great for detecting movement of animals including people, but no use for my requirement as they even tripped if the ball passed over the cup since the amount of infra-red light changed. Tweeted when it failed. Luckily there was still a month to the Jam.
Plan B needed for project. Testing at @HackWimbledon revealed plan A wont work. Productive. Also had a great time.
I now have six PIR that I can use for a different project. ;-)
With PIR out of the question the alternatives I considered were a switch or an LDR (Light Dependent Resistor) . Both had their advantages and disadvantages.
Switch digital and easy to read and wire up, but most switches would need more force than a ping pong ball would provide.
LDR would give a great reading but is an analogue device which the Raspberry Pi cannot handled without additional circuitry
In the end despite needing extra circuitry I went with the LDR.
To get a reading from an LDR you have to create a voltage divider circuit so you can get a different voltage depending on the relative resistance values of the 2 resistors used.
The next thing was to get the analogue reading from the voltage divider into a the Raspberry Pi in a format that it could use. My initial thoughts were to use the analog inputs on an Arduino and then send the data over serial to the Raspberry Pi. Considered Arduino as I have used them a bunch and knew what to do, but in the end I decided this would be over kill. Why use a microcontroller to read analogue when there is a nice little chip that can do the same and people way smarter than me have already got it working with the Raspberry Pi.
May I introduce you to the MCP3008. An 8 channel, 10 bit analog to digital converter which communicates with the host over SPI.
Since SPI and the MCP3008 were all new to me I did the Google and found an great article by Raspberry Pi Spy. This guide explains exactly how to wire up the MCP3008/Pi and also RPI.GPIO code.
Using this I tested the LDR and it worked perfectly. Looks like all systems are go on the project.
Then I saw that gpiozero has built in support for the MCP3008 and decided for the final project to take advantage of the ease of use brought by gpiozero.
A little test and it all worked again. :-)
So, electronically everything works. I can use voltage dividers with an LDR and resistor along with an MCP3008 to read the sensors and then using gpiozero read the values over SPI.
So, I began construction.
Firstly, soldering the Raspberry side headers from the MCP3008 on a strip board.
When I did this I made a mistake. I should have left more room on the Pi wiring side of the MCP3008. There is no need for the chip to be this close to the edge, with only one hole for the wire to be attached. This will come back and cause me problems later...
Once this was done I moved on to creating the voltage dividers. Since there are 6 cups, 6 resistors and LDRs are needed.
In the picture above the left side is VCC (3V3 from the Raspberry Pi), right side is GND. Each 10k Ohm resistor is soldered to VCC on the left and then to one of the MCP3008 input pins. The LDRs will then be connected from the MCP3008 input pin to GND to create the divider.
I did a quick test using one LDR to make sure I did this right. Image below shows it wired to the Raspberry Pi. I used a model A+ as there isn't a requirement for network or more power. Yes, I wired it all up to power and stuff for testing.
After this the need was to add the wiring for the LDRs. That's 6 connections with 2 wires for each.
This is already starting to look a bit more complicated than the small breadboard projects I've done before. Looking at the image above you will see 6 black wires from the top edge (GND) and 6 orange wires tied to each MCP3008 input line.
All that was missing for the voltage dividers to be complete was to add the LDR for each line.
Since this is a physical build the LDRs need to be embedded in a plastic cup. I also needed the LDRs to be flat against the cup to make it register a passing ball without obstructing the path of the ball.
This is the first time the sensor is actually in a cup so I can check if the ping pong ball passing is detected correctly for the purpose. More testing of a single cup.
It worked and it worked amazing well. That's 1 cup wired up. Now just the other 5.
All wired up. A bit fiddly keeping the other cups out of the way while soldering and working with all wires the same colours to make sure I wired the correct ones for each LDR.
I had great fun at this time setting the cups up and throwing balls into them. My kids loved it too. The fact they wanted to keep doing it even when all that happened was the number on a terminal screen updated when it happened made me think the build would actually result in a compelling game.
With the electronics sorted it was onto the bit that was new to me. The physical build. I heard foam board was easy to work with and sturdy so went with that. Another new thing for me.
I cut holes in the foam board and inserted the cups. Using tape to hold them in place.
top, pretty side
bottom, business side.
As I mentioned the physical build is not something I do regularly, so I didn't have a lot of tools to hand to finesse the build. My main tools were a sharp knife, glue and tape.
Once built I again did some testing and it all worked.
The top is sloped, so the balls roll back to the player. A layer is underneath, again to have the balls roll back to the player.
In the picture below you can I see a piece on the top to direct the ping pong balls to the bottom right so the returned balls will always be in the same place. For the layer underneath the same happens. Balls return to the bottom right.
Last requirement of course was the software. I mentioned it used gpiozero for the MCP3008. For SPI to work you have to run your code as root using sudo.
I wanted the game to feel like a fairground, so music and sound effects were essential as well as a score board. All coded in Python. To make this easy (for me) I used Pygame for the display, keyboard input to start a new game and also to play the background music and sound effects when a ball goes in a cup. If you haven't used Pygame on the Raspberry Pi before then check out their recently released Make Games with Python Essentials book that is available in print, PDF, iOS and Android app.
Electronics sorted, physical build done, programming all completed. Ready for the Egham Raspberry Jam on the 17th of January.
As I was packing the night before I thought it best to test my projects as usually for me something goes wrong on the day and since I had the time (rare for me) doing some testing seemed like a good idea. Ahhhh!!!!. It didn't work. I was checking the code and the terminal output. No readings from any of the sensors.
On looking at the circuit board a couple of the wires had broken off. Remember I mentioned my thing about not leaving enough space on the Raspberry Pi side of the stripboard.
You have to love the Raspberry Pi Community. Within a few hours I had exactly the advise I needed to get my project fixed perfectly. But I had 1 day left and didn't leave enough room to do what they advised so I ignore their advice this time. Soldered the wires back on and crossed my fingers that it would all hold together.
On the day of the Jam the game was very popular. Great write up from Richard Savillwho is well worth following as he does some great Raspberry Pi projects and Kickstarters. With lots of kids and adults playing with it. When a few kids gathered around the game they would just drop the ball straight in the cups to get the points and hear the sound effects.
Overall, I'm very happy with the final game. The build is a bit rough around the edges but works great. The code held up and the kids played it all afternoon which was the desired outcome. I also had a number of conversations with adults and kids about the code and the electronics involved, so hopefully helped a few of them to learn something new and consider their own Raspberry Pi projects.
Yesterday another pack of prizes arrived in the post for the next Egham Raspberry Jam Show and Tell Competition. http://eghamjam9.eventbrite.com to register to attend and if you wish to have a chance of winning the prizes to bring along your Project to Show off.
Two (2) PiTrolkits from Innovation in Education were waiting fro me.
These are great kits as they allow you to build your own game controller with the instructions giving step by step details on how to solder it and then a snake game is also provided that works with the controller directly.
Kit of parts
Finished PiTrol
Nevil Hunt is the lead person at Innovation in Education and I have had the pleasure of meeting him at a few Egham Jams where he has come along with the PiTrol, 7 Segments of Pi and PiDapter (link from PiTrol site)
7 Segments of Pi is another simple idea that really captures the imagination. As the name states it is a large 7 segment display and button that you solder from a kit and then code is provided to play a game
The PiDaptor allows you to connect 2 PiTrols to the one Raspberry Pi.
Each of these kits is great for learning to solder and with the provided code gives the owner the ability to understand how to read inputs from the GPIO pins and use it to play games. Who doesn't want to play games on their Raspberry Pi.
In the case of The PiTrol prize once it has been soldered up I'd expect it would be possible to then get the controller to work with the many game emulators out there and possibly with the excellent RetroPi emulation system.
The Prize Pool is getting bigger and I'm still hoping to add a few more before the event.
This week we nearly had a full house.
Only 1 child missing due to illness.
The 4 who attended the previous week remember a lot of their work and code so were getting stuck into getting their robots to go around a corner.
I had a bit more fun getting drivers on enough school PCs to permit the Arduino Nano to be seen. It needs custom USB/Serial drivers that are not included by default.
The teacher who is ICT coordinator came in to see the session in full swing with robots spinning, or moving along the floor. With coding going on and due to plus and minus lines on the batteries being shorted a nice little display of black smoke and the lovely smell of burnt plastic.
No real harm done just a jumper wires plastic sleeving was melted.
I congratulated the child on making smoke as it's something we all do when we work with electronics. They were kind of shocked.
It was great that the teacher had the same attitude so no harm done and no concern about burning down the school.
I tested their robot kit and Arduino. Nothing damaged, amazingly so did a little bit of rewiring and handed them back their robot to get working on again.
On of the kids who was in the previous session had a problem where their robot was pulling to the left. These are small cheap kits so the motors aren't tuned and the wheels are small and have grip meaning they catch on the carpet. Meaning they cannot reliably go straight.
We tried to fix it by turning the wheels in or our to change the resistance but no go so introduced that child to analogWrite.
A value of 235 seemed to make it all work perfectly. They had a nice straight running robot.
Once again the kids were not that eager to leave as they were perfecting their code and making it better.
At the end one of the girls who was being collected wanted to show her mother what she had done so she gave a great demonstration of her robot. Holding down reset to stop it moving.
Set it up and let it go. She then explained the code she had made as well as giving details on some of the other parts we will be using.
Next week we will be using an input device. A small line following sensor. I will mark the edge of the room area with white paper providing a contrast with the blue flooring. The idea will be to detect the paper and make the robot turn.
This will be the first time the kids do inputs and will also require the introduction of the 'if' statement.
Looking forward to another productive session next Monday.
Well some people aren't that into electronics and programming but are still looking for creative solutions.
I came across Marble Runs/Roller Coasters that you can buy and did a search online and found you can make you own from copper wire and also from stiff paper (200gsm). Never one to miss a chance to try something new I looked at the videos and made up templates for the paper marble run sections and began construction
After a fair few iterations and a lot of really small pieces of tape to put the bits together I finally had a set of templates that can be used to make a paper marble run.
This is the first video of the marble run. I really like the funnel and also that the marble comes off the end just below the funnel and because the moment is right it drops into the next channel/track section.
There is a fair bit of work in getting it stable and modifying the length of the straights and the curves so they work. This is real tinkerer construction as the parts are not perfect and the design is evolving so regularly pieces need to be shortened, or bits added or the angle of the track needs to be modified to make it work.
Great fun going through all of this and learning about the properties of the paper, how strong the tape is and how to keep the marble going.
I then extended the run another bit. I like this view. There is something pleasing to me about the curves on the left section.
Finally I added a bumpy track and also a 'ladder' (no idea if that's it's name but it's the name I use) and more curves. This made the whole think a lot taller and works well. It does kind of unbalance the look and style of the overall marble run, so I think it is less pleasing to the eye than the earlier version. Feels like when a skyscraper adds a large antenna to the top to officially be taller.
Here's the final video of the current Marble Run.
Overall I'm happy with the results and plan to make more runs. A nice way to spend an afternoon/evening being creative.