2023-09-30

Weekend bricolage: a lightbox for photographing electronics for under €15

I quite often have to photograph little things I've been working on for the blog and getting the lighting right is a pain. So, I took a trip to what's locally referred to as a loja chinesa (a shop typically run by folks with some connection to China and an absolute goldmine of everything from kitchenwares to tools to craft supplies to sewing supplies and beyond). 

I bought two nesting and non-transparent plastic measuring bowls, two metres of white LED strip, and the adapter for the LED strip for just under €15. Putting it all together I end up with the following:


This is the largest of the two bowls with a square hole cut for the camera of my iPhone 13 Pro. Wrapped around it are the two metres of LED strip. The strip is held on with clips that came with the LED adapter and screwed directly into the plastic with old self-tapping screws I had in my junk box.

I cut the bottom out of the second bowl so it can be nested inside:


The inner bowl helps diffuse the light from the LED strips to give even lighting for whatever is being photographed.


As a quick test here are some shots of random things that were lying on my desk.





So now I need to find something better than the iPhone Camera app that'll give me exposure and shutter speed control. Switching to PAL mode (50Hz compatible video shooting on the iPhone) gives me better images (I think):


However, because the iPhone has a rolling digital shutter and the LEDs are PWM (i.e. flashing on and off very fast) lots of photos come out with banding or horrible exposure. e.g.


This effect is because of the interaction between the rolling shutter and the LEDs flickering on and off every 1/100s. I quickly hooked the LEDs up to my oscilloscope and you can see the on/off cycle there:


So, I sneaked a go with my wife's Nikon D3100 camera which has a mechanical shutter. No banding:


I just need to tell the camera about the colour temperature of the LEDs for a better image. So, the DSLR with mechanical shutter wins over the iPhone camera here. Way more controllable and no banding.

2023-09-11

Weekend bricolage: an aroma picker for the Le Nez du Vin game

The Le Nez du Vin MasterKit 54 is a set of 54 aromas found in wine varieties across the world and is designed to help you develop your ability to distinguish aromas.

The aromas range from lemon to smoky via hawthorn, mushroom, leather and more. The box contains 54 vials, a book and a set of cards describing each aroma and its relationship to specific wines.


There's also a game you can play with friends. Throw a die, land on a category (fruity, floral, vegetal/spicy, animal, roasted or wildcard) and someone picks an aroma from that category at random and you have to smell it and determine what it is.


It's great fun, but picking the random vials is hard. The fruity category is vials 1 to 23, floral is 24 to 29, vegetal/spicy is 30 to 44, animal is 45 to 47 and roasted is 48 to 54. Humans are notoriously bad at picking random numbers, so I created a little "aroma picker" using things I had on hand from my box of spare parts.


It's made from six arcade style buttons with integrated 5V LEDs (happily these LEDs also had current limiting resistors so they can be connected directly to a GPIO port on a microcontroller), an on/off switch I salvaged from something, a little cardboard box made to contain a gift, an Adafruit Trinket Pro 5V (note that these are deprecated and I had to program via an FTDI cable because the bit-banged USB would not work), and an ancient SparkFun seven segment display.

I'm using the Trinket Pro because I had it lying around but also because it has a lot of GPIO ports (and I need 12: six for the buttons and six for the LEDs). Note that since the microcontroller has built in pull-up resistors there's no need for any resistors on the buttons. Also, the Trinket Pro 5V will provide 5V to light the LEDs and run the seven-segment display (and it has SPI to talk to it). 

A fun aspect of this project is that I needed to do some old-fashioned geometry with a compass and straight edge to place the buttons nicely. First up is find the centre of the lid.


It's a little hard to see but you first draw an arbitrary chord to the circle and then create the perpendicular bisector using a compass. That results in a line through the centre (i.e. a diameter). You then bisect the diameter line to obtain another diameter and where they cross is the centre.

