The Internet of Things revolution is coming

I got my new Arduino, yay! Soon you'll be able to see whether the condensate reservoir in my cellar is emptying or not and check out the nice stable temperature all year round.

Inconceivable!

Last thing to do is mount the stack of boards in a box to keep the dust off but I've not found anything suitable. I'm using up an Ethernet shield and screw shield that I have kicking around, neither of which I can see myself using for anything else. Stacked up they make the thing quite ridiculously bulky for what it does. So it's all just going to have to get stuffed into a big box. It's not like it's going to be on show, it'll be sitting in the cellar.

It's my party and I'll solder if I want to

Today's my birthday and I didn't have anything planned so I had a soldering party instead.

I love this stuff so frankly spending a night in messing about doing this accompanied by a pizza and a couple of beers is a pretty good evening in my book.

The end result is my first ever Lasertag gun board.  I imagine it's blooming enormous compared to the PIC based ones as I've got an Arduino in there and it's all socketed up on 0.1" headers. This is deliberately done so I can mess about with it and use it as a bit of a testbed. It's been made so it nicely fills the empty space in the middle of the gun.

For power in the end I used a tiny little step-up switched mode voltage converter. Easier than messing around with funny Li-ion batteries or trying to squeeze five AAAs in there, but obviously it's not going to have brilliant battery life.

I've got the trigger and reload switches wired up, a muzzle flash working and a space for the sound board, which I'll fit another evening. It's the same WTV020SD module I've used in a couple of other projects so I'm sure it'll work OK.

Right now sadly this goes through the motions but doesn't cause Lasertag hits. It's probably just a stupid wiring error as I've used the code that's worked fine in testing and I'll debug this tomorrow night.

The Internet of Uninteresting Things

You are looking at my addition to the Internet of Things. Well it will be once I get a new Arduino to replace the one I shorted out in a moment of hamfistedness.

All the code is written and it works but is suitably ugly, just need to wait for the new board.

It's a self emptying condensate tank for my dehumidifier with temperature and humidity monitoring. Are you excited yet? I'll be sure to provide continuous updates for everybody.

My first lasertag gun

I play a reasonable amount of LARP where we use lasertag  as the combat system. I posted a while back about wanting to make my own gun for this and have made a start on one. So far I'm happy with the progress. Painted up like this it will make a satisfactory vaguely sci-fi looking pistol that can be used in any game where you're not fussed about having replica kit.
The basis for this is a NERF Firestrike for multiple reasons. It's a compact but chunky pistol body and has a 'laser' built in, which shines a red target on things when you push the secondary trigger. This means there's an OK lens unit, battery holder and switch all built in as it comes out of the box and like most NERF guns it's really not very expensive. Building a gun out of a decent Airsoft body is a much more expensive proposition.
Opening it up, there's a ton of space inside, I can't see me having any difficult getting it all in expect perhaps a speaker for the sounds. I'm also conflicted about powering it. The battery holder only holds two AAAs which isn't high enough voltage, I really need a steady 3.3V, preferably 5V or more. So I can either go with a step-up voltage converter or get some of those Li-ion batteries people use for vaping. AAA size but 3.6V each.
After ripping out all the NERF piston stuff the trigger got turned into a switch with a simple tactile button glued in a suitable position. I started hacking the shell about to fit an on/off switch at the rear of the gun but it interfered with this mechanism and I've abandoned that plan. Not sure what to do about an on/off switch now, I may just pop the battery cover off, it's not like tag guns draw a lot on standby.
I used a Dremel to cut the tracks on the small circuit board that connected the battery terminals and secondary trigger. This means I can take feeds separately for power and the switch, originally it just switches the batteries straight to the LED when you push the trigger. I plan to use the secondary trigger for the reload function, it's nicely placed for it and not as easy to push as you'd think.
Then I desoldered the red LED from the board in the emitter and replaced it with an IR one. It's taller so the focus may have been messed up. There will be an element of suck it and see on this.

At this point I've got a trigger, reload switch, battery compartment, emitter and muzzle flash LED ready to go which is getting it down to sticking an Arduino in there and making it work.

However I'm going to pause for a bit. I painted it last night and while I like the silver finish it's still slightly tacky. I've had this with NERF guns before, the paint seems to take ages to dry, which must be related to the solvent getting into the plastic of the body. I know from experience handling it too much will mess it up so I'll leave it a while longer to dry.

This leaves me time to sort other things on my to-do list for it like ordering some of those AAA Li-ion batteries, sorting out a suitably compact sounder, coming up with where to mount an on/off switch, making a status indicator which may just be an RGB LED and building the 'gun board'. The latter is actually the fairly easy bit.

I'd love to leave the USB programming port for the Arduino accessible if I can and maybe have a 7-segment or matrix display but I suspect the latter is stupid 'feature creep' that will drag the project out and make it unnecessarily complex.

