Vintage Camera Digital Hybrid Project

Vintage cameras look great, but film is expensive and so is processing. I’d like to take a vintage camera to a 1940’s event, and use it liberally without the expense of film!

Initially I considered putting a Raspberry Pi and the dedicated HQ camera into the old Ensign folding camera that I bought from eBay. However, the C/CS lenses are either pricey or crap or both. Thanks to a Twitter reply from Maks Surguy I now know about higher quality M12 lenses; https://twitter.com/msurguy/status/1365350221249613824?s=12 but there’s no easy way to focus and no aperture adjustment. Fine for other projects though 👍🏻

Then I wondered if I could “transplant” the workings of a digital compact camera?

Fortunately the slightly-battered Fuji A series that I bought for £1 off eBay has a sensor and lens assembly that is attached to the main PCB by ribbon cables. This is ideal! It won’t be easy to extend if I want to put the gubbins in the rear of the Ensign, but not impossible 🤔

After this discovery I bought a fully working A series for a few more English Pounds to use as the donor camera. I also have spare parts from the battered one I bought first!!

Overly Elaborate I2C Scanner Device

Close up of IIC scanner's screen.

GitHub linke here: https://github.com/CraigMarston/fancy_i2c-scanner

The idea from this project is because I have many cheap I2C devices bought from China via Fleabay or Aliexpress and they arrive with no documentation. To obtain their address I’d previously have to load up an Arduino board with the sniffer sketch, and obtain the address via the serial console on my laptop. This way I can just plug the device in to the reader to obtain its address!!

I2C scanner sketch with a TFT screen to build a standalone device

I2C scanner: Maybe elaborate, but I wanted to use an SPI screen to keep the I2C bus free! This size screen is around the same size as the tiny OLED screens anyhow.

I started off using an Arduino Nano clone, but I can’t be sure the cheap TFT screen is 5V tolerant — although it does have a 3.3V regulator on-board for its supply. I would have needed two 4-channel voltage shifters in this case, so just opted to use an ESP8266 device instead. An Arduino Nano Pro (3.3v) would be ideal for this.

The sketch is built from a basic I2C scanner and I’ve simply added the facility for the SPI screen.

The plan is to put this into a box so it becomes a tool that I can just grab.

Colour codes can be found here: https://github.com/esp8266/Basic/blob/master/libraries/Adafruit_ILI9341/Adafruit_ILI9341.h

Rotary Controller NeoPixel Changer

Addressable RGB LED controller device

Link to GitHub here: https://github.com/CraigMarston/rotary_neopixel_changer

C++ project for Arduino Nano / Uno (ATMega328) to control WS2812 RGB LEDs (NeoPixels) with a rotary encoder. Also includes a TFT screen via SPI.

This is my first attempt at using a rotary encoder, and there are many excellent well-written examples available. This one in particular stood out to me: http://www.hobbytronics.co.uk/arduino-tutorial6-rotary-encoder

I have amalgamated many examples, so the majority of this code is not original..!

The rotary encoder is connected to the two hardware interrupts int0 and int 1 of the ATMega328, and the push-button is merely polled. Rotating the device changes the value of a variable which is used to set various parameters. Pressing the button sequences through a ‘case’ function to choose which parameter to change. To add more parameters, this part of the sketch would need altering and most likely refining — something I’d like to see!

The WS2812 LEDs are driven using the HSV conversion, and here is a brilliant explanation: https://www.arduinoslovakia.eu/blog/2018/4/neopixel-ring-hsv-test?lang=en

Also, I’ve stuck with the NeoPixel library rather than FastLED because I want to use RGBW LEDs with this project. They have a fourth white LED which facilitates a wider gamut of colour, including pastel shades — PROPER rainbows!!

The hue parameter for the NeoPixels is 16-bit (0 – 65535) but I’ve used the ‘map’ function to convert 255 steps (twiddles of the rotary encoder!) to cover this much larger value. Now this does mean that a lot of hue values are skipped, but it saves over 65000 twiddles to get round the colour wheel!! Talking of colour wheels: https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-use#hsv-hue-saturation-value-colors-dot-dot-dot-17-41 — this should explain where the numbers come from.

