❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Shitty Amateur Electronics - Part 4: The Random Light Game

In the last blog I posted a picture of the first real β€œthing” I made by myself, a simple row of LEDs and a button, all controlled by a Raspberry Pi. It was all put together on a breadboard and I was quite sad when the time came to taking it all apart to make something else.

So, in what was an uncharacteristically emotional thing to do for me, I decided to build the circuit in a more permanent fashion. I ended up buying some stripboard from Amazon, allowing me to transfer the whole thing in an easy way with no need for me to use little bits of wire. All of those strips are one continuous line, allowing me to practice making some logically clean and efficient layouts.

Unfortunately, the whole thing turned into a bit of a mess. I have now, finally, got a working board that I intend to cut to size and hopefully put inside a nice plastic enclosure so I can preserve it for posterity, maybe decorate it. But the journey to get there was a story of failed solder joints, accidental bridging of adjacent strips, and idiocy on my part where I joined a single line of components together that were already on the same row. It was very messy and the solder wick got a lot of work that day.

I was chided by a friend for wasting my breadboard jumper wires on this, but the simple truth is that these were the only things I had at the time with female jumpers on the other end. I am lazy and impatient. I regretted the decision immensely when the plastic on the top side of the wires melted thanks to the heat from below.

But, several hours with a multimeter and lots of repaired joints later, I had my board tested and working and now it’s time to think about what kind of box to put it in. I have to consider the size and clearance, and also how to make the LEDs come through while offering adequate protection to the delicate cargo inside. There’s also the switch to consider, and this gets a little tough. Do I put the switch on the end of two wires, so I can have a bit more freedom, while having a potentially more fiddly build? Or do I have a long switch directly attached to the board, which has a risk of snapping off if pushed or knocked in the right - or, indeed, wrong - way? I haven’t decided yet.

In terms of actual boxes there’s not much good news here. Pretty much everything I can find is either pre-cut with holes for other boards like RPis or Arduino, and if it isn’t those it’s outdoor electric junction box kits with full waterproofing and really thick plastic. Hardly appropriate.

The other option is to befriend the right people at work and see if I can get some help designing and 3D printing a case for it with holes cut where I want them. I’m sure I can do this, I’d even be happy to pay for the materials, and it gives me the freedom I need and also a bit of achievement-cred if I can pull it off.

Whatever route I take I’ll be sure to post here and see what pitfalls I come across. There will be many and I get stressed and frustrated. Probably shouldn’t build that DIY LED matrix I’ve been thinking about... that’s about 160 individual solder joints. Eep...

Shitty Amateur Electronics - Part 3 - Hello, world!

Time to get the obvious starter circuit out of the way. Yes, I made an LED. A flashing one, actually. No, there’s no need to document it.

And of course, once you can do one LED you can do five. Of many colours! And then you learn about forward voltages (essentially how much the LED uses) and how different colours pull different voltages & current and require different value resistors to be as equally bright as each other. Sooner or later I’m going to have to learn about calculating this kind of thing myself, although I’ll have to reach far back into the old, dusty areas of my brain first. I think I’m looking for the GCSE area... Adding a switch to this project was the next step, as was proving to my wife that this hobby wasn’t just a flash in the pan by leaving her a little surprise for her to find in the morning.

I actually amended the code driving the GPIO pins to turn it into a game with a randomly generated pattern of lights. You hit the switch when the green light in the middle is hit. Frankly I wish I’d have gone straight to a project like this, and if you’ve got any prior knowledge you may want to as well. Otherwise it feels a little boring. All the output goes to the console right now, but I have ideas for that.

I’m going to put this circuit aside for now as I have plans to preserve it for posterity. I’ll cover that in later posts.

One other thing I did use my kit components for was to write a more complex series of sequences to emulate a pedestrian crossing. It follows the standard sequence used in the UK and had some random timing to it after you push the button. It even has a beeper! I did start to find my breadboard a bit small at this point, and I’m sure there are ways to get better at utilising the space. Or I can buy a bigger one, obvs. If I need a bigger one for something then that’s the time when I’ll buy it.

I’ve been using the open source tool Fritzing for documenting all of my work. It’s clunky to use though and the networks of wired and components sometimes get a bit muddled up from what you really want to do with them. Connections seemingly get invented which puts a component or junction somewhere you don’t want. This got frustrating and was a pain to fix.

Oh, it also crashed. A lot.

But it was decent enough and if it’s stable for you I found it quite easy to use. It can also do PCBs, and I’ll probably post about that later if I get that far along.

For now though I’ll pause here. Next time I want to talk about what I’m going to do with that game circuit.

❌
❌