Breaking Bad Escape Room

Today we went to an escape room. This is becoming something of a Christmas Tradition (tm). Well, we’ve done it twice. Last year were were breaking into a bank. This year we were in the lab. It was great. I think it was even better than the last one.

We managed to complete the tasks and get out in 59 minutes and 59 seconds (which may be as much a comment on the generosity of our hosts as much as anything else).

If you are in Hull you really should check out this. It’s a great experience.

Jaws board game - we're going to need a bigger boat

Another present that I got for Christmas (I must have been a really good boy last year) was the Jaws board game. At first glance it looks like something that was first released in the seventies when the movie was showing, but it turns out that it is a much more recent product.

It’s really good though.

It’s played in two acts. In the first act the human players try to locate the shark and tie it down with barrels while the shark tries to eat as many swimmers as possible. The second act switches to the ocean with the shark trying to destroy the boat and kill the crew.

It works well as a four player game, with one player taking the role of the shark and the other three the human players. However, I think it would also work really well as a two player game too. The tension builds up nicely in both acts and the end of the game was nicely balanced. We (the humans) just lost, with the shark taking out the last part of our boat just as we were getting close to seeing him off. Strongly recommended.

Sega Mini Christmas

I hope you had a great Christmas. I did. My big present was a tiny replica of a game console I never got around to owning. It’s a Sega Mini. It’s tiny, but comes with a couple of full size wired controllers. And it works a treat. It produces a nice solid HDMI output which you can scale to fit your widescreen telly and there are forty games built in. The ones I’ve played have been great fun. I really like Streets of Rage, particularly in two player mode. For the price you get a lot of entertainment.

Bye Bye HiFi Walker

I’m not having much luck with my high resolution music players. My first one, a Sony, decided to destroy its battery (and then destroy the replacement battery that I bought) by shorting it out. I suspect the charging circuitry. That went to the tip. And now my second, which had the wonderful name “HiFi Walker” has had the display fail. So, despite there being no obvious way in, today I tried to fix it. I was hoping that upon the removal of the back I’d see a dangling socket I could just reconnect to tumultuous applause.

Unfortunately that’s not how it has worked out. After using the hair dryer to loosen the glue I got the back off to find a perfectly assembled circuit board with no obvious flaws. So it was time to double down and remove the processor board completely from the case and check the display connections. Which of course all looked fine to me, even though the display was obviously still broken.

This is the a genuine “blue screen of death” in that it is all that is displayed. Oh well. At least I tried.

Playing with Launch Pads

A while back George brought along a device to the Hardware group that I’d not seen before. It was a panel covered in buttons and lights.

That’s buttons and lights. Awesome. He said it was called a “launchpad” and you used it in music production. I wanted one.

Fast forward to this week, and I’m thinking of getting into making music and stuff. And if you want to do that you really need a copy of the Ableton Live software suite. Which is expensive. However, it is possible to find a cut-down version of this software bundled in with music devices, including launchpads. Add to this the fact that Amazon had the Launchpad Mini Mk2 (including software) for a tempting 38 pounds at the moment and I figured it was time to make a strategic purchase.

It arrived today. The hardware is very nice. A matrix of 64 buttons which can display one of four colours (the latest model can do lots more colours but costs a lot more) . It also comes with a licence card that gets you a copy of the latest version of Ableton Live.

You just plug the device into your computer and it shows up as a MiDi device. You can use it in Ableton to trigger sound effects and music sequences. There’s even a low power mode that turns the led brightness down. This allows you to use it as a controller on an iPad via the iPad USB adaptor.

Plus (and this is really interesting) there’s a library on GitHub that lets you use the launchpad with Python programs. I’m thinking it might be a really neat way to manage robots if I ever get round to making the robot rugby game work. The buttons colours could show player status and also allow them to be started and stopped.

It’s a nice gadget and, if you can pick one up for the price I paid, well worth a look. The music stuff is fun, you could use it to trigger sound effects and whatnot as you record podcasts but it also makes a neat user input device too.

Pinball theory

Theory is when you know everything, but nothing works. Practice is when it works, but you don’t know why.

