Month: November 2020

Electronics: Raspberry Pi Zero W

Electronics: Raspberry Pi Zero W

The computer I’ve used to run Akiniscope is a Raspberry Pi Zero W. This has most of the facilities I need, and is small, cheap, and uses little power, which could reduce the size of the power supply I use. I went for one without 

Design: Font

Design: Font

Having written most of my early programs using a DEC VT100 terminal, I knew I wanted some of the feel of that type of equipment involved: The green glow of a CRT display, and the lined characters of the font embedded within the terminal. So 

Software: Pygame

Software: Pygame

Pygame is a set of libraries for Python providing graphics sound, keyboard, mouse and joystick support. I don’t have a keyboard, mouse or joystick in my project, but graphics and sound are exactly what I need to assist my project.

Originally it was written for games, but that doesn’t mean it can’t be used for other things, like an electronic art project. I’ll briefly describe the facilities I use in Pygame.

Graphics wise, Pygame implements surfaces and sprites. On games, surfaces are backgrounds, and sprites are the characters that run around. For this project, I don’t need sprites, but I make heavy use of surfaces. The surfaces are gradually assembled from a background, pictures and text, then displayed. Pygame describes surfaces here.

Photos are loaded onto a surface using Pygame’s image method, graphic lines and shapes can be drawn with the draw method, and text can be added with the older font method or the newer freetype method.

For sound, there are two methods: mixer.Sound for short sounds, and mixer.music for longer sounds. You can play quite a few sounds via the mixer.Sound method, but only one via mixer.music at a time.

There are of course a load of other methods, but they are the main ones I use. I’ve not had any real problems using Pygame, it works, as stated, with no unexpected surprises, which is exactly what I want.

Electronics: Akiniscope display

Electronics: Akiniscope display

When I started to think about the Akiniscope, it was of course just an idea. It first became a possibility when I bought the display. It felt like a big step, spending money on something that I was not sure would make it to reality. 

Software: Akiniscope design

Software: Akiniscope design

Rather than write everything from scratch, it’s easier to use a framework or libraries, written by people far cleverer than me. Akiniscope needed video and audio processing to be provided. Processing was the first I looked at, but I found this required more processing power 

Electronics: Akiniscope design

Electronics: Akiniscope design

The Akiniscope is based around the Raspberry Pi Zero W. I chose this, because it’s low power, small and cheap. You can also get a tiny camera for it. The W at the end means it has Wi-Fi connectivity, as well. The only drawback, is computing power. Open an internet browser, and it pretty much grinds to a halt. But, I like a challenge, and most of my professional projects have been done on small underpowered processors, so I’m used to optimising.

What’s connected to the Raspberry Pi? Well, I’ll do a full post on each of the items, gradually, but heres a quick list. Some of the bits I’ve not finalised on, yet.

The display is a cheap (£30) 10.1 inch LCD with electronics supplied to connect to HDMI.

The Raspberry Pi Zero W doesn’t provide an audio out, apart from via HDMI. So, for audio I got a little USB dongle. This will connect to a tiny 15W audio amplifier board, then an oval speaker. Will this be loud enough? No idea, yet.

I’ve found a nice PIR proximity sensor to detect when people walk in front of the Akiniscope, and take their picture. Most PIRs are deliberately made to be seen. This one, however is small and discrete, and you can even mount it behind thin material. I’ve been wanting to include this proximity sensor in a project for some time.

I also wanted a nice dial meter which could swing about when something happens. Ebay provided me with a nice chunky AC voltmeter. This means I have to control it, somehow. Current plan is to use a DAC to control the meter, probably attached to the Raspberry Pi via I2C.

There are a couple of LEDs as well. Both faking other things: a neon, and a valve. I could have fitted a neon bulb, in fact I bought one. But old neons flicker and I wanted that flicker. Most power indicators are red, so a red LED simulates the neon, which I’ve programmed to flicker randomly. The ‘valve’ LED won’t be seen, it’s hidden inside the case, just glowing through the ventilation grill. I’ll try an orange LED, and see if it looks valvy enough. Valves wouldn’t normally change brightness much, but that’s a bit boring, so, for a subtle bit of theatrics, the LED brightness dips, when a photo is taken.

There are going to be several switches on the front panel. Three rotary, and a couple of on-off style switches. For the rotary switches, I’ve not needed to find old looking switches, as it’s the knobs that will be an old style: A couple of chicken’s beak knobs, and a chunky round knob, that I’ve not yet found. The switches themselves are modern, so very easy to switch. Old switches clunked, when you changed them, so I’m going to have to mechanically interfere with them, to increase their clunkyness. The on-off style switches, I’ve not yet found with the right style.

The power supply is a cheap internal PSU, providing +5V, +12V +24V. I don’t think I’ll need the 24V, but it’s nice to have as a just in case. What I did want, is the 5V to be adjustable. I’m putting a bit of electronics between the power supply and Raspberry Pi, and wanted to compensate for any volt drop that may cause.

Finally, I may put in a heater. What on earth for, you may ask. Well. I want the Akiniscope to smell right, in some as yet undetermined way. This may involve a heater, to assist smell distribution.

There are some (a lot) of other details that I’ll cover later, but these are all the major chunks of electronics.