Making a lensboard

I already had some code that made rounded cornered plates

One of the truly great things about having a 3D printer is that if you have a need for something you can just print one. My “auction packed” camera arrived last week and today I thought I’d pop a lens in it so that I can try taking some pictures. For these type of cameras the lens is mounted on a plate called a “lensboard” which is then fitted into the camera. This makes it much easier to swap lenses when you are out and about. The camera didn’t come with a lens, but it did have a lensboard.

Unfortunately it was the wrong size. The hole in the middle was too big for the lens I wanted to use. So, I decided to make my own lensboard. I’ve made a quick version in OpenScad and tomorrow I’ll print it out and discover just how wrong it is.

Looking inside the mind of a running MicroPython program

The text in red is just the REPL code in ThONNY getting upset…

I love typing in interactive commands to the MicroPython REPL console. It makes development much easier as I can test out program constructions and even view the contents of variables after I have interrupted the code. But the problem is that I lose the REPL console when the program starts running. MindReader fixes that. It lets you type in Python statements which will be executed as your program is running.

To use it you add the MindReader class to your program. Then make an instance of the class (I called it m) and call m.update() in your program at regular intervals. The update method scans the serial port and builds up a command. When you press return it executes the command. This means that you can still type in REPL commands when your code is running, which is neat. You can enter print statements to view variables or even modify them for testing. I’ve found it very useful. You can find the code on GitHub here.

Connected Little Boxes at the Hardware Meetup

I’ll bring along a text display too.

I’m bringing a bunch of Connected Little Boxes to the Hardware Meetup next Wednesday. I want to show off the web configuration and deployment and what you can do with QR codes.

If you fancy coming along you can just turn up at Hull MakerSpace on Wednesday 11th of October from around 5:00 pm onwards. I’ll be around with some devices to show off, and even ones that you can take home with you (numbers permitting). It would be lovely to see you.

My diodes arrived...

I’ve been making a circuit that lets a Raspberry PI PICO ring an old style telephone bell. Yesterday I discovered that voltage pulses generated in the coils that power the bell were destroying the MOSFETS that I was using to control the power. Today I got some diodes that I was able to fit across the coil connections. Now the bells ring out loud and clear. It’s so loud you can hear it next door. Which might not be a good thing.

Exploding MOSFETS

I didn’t see any sparks though..

My MOSFETS arrived today. I connected them into a circuit that controls the power to a telephone bell using a Raspberry Pi PICO. They worked quite well. For a while. Then the ringing stopped. I was pretty sure what the problem was. It’s all to do with collapsing magnetic fields. The bell is operated by a coil which turns magnetic when you put power through it. This attracts the “donger” (for want of a better name) which strikes the bell making it ring. Then, the coil is turned off and another one turned on to move the “donger” in the opposite direction towards the other bell. If you do this around 20 times a second you get the ringing sound you get in old films and TV shows.

The snag is that when you turn off a circuit containing a coil the magnetic field the coil has generated collapses, and when it does this it induces a voltage in the coil. This behaviour is used to good effect in transformers and car ignition systems but in this case we end up with a bunch of voltage with nowhere particular to go except back up the wire into the MOSFET that just turned it off. Sometimes you get lucky and he pulse causes no damage. Other times you don’t. I’ve been kind of lucky. Only one of my MOSFETS is broken. The good news is that I know exactly what to do. I need to put a diode across the coils to short out any induced voltages and stop them causing damage.

They really knew how to make things back in the sixties

Started a new project today. I’m taking an old phone and making it more interesting. It’s going to have a Raspberry Pi inside along with extra circuitry to make the bell ring. Which is proving interesting. The bell in old phones is triggered by a 70 volt ac signal. Now, 70 volts is the far side of “tingly”. Anything below 50 volts is probably OK to grab hold of, but 70 could give you a shock you could do without. Especially at my age.

I’ve manged to get an inverter to convert 12 volts into a slightly less nerve jangling 35 volts or so. The plan is to drive the two coils that work the bell (you can just see them at the very top of the picture above) separately. So that I only use half the voltage. All I need is another MOSFET power driver (I’ve said this many times) so that I can control each coil individually. It should arrive tomorrow. I’ll add it to the circuit that I’ve already built which uses one MOSFET so that I can make the bell both “ding” and “dong”.

Magazine Takeover

They are both jolly good reads

I’m in two magazines this month. Which is nice. If you pick up a copy of the latest HackSpace magazine you will find my article about creating a PICO Powered Bluetooth remote control for a light. This is known as the “milkshake” project because I put the device in an empty milkshake container. Delicious. Then, in MagPi magazine you can find a reprint of my article about making a chord keyboard. This is known as the “missing wires” project because I forgot to add some of the wiring to the design.

Auction Packed

Well, why wouldn’t you want one of these….

I now see myself as a proper camera collector. Why have one camera that will do what you want when you can have lots of them, each of which does something different? Most of my camera buying action takes place on eBay, but today I had a taste of real life auctioning courtesy of Flints who run online auctions every now and then. I’ve been in the market for a large press camera that takes 4x5 negatives and they had one for sale that appeared only slightly broken. So I fired up the browser, logged into the site and hovered the cursor over the “Bid now” button.