I know all the theory of how the start button on my pinball machine works.

  • I know that the switches are arranged in an 8x8 grid of rows and columns.

  • I know that the micro-controller runs a bit across the columns and reads the row inputs to identify closed switches.

  • I know that the start switch is on row 3 of column 1

  • I know that the row wires are all white with a coloured stripe and the column wires are all green with a coloured stripe.

  • I know that the start switch is connected between a Green/Brown wire and a White/Orange wire.

  • I know that these wires are connected through the Coin Door Interface Board, entering on pins 2 and 7 of connector J6 and leaving on pins 1 and 4 of connector J1.

  • I know that connector J1 on the Coin Door Interface Board is connected to connector J212 on the CPU board and that the Green/Brown cable goes to pin 1 on this connector and the White/Orange cables goes to pin 7.

  • I know that the start switch signal goes through diode d4 on the Coin Door Interface Board.

  • I know that the start switch has a resistance of around 10 ohms when closed that I can measure this at the connection to the CPU board.

  • I know that other switches on the same rows and columns as the start switch work perfectly fine.

And yet it doesn’t work. I don’t think it’s called “The Twilight Zone” for nothing.

Paid my Office 365 Subscription

I paid my annual Office 365 subscription today. And I don’t mind doing it. It’s around the price of a proper video game and it gives me a whole bunch of online storage along with all of Microsoft Office to work with.

I ‘m a great believer in paying for things that I use. Two reasons:

  • the business model is nice and clear. I’m giving them money and they are giving me a service. I don’t want to waste brain power trying to work out how my suppliers are making a living. I also don’t want to have to worry what will happen when the venture capital runs out and the service is withdrawn.

  • I like my suppliers to have some “skin in the game”. If something breaks I want them working to fix it otherwise they won’t get paid.

3D Printer Tip - use good quality filament

I remember a while ago someone saying that the average 3D printer can produce output with the quality of “the toys that you can find in a Christmas Cracker”. Well, we are making our own crackers this year (just for fun) and I’ve found a nice set of animal shapes that we can use. I dropped the designs into Cura and sent it over to Octoprint for printing by Una, my venerable old Ultimaker One. She’s seven years old now, but still prints really well.

I think one reason for the quality of the output is that I’ve stopped buying cheap filament. A few years ago I went through a phase of being impressed by 1Kg reels of printable materials available for only a fiver. I tried a few and the quality varied a lot. And some had the habit of snapping off during feeding, which meant for loads of fun getting the broken bits out of the print head.

I now use this stuff. It’s not cheap, but it is not stupidly expensive either. It is consistent, adheres well and the colours look good. And it comes on nice spools. Bearing in mind the time it takes to print stuff, I’m unlikely to use a hugely expensive amount of it.

Paying the Untidiness Tax

While I was assembling devices earlier this week I discovered that I was finding it hard to work because my desk was a bit of a mess. Having thought about it, I now regard an untidy desk as a kind of “tax on effort”. If it takes ages to find the solder after you’ve put it down then you will take longer to build things. And losing the thing you’ve just made can really slow down development.

This new way of looking at the situation, along with half price storage boxes at Hobbycraft, has had me spend the last couple of days putting my stuff in order and clearing the desks. The idea is that when I want to work on one project I get out the bits for that project, work on it, and then put them away afterwards.

Let’s see how long it lasts….

Measuring Power Consumption

You may be wondering how I can be so sure about the power consumption of my various devices, what with the amounts being so tiny. Well, I’m using one of these. It is supposed to be used for testing batteries and power supplies, but it gives a rather useful four digits of power consumption information. I’ve made up a special connector from an old USB cable and I’m getting depressingly accurate readings.

In case you are wondering about the device at the top, that is something you can use to apply a hefty load to a USB power source. If you do decide to use it, remember that the resistors (the two green things) will get very hot.

Send for the FireBeetle

If you hit a really nasty problem when you are building something, a good way to attack it is to try to change the problem to one that you think will be easier to solve. You can’t always do this; some customers really want particular deliverables. However, you should never make the mistake of assuming that things that are important to you are also important to the customer. In my earlier days I spent ages getting something to work which was dismissed as “..not really something that we want thanks”. If I’d asked the question “How much to you need this?” earlier I’d have saved myself a lot of effort.