Then on the other side you draw a circle where you want the centres of the buttons and then construct their placement using a compass. Since there are six buttons they will be 60 degrees apart and it's enough to set the compass to the radius of the circle and then mark a point on the circle and just inscribe arcs using the compass. They will be 60 degrees apart.


The actually "circuitry" is just a lot of wiring. Six GPIO ports connected to the buttons, six for the LEDs, and the other terminals on the LEDs and buttons all tied together to ground. The seven segment display requires power and three SPI signals: SCK, SS, MOSI. And one other connection... I used this type of display before in a project and it's prone to corruption. There's an extra wire between RX and ground to make sure that the display doesn't pick up any noise from the floating serial connection.


The whole thing runs on a 9V battery connected to Vbatt on the Trinket Pro. Those big, thick green wires are another thing that came out of the "box of random things". They are left over from back when I cut up a set of GE addressable Christmas lights to make a display.

The software itself is pretty simple and you can see the code here. Here's a GIF of the aroma picker in action after pressing the "fruity" button (the one with the apple on it):


2023-09-09

Breathing life back into a Minitel 1B with the Minimit!

Regular readers will know that I have a lot of love for the French Minitel system and own a couple. In the past I've written about using a Minitel 1B as a terminal and replacing the EPROM in a Minitel 2 to run custom firmware. Today I'm going to blog about a project called Minimit.

The Minimit is a small, Minitel-shaped box that attaches to the Minitel's DIN port and brings the Minitel experience back to life. The box contains an ESP32 which talks to the DIN port outputting Minitel-compatible text and graphics. And the graphics and letters appear slowly just as they would have in the 1980s.

Here's my Minitel 1B connected to the Minimit (with a couple of 1980s accessories to set the scene).


On first boot the Minimit asks you to set up the WiFi configuration and make an account.


After that it's back to the 80s! Pressing the Guide button brings up a list of Minitel services.


They've built in the news from Le Monde for every day in 1983, so selecting 7 and hitting Envoi brings up Le Monde with headlines for today (September 9) but 40 years ago.


But weather information is live. Looks like a nice day in Toulouse.


And finally here's a taste of Minitel in action. Here I hit the Suite button to get the next page of headlines.


2023-09-05

SwissMicros' beautiful "HP" calculators

I love calculators and have written about old calculators that I've owned over the years (including my Commodore P50 (and programming it to do primality testing in just 23 steps) and Rockwell 8R). Growing up I never had access to Hewlett Packard's wonderful line up of RPN calculators. After all, the HP calculators were professional devices and well out of the reach of my (and my parents') small pocketbook in the UK.

So, I had to make do with my trusty Casio fx-3600P. I had great fun programming it and it got me through A-levels and whatever parts of my undergraduate degree required calculations (which given that I was mostly studying mathematics is almost nothing).


Later I was able to find a genuine HP-16C "Programmer's Calculator" on eBay. It was the first calculator for doing hex, decimal, octal and binary that I'd owned and found it useful but kind of slow. The Casio felt way snappier to work with.


But, even though it felt slow, it felt solid, like it was a real tool made for real work. As much as I loved the Commodore, Rockwell and Casio, they all felt a little flimsy compared to the HP. Sadly, HP's range of calculators is very small these days.

Luckily, a company called SwissMicros has stepped in to make beautiful modern equivalents of many classic HP calculators. And by using modern CPUs and software they are fast and a joy to use. On top of that they amazingly feel even more robust and made for "real work" than the originals.

I own the equivalent of the HP-16C from SwissMicros, called the DM16L.


On my phone I have an emulator of the HP-42S called the Plus42 which is wonderful but there's nothing like the feel of the real keys on the calculator so I also have SwissMicros' equivalent calculator: the DM42.


I guess it might seem weirdly anachronistic to use a physical calculator rather than the virtual one on my phone, but there's something about the physicality and 3D-ness of the SwissMicros devices that makes them a pleasure to use. And they are a rare, modern device that makes me feel like someone really cared about building it.