It was great fun to watch. The auctioneer did a splendid job of keeping the whole thing moving along at a good pace, which was kind of important as there were around 500 lots to sell. After a couple of speculative bids on things that I wasn’t that bothered about “my” camera came up in lot 117. I was holding myself to all kinds of promises about not getting carried away and set a rigorous upper price limit. However, it was all a bit of an anti-climax. Nobody else seemed that bothered about the camera and so I got it for a smidge under the suggested lowest price. And that was that.

I watched the auction for a bit longer, but I was very good and didn’t buy anything else. The prices of items did seem impressive, but you had to remember that each item attracts a 30% premium that you had to pay on the sale price, plus VAT and carriage. My camera ended up costing me quite a bit more than the price I bid, but I reckon it is still a bit of a bargain. I’m rather looking forward to it arriving.

Constant Companions at Scarborough

This is a very clever poster.

We went to Scarborough today to see Constant Companions, a new play by Alan Ayckbourn. It’s a very human production about what happens when people and androids get together. For me it was a play of two halves. The first half was part farce and wry social commentary. The second part then runs the stories forward to their “logical” and somewhat heart rending conclusions, leaving me with lots to think about as we headed out of the theatre. The acting and staging were superb and the whole thing added up to the best night out that we’ve had in ages. Pro-tip: get your drinks and ice cream delivered to your seat during the interval for that “properly spoiled” experience.

The play is on for a little while longer. Seats are very keenly priced, the theatre and the staff are lovely and Scarborough is a great place to visit. Go see.

Tokyo Game Show in VR

Worth a visit

We went to Tokyo Game Show tonight. It was great fun. It’s no substitute for the real thing, but it is worth the effort. To make it work I connected my Quest 2 to my PC and then fired up the program you can download from here. After a few large downloads and a quick registration I was good to go. I fired up the PC game from the Quest and I was then able to find the server where number one son was connected and then we went around together. I usually use the Quest as a free-standing device, it was interesting to see what it is capable of with a proper PC behind it.

There are a number of different levels in the VR show. Each one has a bunch of game stands. I took loads of pictures with my in viewer camera, but I’ve no idea where they ended up. It’s not enormous, we managed to get around the stuff in an hour or so, but it is worth a visit.

Device Configuration using Web Pages

You need to use Edge or Chrome

I’ve had a lot of fun making the Agile Octopus Tariff display. It works a treat. The device is powered by a Raspberry Pi PICO-W which connects to your Wi-Fi and grabs the tariff information from the Octopus server. However, the display needs to be configured with Wi-Fi settings and the web address of the tariff information. You can do this by editing the MicroPython code in the device, but I wanted something easier. I wanted you to be able to take a display and configure it anywhere. So I’ve built a web page which connects your browser to the device over a serial connection. The display sends a little chunk of JSON to the webpage which builds a web page which will accept the configuration data. You make your changes, hit “Submit” and the values are all sent back to the display.

You can find the page here. The GitHub page with the source code for the project is here.

Dominion Calc. Version 2

What do you do if Dominion crashes at the end of the game and you’ve no idea who won? Up until recently the only solution was to decide that the last two hour’s of gameplay didn’t actually happen. But now you can copy the game log out of the browser window and paste it into DominionCalc which will try to work out all the scores.

The first version I made was a bit simple, but I’ve upgraded it to add more gameplay. I don’t think it is perfect, there might be scoring reports that it doesn’t know about, but at least you’ll have something to brag about. The new version adds proper player names and a summary at the end. Although I still think there might be a bug in it, what with me being reported as last player….

I’ve also put the code on GitHub for anyone who might be interested.

Network isolation

I hate it when hardware manufacturers spoil their products by skimping on one, crucial component. Take NetGear for example. They make quite good network hardware, but then they add the cheapest possible power supplies they can find. This means (for me at least) that every few years I have to buy a new 12 volt power supply to replace the one that just went pop.

I’ve just had to do it again. One of the routers in my network failed. The good news is that when this happens my eero network converts one of the Wi-Fi repeaters into a network receiver and so the network keeps going - just a lot slower than it used to. It can take me a while to discover that the network is broken in this way, I usually discover things are not right when I have to do an update to Microsoft Flight Simulator.

Playing with e-ink

This is a very good price for electricity..

I’m making a little device that shows the prices of the Agile Octopus Tariff. I’ve got it working on an LCD panel and today I thought I’d get it going on an e-ink device. The one I’m using is made by Pimoroni. You plug your PICO or PICO-W into the back, load up their code and off it goes. I’m really impressed by the quality of the display, although it can take quite a while to update.

The display above shows the current price per kilowatt/hour and a little histogram showing how the price will change for the remainder of the day. It turns out that the important thing with e-ink displays is to minimise the number of redraws that you do. I’ve made a little set of display items which manage their particular elements and only redraw when their contents change. All the code will be upon GitHub once I’ve made it work.