The TFT I used is a generic cheapo 128×128 pixel, slightly wonky one via AliExpress. I connected a different screen and my icons were all displaced vertically. I don’t know if there’s a simple asjustment for this, y’know like you have a desktop computer screen, but I couldn’t find anything with preliminary internet searches…

The colour-space for TFT screens is a right old PITA!!! It’s RGB565 and has four characters representing the 3 channels we’re familiar with. So, greys look like this:

cementGREY 0xBDF7 LIGHTGREY 0xC618 steelGREY 0xE71C DARKGREY 0x7BEF

instead of equal values e.g. 0x555555 or 0xCCCCCC in RGB888. It’s hideous and you’ll need to use an online converter to find your own colours. And they won’t be exact either, just so you know.

Please, please let me know of any improvements you can make as I still consider myself new to this — thanks!

Retro Google AIY Phone

[wpvideo KLZM1auc ]

We’ve had an old Bakelite phone for years as nothing more than an ornament, because some of its innards are missing.
I’d been itching to hide something in it for quite some time, but I was loathe to damage the Bakelite casing.

I removed all the parts I could, so that I could use the threaded holes and screws for mounting the new 21st Century innards!

The hook-switch contacts were carboned up, so I cleaned them with some P1600 abrasive paper, and tested them with a multimeter.

Rather than using just the hook-switch to trigger the Voice HAT, I decided to use the dial as well, to avoid false triggering if the receiver gets knocked.
I wired the switches in series, in a logic AND configuration; this requires the handset to be lifted and dial to be rotated to trigger.

Again with the steel base-plate, I really didn’t want to drill it to mount the Raspberry Pi. Were it not for the circuit diagram printed onto a large paper label and stuck to the base, I’d have used self-adhesive PCB mounts. Instead I opted for magnets!!

Because I couldn’t find enough technical data on the Voice HAT, and I wasn’t sure how the pulsing LED was powered, I used an opto-isolator to trigger a pair of transistors. One transistor powers each strip’s blue LEDs, whereas the green LEDs are connected straight to the power so that they are on constantly whilst powered up.

The board containing the opto-isolator and transistors is also held in place with magnets!

Colour-check quality approval.

The speaker included with the AIY kit is waaayyyyy too big to fit in here, so I bought a 4W subminiature speaker instead. I crafted a horn from some 3mm ABS and a Bosch glue-gun, to channel the sound through the little holes — where the sound from the bells would have originally escaped!

The sound does unfortunately sound “plasticky” — plywood would likely be better for this — maybe a future modification…

To avoid voltage drop in the supply, I opted to use 12V power in, then a DC-DC converter. The converter I bought states it can handle 15W and comes with USB A sockets on flying leads. I was able to mount the module using existing holes and non-metric screws; you can see the module in the top-right of the next image.

The original cable is fabric-covered, and it is possible to buy new mains cable in this style. However, I’m also running an ethernet cable out of the back so I used expandable nylon braided sleeving to cover the flat ethernet cable and power cable. I underestimated just how much this stuff can expand to accommodate plugs passing through (like a snake swallowing a meal!) so the current sleeving is way over-sized!

So, future mods include improving the speaker enclosure, and replacing the cable sleeve with some of narrower diameter.

LOUD Continuity Tester!

[wpvideo JL0pTYmA ]

I noticed that my father-in-law struggles to hear the feeble high pitched squeak from DMM continuity testers. It’s not just years and years of working with noisy machinery sans ear-defenders — in a noisy environment, they really are difficult to hear!

This device uses a PICAXE microcontroller because they’re cheap (Arduino doesn’t like me), easy to programme, and I have oodles of ’em. The system runs from 9V, so there’s a small 5V regulator to run the chip. The speaker however gets the full 9V via a power transistor.

I selected ‘concert A’ as the tone at 440 Hz, added some start-up tones (old skool) and there’s reminder tone after 5 minutes of not being used.

The programming socket is accessible via a pop-off cover, for upgrades or fixing errors!

Temperature Switch for 12 V DC fan — powered from solar battery bank

