It's often a power supply problem. Especially if it can't be.

I've been working on an an air quality sensor that we are hoping to attach to a lamp post somewhere in Hull. I’ve got the hardware just about sorted (as you can see above) and the software should work fine.

But it doesn’t.

As soon as I connect everything together the serial interface to the host computer stops working. This is not a problem in operation, but it makes it hard to configure the device. I spent a little while trying to find out how the software could behave in this way and failing. After all, it works fine in other devices that I’ve made. And then I realised a very important aspect of embedded development.

“It’s often a power supply problem. Especially if it can’t be.”

The problem appears when I connect the SDS011 sensor. This is not particularly greedy in power terms, but it does take a bit more out of the device and this seems to tip something over the edge and stop it from working. If I add a second power rail to a different point in the circuit all is well. Now, it might be that the Heltec that I’m using is sensitive in this way, but we can’t have unreliable devices. I think I’m going to have to acquire some PCB design skills and make a proper carrier board with sends the power to all the right places.

Big in Bedfordshire

Continuing on the theme of “Imitation is the sincerest form of flattery” I’ve noticed a bit of traffic on my blog post from 2013 introducing the coursework that I’d set that year for the first year programming course. When I was teaching I had a strict policy of always creating new software scenarios because of the dangers of recycled solutions.

It seems that the folks at the University of Bedford are a bit less fussy. There are some changes to the original text that I set but apart from that it’s the same. Oh well.

Big in China

I got an email from a reader who was very enthusiastic about the Chinese version of one of my Begin to Code books. Apparently even the jokes (both of them) have been preserved in the translation. I asked for a look at the text, and this appeared on my Twitter feed, which was nice.

Of course, the thing that makes this most interesting is that I don’t think that Microsoft has made a Chinese version……….

FreeCAD is awesome

I’m starting to really like FreeCAD. I’ve used it for years, but I’ve been cheating in that I’ve used internal Python engine to run programs that design things. However, over the last few days I’ve hit up against things that are a bit hard to do programatically, so I’ve been investigating the tool itself. It’s awesome. I can now draw paths and then use those to create curvy objects like the pipe above, which also has a cutout for the BME280 environmental sensor. And then I found that FreeCAD also supports spreadsheets.

You can bind properties in your drawing to values in a spreadsheet. So, if I want to change properties in my drawing (perhaps increase the base thickness) I just change the value in the spreadsheet and the drawing is automatically updated. Dimensions in the drawing are mapped back to the spreadsheet cells. It’s wonderful.

Pick and Mix Nuts and Bolts

I’m building an Air Quality sensor. As you do. I need a variety of different nuts, bolts and washers to hold bits of it together. Normally this would be a pain, as I’d have to buy twenty of something I only need four of.

But now B&Q (the big diy warehouse in Hull) have a “pick’n’mix” display for things like this. It’s like it used to be with the sweets at Woolworths. A full bag like the one above is around two pounds fifty, which is fantastic for making things.

In search of ancient files...

It turns out that my original C programming notes are coming back into fashion. Thanks to the archiving efforts of a site in China (thanks foks) I’ve managed to get hold of the PDF of the notes, but I can’t find the 25 year old original of the document. I’ve spent a big chunk of today turning on ancient laptops and finding that their disks don’t go round any more, including this one above. I think the platter has kind of stuck. Or something. I’m tempted to open it up and give it a tiny twirl. After all, it can’t make things worse……

Good Friday Sounds

Number one son has been buying vinyl. Just like I was doing forty years ago. In celebration we got his B&O system down from the loft and fired it up. It used to be my dad’s pride and joy, and it was wonderful to hear it back in action. The word was that if it didn’t go bang when we powered it up it would probably work fine. And it did. There’s something about proper analogue sound that I really like. Perhaps I’ll get my deck (and all the records) down and have a go some time.

ESP32 powered webcam for 7 pounds

In my fingers above you can see something rather amazing. It’s an ESP32 powered webcam and it is priced at a stupidly low level. Mine arrived earlier this week and I’ve found a splendid howto that gets you started. You’ll need a serial interface to program the camera as it doesn’t have a usb connection. I used the one I got with some Arduino Pro-minis a while back. A couple of tips:

  • make sure you update to the latest version of the ESP32 board. The older camera sample will not compile.

  • the device can be a bit picky about power supplies. Mine gave “brownout” warnings for a while before I connected the 5V input to a slightly beefier supply than the 3.3V I used to program it

