I cringed when my wife told me her digital enlarger timer broke. Thankfully it didn’t cost us a lot at the time, but it should have. I was lucky enough to restore a broken one I bought off eBay, no such luck this time. But then I thought, a timer is a really simple thing. Why should buying a new one cost over $200? I decided to build my own, and now you can too for less than $60!
An enlarger timer is very simple, it just needs to turn on the power to the enlarger for an exact period of time and then turn it back off. I currently have it set to have tenth of second accuracy. I also went ahead and made the darkroom light switch off during the process, as the IoT relay has a built in negative gate logic for one plug.
Required equipment for the timer
- Raspberry pi (such as pi zero with headers): $13
- Power Relay (such as the Iot version also available at sparkfun): $27
- A Red Dot matrix: $10
- A numpad, or old keyboard: $8
A quick warning before we begin: I did all this over a year ago, and while it is still working flawlessly, I can’t promise I remember everything. If there is anything missing and you get it working, please leave a comment so I can update the post or code! Also standard disclaimer that I am not an electric engineer and I am not responsible for you hurting your equipment or yourself by trying to follow this guide.
If you haven’t already, get your raspberry pi ready to roll.
Then before you plug all the toys into it, make sure the system is up to date. Next we need to enable SPI. Make sure to go through the pre-requisites and the install section. Then install the python requirements.
git clone https://github.com/cdgriffith/darkroom.git --depth 1 cd darkroom pip install -r requirements.txt
Now turn off and unplug the raspberry pi, and lets connect stuff! Follow the luma guide to hook up the display, copied below for convenience.
Let’s take a look at the raspberry pin layout. The Pi 2 that I used only has the first 26 GPIO pins, and even if you have a 3 or 4, the first 26 pin layout is the same. Below is my PowerPpoint diagram reference. I am going to color the boxes the same as the wires in my pictures so they match up visually.
If you look closely at the image of mine, you’ll note I was naughty and put the +5v (pin 2) into +3.3v (pin 1) instead. I think I did it on purpose to make it not as bright. Though I can’t really remember if that or just mistake, either way, it works for me. Next we’re going to add in the IoT Relay.
So now it should look kinda look like how I have mine (just the two positives in different positions at the top).
Running the Enlarger Timer
Now it’s time to turn on the Pi and see if stuff works!
First, run through the example program provided by luma. For my 4×4 display I needed to run:
python examples/matrix_demo.py --block-orientation -90 --cascaded 4
When that is working, plug in a light (or your enlarger) to the IoT relay, go back into the darkroom directory and give it a try!
cd darkroom python darkroom/main.py
(If you don’t like the startup message “LOVE U” I left for my wife, feel free to change it at the bottom of
main.py.) To use is pretty simple: press
*, enter the time you want to set, and hit
enter. View all the available commands on the github project page.
To have the code run on startup, I simply added it to my
PYTHONPATH=/home/pi/darkroom python /home/pi/darkroom/darkroom/main.py
I hope this guide was useful for you!