My brother-in-law mentioned that he needed a thermal switch for the fan in his shed. The building works as a heat-trap during the day, and he’d like a way of blowing the hot air out, so that it’s more habitable when he gets home from work.

I have an abundance of Picaxe chips, so that’s what I decided to use for this project, specifically the 20M2 variant. I also used a second chip to make a serialised LCD: This means the main chip only needs one data line to operate the LCD. It also made testing & development easier for me.
I could have used a RaspberryPi Zero, but I’m still at beginner level with Python, so this would have ended up as a winter-heating project instead!!

Generic LCD with a serial backpack, using an adaptation of PICAXE’s code for their AXE133Y modules: http://www.picaxe.com/Hardware/Add-on-Modules/Budget-Serial-OLED-Module/
The time taken to build this little board was absolutely not worth it — for about £4 a generic PCB can be bought, that will do the job!!

The chip running the main programme was mounted on a kit PCB from CPC — this little kit comes with everything needed to programme and house the PICAXE 20M2 chip:

The RKP20c kit used to home the main chip. Much quicker and easier than using stripboard! http://cpc.farnell.com/rk-education/rkp20c-kit/project-pcb-for-20pin-picaxe-genie/dp/ED00014?

The main programme measures the ambient temperature and compares this to the user-set temperature: if equal to or above, then the fan switches on. Hysteresis of 2°C is written in to the programme, which may need altering, but testing needs to be done.

The temperature probe is a DS18B20, and support for these devices is written in to the PICAXE firmware. This makes things easy!

A hole can be drilled for access to the programming socket, but it may not need reprogramming…

I’ve made this project modular for two reasons: 1) I only have short periods of tinkering time, and can easily forget where I got up to with large projects, and 2) it aids fault-finding.
A third benefit is being able to use manufactured modules / kits instead of Veroboard. E.g. the relay module kit cost about the same as a relay on its own!

When the user changes the trigger temperature, it is stored in EEPROM in case the power is turned off. The value is loaded upon power up, with the assumption that the user will have an optimum temperature.

All the boards in the enclosure. C/W from top left: microprocessor with main programme, serial LCD driver (stripboard), generic LCD (green), voltage divider (small piece of stripboard in yellow heatshrink), relay module, 5V regulator (bottom left).

As this is running from a solar installation, it makes sense to monitor the voltage of the lead-acid battery, AND have a cut-off should the voltage fall too low.
Because this is a 5V system; a voltage-divider is required to measure higher voltages, so that the chip isn’t fried by receiving a voltage higher than its supply voltage. This makes use of the established potential divider equation:

V_out = (R2 / R1 + R2 ) • V_in

There is also a piezeo disc that will sound a warning if the battery voltage is too low.

The yellow button in the middle changes the mode of the unit from ‘Auto’ to ‘on’ to ‘off’.

Auto mode shows the ambient temperature, user-selected temperature, and battery voltage (visible in all modes)

Over-ride mode shows ambient temperature, ‘FAN ON’ (the purple LED indicates the relay is activated), and battery voltage

‘OFF’ mode operates as a temperature gauge and battery monitor, for cases when the fan isn’t likely to be needed. It also mutes the piezo sounder for cases when the battery voltage is low.

Raspberry Pi 2 GPIO levels after shutdown

There are now many tutorials, Instructables posts, and even devices which help with adding a physical shutdown button to the Raspberry Pi. I want to build something that will completely and utterly shut-the-chuff-off i.e. switch the mains off. I aim to use a PICAXE microcontroller to handle this shutting off via a relay, but the PICAXE needs to know when it is safe to proceed.
I used a handheld oscilloscope to measure the voltage levels of the GPIO pins while the Pi was running, versus it being shutdown with the power still connected. The ONLY pin with a significant change in voltage is GPIO14 (TXD0) on physical pin 8. It drops from around 3.4 V to around 1.3 mV, so I’m hoping that I can use this to indicate to the PICAXE that the Pi has shutdown, or is in the process of shutting down and programme a delay of, say 10 seconds.
This could also work as a fail-safe such that only IF the level is low for this entire duration will it proceed with the switch-off.

4pin Raspberry Pi GPIO pin-out from Farnell, with annotations.
40-pin GPIO of the Raspberry Pi 2.