In the case of my environmental sensor I’ve had a chat with the “customer” and discovered that the first set of sensors that are required for testing can be WiFi connected. That means that I can put the Heltec Cube back in its box for a while and switch my attention to something that works over WiFi. I’ve had a play with the DFRobot FireBeetle in the past and so I’ve built a sensor that uses that. The FireBeetle has some nice design tweaks that reduce sleep power consumption. It was fairly simple to port over the software I’ve already written, and I’ve designed a little carrier board that takes the Plantronics PMS5003 sensor along with a FireBeetle and a BME280. And it all works.

The only snag is that I’ve discovered that some device specifications have a lot in common with the current political situation. They are full of things that aren’t true when you test them. The FireBeetle consumes a thrifty 1.5 milliamps when asleep, which is just about viable for our application. Unfortunately the Plantronics PMS5003 sensor, specially selected for its low power features, consumes 4.5ma when I turn off the enable signal. This is much, much more than the amount claimed on the data sheet. Oh well. It turns out that to find out how hard it is to build something you have to build something….

Not all Arduino C++ Compilers are the same

When I was writing the code for the Heltec Cube I came across something that has caused me problems before. When you switch from one Arduino device to another you sometimes change compilers.

The compiler is the program that takes your source code and converts it into the low level instructions that the hardware will follow when the program runs. Different processors have different compilers and, what with C++ being a language with a few grey areas, this can change what happens when your program compiles.

In the case of the Heltec Cube I got errors when using structures in function parameters. In C++ you make a structure like this:

struct InputSwitchSettings {
int controlInputPin;
boolean controlInputPinActiveLow;
};

This is the type that describes the input port that allows the user to switch the device into configuration mode. It sets the physical pin number and also whether that pin is active low. Once I’ve got my structure I can then create a variable of that type:

struct InputSwitchSettings configPin;

I might make a function that wants to use the value of configPn, which means the function must have a parameter which is a reference to the variable:

void showPinSettings (struct InputSwitchSettings * switchRef)
{
Serial.println(switchRef->controlInputPin);
Serial.println(switchRef->contrlInputPinActiveLow);
}

The function showPinSettings will print the settings of the given input switch. Note that in the declaration of the function I’ve told the compiler that InputSwitchSettings is a structure (that’s what the word struct does).

However, some compilers let you leave this struct out (because the compiler can work out this information for itself). The compiler for the ESP32 is relaxed like this. However, the Cube compiler insists on having struct there. It took me a while to work out why code that I’d been using for ages suddenly broke. I guess it serves me right for being lazy.

If you start having problems when you target a different device on the Arduino platform, remember that you are not in Kansas any more where compilers are concerned.

Low Power Cube Problems

After the euphoria of getting my Heltec Cube Sensor transmitting data over the weekend I thought I’d take a look at the low power capabilities of the processor. I want to drop the power consumption of our sensor down to tiny levels so that it can run for a very long time on batteries. The device is billed as having a power consumption that drops to micro-amps when in “sleep” mode, and I was keen to try this out.

It was a rather fraught business. Firstly the power consumption never seems to drop below around 20 milliamps, even when in sleep mode. Secondly (and rather annoyingly) when the device wakes up from sleep some of the internal processes don’t seem to work properly - notably the millisecond timer. This might be down to my code though.

The device is very new and definitely a work in progress. I’m hoping that going forwards I can work out what is going on and properly realise its potential.

Sunrise at Radio Humberside

I was at Radio Humberside bright and early this morning to review the newspapers. This was great fun, and enlivened by an awesome sunrise right outside. I pressed my phone up against the glass to try and get a picture and got the image you can see above. The reflections are all caused by the second layer of double glazing that they need for sound proofing. At the time I took the picture I was a bit upset by all the reflections but having thought about it I think they add quite a lot of atmosphere to the shot.

Flying Blind with the Heltec Cube

Now that I’ve got the Heltec Cube sending messages to the Things Network, the next thing to do was to get the device reading from my particle sensor. This was tricky because the sensor uses the one serial port on the Cube. That’s the same port as is used for programming and sending diagnostics. So I had to fly my code “blind”. Fortunately the Cube has a single neopixel on the board which I can control from software. And by using that, plus testing the code on another device first, I managed to get it working.

If you watch the two second video above you can see the pixel flash green when the message goes through. I’m very proud of that….