My love/hate relationship with hot glue.

When I built the Enigma Machine I was really against the clock to get it finished. I ended up pulling some really late nights to get it ready to go.

As a result I made some short cuts and one of them has come home to roost.

I needed to make guides for the keys so they didn't rotate and did this by hot gluing some brass flats on the end of the tubes. I never really thought this was a great idea and even as it was going together some of the joins were a bit weak.

Now over time, loads of the keys have come completely loose and the brass flats are rattling around inside the case.

So today I'm going to have a go at sorting this out. I'm not quite sure how I'll fix this. I suspect I may just switch to epoxy as the key tops have stayed on the ends of the tubes just fine with that. I'll also try to even up the keys as they weren't all perfectly the same length.

B+

I've used a couple of Raspberry Pi computers, having already embedded one completely in one of my projects. At under £30 for a fully functional Linux computer with enough horsepower to do stuff that is inconceivable on a microcontroller it makes a load of sense.

Now I've got a use for another embedded one. So I thought I'd get one ordered up so I can make a start on building it into the prop, even if I won't necessarily have the software sorted for a while.

This has come at a timely moment as they've launched a new B+ version and it gives me an excuse to pick one up. Given that various similar things have come out that make the Pi look a bit long in the tooth without being much more expensive it's not unexpected.

What is unexpected is that it's not really an upgrade but a refresh. The technical differences will have been covered all over the place and I'm sure loads of people are disappointed in the lack of a CPU, memory or on-board Wifi upgrade. Things like the BeagleBone Black have tons more horsepower for similar money.

However what they have done is make it more polished.

The old Pi was very obviously a 'first product'. The connectors poke out all over the place and don't line up. It uses an SD card when a micro-SD card would seem sensible. The power regulation circuit makes it prone to crashing and resetting if you plug things in to the USB ports while it's running due to 'brownouts'. Hell there are only two USB ports which get used up dead quickly. The phono socket for composite video output is huge and looks like something from the 90s, etc. etc.

I can see why they've done this. The Pi is ubiquitous. I've bought this despite having a Beaglebone Black kicking around because I want a Pi specifically. The community support is enormous and so much stuff gets ported to it.

If they changed it too much they might lose this.

Christmas lights would be cheaper

Some time back I bought myself a string of generic WS2801 driven addressable LEDs and they've languished in a box ever since. These are 'smart' RGB LEDs with a little driver chip that means you can daisy chain an arbitrary number of them and control each one individually with just two connections for the whole string.

I thought I'd use them for the Time Machine but in the end they were simply too big and the wire between each one too short.

Last night I finally dug them out and had a go with the Adafruit library. This is fifty of them running a slightly faster version of their example code.

They work really nicely but again I suspect they'll be 'wrong' for my next project which needs to have a retro look. So much so that I suspect it'll be done with incandescent bulbs, relays and lots of messy point to point wiring as that's actually what it's supposed to look like.

Although these would make it really easy to make.


Raspberry Pi GPIO:101

My brother always gives me interesting presents. He's got a head start as we both like and do similar stuff.

One of these was a Raspberry Pi T-cobbler kit, which is essentially a way to extend the GPIO connector outside of a case and  plug it into a breadboard for prototyping.

Wiring up simple inputs and outputs to microcontrollers is bread and butter for my projects but I've never actually done this with a Pi. So this morning I pulled the T-cobbler out, soldered it up and did a bit of messing around.

I'm finishing up a project which has a Pi embedded at the moment. It uses a slave Arduino Nano to do most of its interface to the real world and it's going to be properly embedded with the expectation you don't normally have a screen, keyboard or network available.

So despite the presence of the Arduino I want to be able to have some basic control and feedback from the Pi that doesn't rely on anything else working. The python script on the Pi that does the heavy lifting occasionally crashes and while I'm making it more stable some of it is just V4L being  flaky rather than anything I can actually fix in my code. At least that's my excuse.

So I want the following directly linked to the Pi.

  • Shutdown button so it can be cleanly shut down rather than just yanking the power. No good will come of that eventually. For this I need GPIO really and I'll probably do it like this.
  • Status light that shows the state of the main script, again more GPIO.
  • One or two buttons to change the state/behaviour of the main script
  • Reset button. Easy, just connect a switch to short jumper P6.

What I've done this morning is connect three buttons and an RGB LED to the GPIO. Pushing each button lights up one of the colours of the LED using a simple Python script.

This is easy peasy stuff that anybody could do with a little looking on Google but it's on these foundations that you can build something that actually 'does stuff'.

I took my medical scanner prop to a UKLTA lasertag game yesterday and people cooed over it again. Given the 'cottage industry' the UKLTA has going building guns for the hobby I'm surprised there aren't more things like it floating around. Some of the people there are far more capable at building things than I am. There seem to be a lot of people around who think this stuff is voodoo when if they set their mind to it could actually turn out some really cool stuff.