The camera serves up a website with a wealth of controls that you can use to change the image quality. You can use it to grab stills or watch a video stream. It even supports facial recognition and it has a micro-SD slot for saving stuff to. Amazing.

For the price you really should get one of these and have a play. I’ve been looking for a quick way to get pictures into Azure for training image recognition. I think I may have just found it.

GitHub Two Factor Authentication with Microsoft Authenticator

I’ve just turned on Two Factor Authentication for GitHub. It occurred to me that seeing as how GitHub is now my “weapon of choice” for organising anything, and I can make my own private repositories, I should take some steps to keep them private.

It’s actually very easy to do, once you have an app that can produce “Time Based On Time passwords” or TOTPS. I’m using Microsoft Authenticator. I figure that since Microsoft now own GitHub, it’s likely that Authenticator will work well with it.

Making bendy pipes with FreeCAD

Achievement unlocked. I now know how to make “bendy” things in FreeCAD. It’s actually not that hard once you work out what FreeCAD needs to know. Essentially you use one Sketch to define the path of the template and another (which should be at right angles to the path) to define the closed shape to be created. You can even add another closed shape at the end of the path and then have the shape smoothly change from one to the other. I’ve used this to create tapered tubes.

I’m doing this to make another Air Quality sensor. I want to send the air path round a curve that is too tight for pipe. I also want to add a “u-bend” so that it is harder for water to get into the sensor. I’m quite pleased with the above. Now I just have to figure out how to mount it in the case….

Crippled Hexabot

Ages ago (well, four years) I made a hexabot from a kit. Today I thought I’d get him out with a view of adding some sensors and an ESP32 to make him a bit more autonomous. He was a bit lame. Two of his servos had stopped moving. Fortunately I had some spares and so I set about getting him walking again.

It didn’t go well. I broke a replacement servo finding its mid point and fitted the second one upside down. Twice. I think that a few hours of gardening has destroyed my ability to work with electronics.

However, I think he is now back to his sprightly best. I’ve ordered a camera pan and tilt (around 3.50 with servos) and a distance sensor with pan mechanism (also around 3.50) from AliExpress. Looking forward to them arriving.

Gardening

I’m not that keen on gardening. It seems to me that you can spend ages making the garden look nice and then, only a few years later, you have to do it all again.

Sometimes it’s more frequent than that.

The latest re-modelling involves the removal of stuff. I’m quite good at this, although I’m a bit of a blunt instrument and I’ve been known to generate a lot of “collateral damage”. Today I was carefully programmed with the items to destroy and left to it.

Pro tip: If you are removing something substantial from your garden, don’t cut it down to ground level before trying to dig out the roots. Leave a nice long stalk to use as a “handle” to give you some leverage on the stump. I did this, but the person who’d chopped down a whole bunch stuff before me hadn’t. As a result I had a happy five hours digging round the tiny bits left, chopping and sawing roots and using appropriate language.

I’ll tell you one thing though, if you think I’ve had a bad day, the objects of my attention had a much, much, worse one…………

If you've got Netflix, watch RIPD

RIPD is the kind of film that you might like to watch after a hard day writing and editing course notes. It’s nice, mindless fun. If you took the scripts of “Men in Black”, “Ghost” and “Ghostbusters” and put them in a blender you’d get the script for RIPD. In fact that might be how they did it.Then again, they may just have decided that the name RIPD (Rest In Peace Department) was awesome and written the entire film from that.

Either way, it doesn’t take the caper comedy film anywhere particularly new, but it’s still worth going there.

Back Lit Tracing Screen

I’ve been taking pictures of devices for a course that I’m writing. I’ve been fretting about the way that it is hard to avoid shadows underneath components and wires. I wondered if a tracing screen would be any good at eliminating dark areas on the background. You can pick them up for not much money nowadays, so I bought one.

It’s not quite what I want, as you can see above the light is a lot of points rather than even. I’m trying to find a diffusor that give a nice even spread. However, this does mean that if I ever want to trace some pictures I’ve now got the perfect device.