diff --git a/README.md b/README.md index ef998ff..abdc71e 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ Developing traditional film and silver paper is very temperature dependent. The warmer the developer solution, the less time the film -or paper needed to be developed and vice-versa.. Historically, people +or paper needed to be developed and vice-versa. Historically, people read the temperature and then manually corrected their development time accordingly, using a correction table provided by the manufacturer. It turns out that these corrections for temperature are quite similar -across different manufacturers, although the corrections *are* -different for film and paper. +across different manufacturers of film and paper, although the +corrections *are* different for film *versus* paper. Many years ago, a company called "Zone VI" realized this and created an analog timer that corrected for this effect. You placed a @@ -38,14 +38,156 @@ and so forth. Not only can we build something like this ourselves, doing so has several advantages over the old Zone VI timer: - * It's digital, not analog, so we don't have mess with - a bunch of precision parts and corrective feedback circuits. +* It's digital, not analog, so we don't have mess with + a bunch of precision parts and corrective feedback circuits. - * It's software controlled so you can customize how this - timer works to suit you. Don't like my compensation factors? - Want to adapt this for a different application? Both are - easily done with software changes. +* It's software controlled so you can customize how this timer works + to suit you. Don't like my compensation factors? Want to adapt + this for a different application? Both are easily done with + software changes. - * It's cheap. You can build one of these for well under $50. - (The original Zone VI timer was around $200 if memory serves, - and that was when money was still worth something. :) +* It's cheap. You can build one of these for well under $50. (The + original Zone VI timer was around $200 if memory serves, and that + was when money was still worth something. :) + + +## Required Skill Level + +As of this writing, you'll need to be an accomplished Raspberry Pi +hacker or have access to someone who is. The goal is to eventually +package this up in a way that a relatively inexperienced person could +build it, but I wanted to make the code and design available as early +as possible for those who have have already expressed an interest in +this project. + + +## State Of The Project + +The hardware design is really simple because it's based on +a Raspberry Pi Zero platform. The whole timer uses a little +over a dozen parts in total ... that's including a case and +USB power supply. + +Think of this as an "MVP" (Minimum Viable Product) implementation of +the timer. It works as expected but needs to be turned into a real +"product". The code is completely working but not "done". It's needs +a fair bit of tidying up, factoring, reorganizing, etc. But it +*works* + +HOWEVER ... there are essentially NO docs right now. You have to +figure out stuff from the code or reading this very limited document. +This will hopefully change with time but - for now - you pretty much +need to know how to read Python and do simple wiring. + +## Basic Hardware Connections + +The code will tell where to connect things on a Raspberri Pi Zero. + +*Note that these reference GPIO pin numbers, not device pin numbers.* + +A few notes: + +* Where there are pullups or references to Vcc below, I've + chosen to use the 3.3V pin on the Raspberry Pi Zero. + +* You'll need two TM1637-compatible 4-digit LED displays - one + for time and one for temp. Their CLK and DIO assignments + are noted in the code. Of course, you'll also have to + connect them to Vcc and ground. + +* Connect a piezo buzzer between GPIO 26 and ground. No resistor + needed. + +* Connect a momentary contact footswitch between GPIO 6 and ground. + Pull up that pin with a 4.7K resistor. + +* Connect a SPDT switch for profile selection to GPIO pins 23 and 24, + each pulled up with a 4.7K resistor. The switch common goes to + ground. + +* Connect the data line of a DS18B20 temperature probe to GPIO 4, + pulling it up with a 4.7K resistor. Again, you'll have to connect + it to Vcc and ground as well. + +* Take note to read the code concerning the temperature probe. + Each probe has a unique serial number and you have to configure + a symlink in Linux to point to your specific device. + + +## Basic Software Setup + +There's not much to this: + +* Get your favorite Raspberry Pi Linux distro running. + +* Setup 1-wire support. In `/boot/config.txt` set `dtoverlay=w1-gpio` + (At least, that's how you do it on Raspbian. Other distros may be + different.) + +* Make sure python3 is installed - this project requires it. + +* Make sure to properly create the symlink to the temperature + probe as described in the code. + +* pip3 install the wiringpi module. You can either do this + systemwide or in a pew virtual environment. Either way, + you need to be `root` because this code - at least for now - + requires superuser to run. + +* Copy the `devtimer.py` and `tm1637.py` files onto your + Pi Zero. You can then start the timer with `./devtimer.py`. + +* By default, the code currently writes a lot of debug info to + the Pi's tty so you can watch all manner of things fly by. + If it bugs you, just change `DEBUG` to `False` at the top of the + code. + + +## Operating The Timer + +* You can add a reference to `/etc/rc.local` to automatically start the + timer when the Pi boots. Right now, this takes about 30 seconds but a + future effort will work to rip out the stuff not needed and make booting + way faster (hopefully). + +* At program start, the temperature display will briefly show 999F. + This is a "sentinel" to let you know the timer is looking for the + temperature probe. The display should rapidly update to show actual + temperature as reported by the probe. If it does not (i.e., 999F + remains displayed), it means that something is wrong with the + temperature measurement hardware. + +* Pressing the momentary contact footswith start/resets the timer. + +* The timer beeps twice at start and again at reset. + +* The timer provides a long single beep at each virtual 30 second + mark. + +* The SPDT switch selects Film correction, Paper correction, or + realtime (no correction). You can change this while the timer + runs. + +* When the film profile is selected, the displays are dimmed on the + assumption that film is panchromatic (it can "see" red) and far more + sensitive to light than paper. + +* If you are in a film or paper correction profile, and the temperature + is beyond the range of the timer to correct, the temperature display + will blink. + + +## What's Next? + +Lots of cleanup, documentation, and stuff will hopefully follow. My +longer term goal is to release a preconfigured minimal Linux image +you can just blow down onto a microSD card and all this stuff will +just "work". + + +## Help & Support + +There isn't any. You can send mail to `devtimer@tundraware.com` and I'll +do what I can to help as I able, but this is very much a part-time activity. + +What would be VERY welcome would be pull requests, bug reports, patches, etc. diff --git a/TODO b/TODO index 5862964..69a7ca2 100644 --- a/TODO +++ b/TODO @@ -4,12 +4,8 @@ - Cleanup debug handling using that centralized state info - Cleanup timer run code into separate thread that gets started/stopped instead of always running with 0 displayed -- Pull globals into a single coherent namespace - Autodetect temp probe device - Generate compensation tables at startup based on low/hi range - perhaps limited by times <400ms -- Add code repo to comments header - Speed up boot time by removing all unneeded boot activity -- Write docs: - - - Startup sentinel - - Need to symlink /opt/devtimer/temp_probe to actual probe device +- Package into a preconfigured DD image for release simplicity +- Longer term: Move to an SPI based set of displays for better rendering speed. diff --git a/devtimer.py b/devtimer.py index 4912d41..2348910 100755 --- a/devtimer.py +++ b/devtimer.py @@ -3,6 +3,7 @@ # Targeted for RaspberryPi # Copyright (c) 2018 TundraWare Inc. # Permission Hereby Granted For Unrestricted Personal Or Commercial Use +# Code Repo Here: https://gitbucket.tundraware.com/tundra/devtimer ##### # Imports @@ -121,10 +122,10 @@ ''' This is based on the widely available DS18B20 temperature probe. It is a 1-wire protocol device that returns temperature directly - degrees C. The dataline must go on the Pi GPIO 4 (pin 7) which + in degrees C. The dataline must go on the Pi GPIO 4 (pin 7) which should be pulled up to VCC with a 4.7K resistor. - You have to do several thingsto make this work: + You have to do several things to make this work: 1) Enable 1-wire support in the Pi: @@ -132,13 +133,13 @@ reboot 2) Each 1-wire device is connected to the same pin (7) - on the Pi. It distinguishes between them by a uniq + on the Pi. It distinguishes between them by a unique address. You have to find that address *for your specific device*. You do this by looking at: ls -l /sys/bus/w1/devices - You have to symblolically link that to: + You have to symbolically link that to: /opt/devtimer/temp_probe '''