Argus 75 Digital

I have always dreamed of converting an Argus C3 into a digital camera.  While I've not given up on that dream, I did detour and produce a converted Argus 75 digital.  This is the story of that camera.



This is an Argus 75 film camera.  The Argus 75 is a TLR, or Twin Lens Reflex design.  The lower lens contains the shutter and exposes the film in the camera.  The upper lens is for framing your photo via top viewfinder and 45 degree angle mirror.  It uses 620 film, which produces a negative approximately 60x60mm in size.  These were originally produced by the Argus camera company in Ann Arbor, Michigan, from 1949 to 1958.  More information about Argus cameras can be found at http://www.arguscg.org.

Most importantly, the body of the Argus 75 is large enough to contain this circuit board:



This is a Raspberry Pi Model A+.  Basically a small and inexpensive ($20 list price) computer, powered by a processor similar to those used in smartphones, and capable of running the Linux operating system.  There are several other models of Raspberry Pi, but this one is the smallest one currently produced that is capable of connecting to the matching camera module.  The A+ model has 256Mb of RAM and a single USB port.  The Raspberry Pi is powered from a 5v power source, typically a cell phone charger.  Storage is provided by a MicroSD memory card.  It is capable of displaying full HD video via the HDMI connector.  The pins shown at the top are GPIO (General Purpose Input/Output) and allow the connection of buttons, switches, LED's, etc.  The basic idea of the Raspberry Pi is to enable people to learn computers, programming, and electronics, all at a low price point.  Lots more information about the Raspberry Pi can be found at https://www.raspberrypi.org/.



This is the Raspberry Pi camera module.  Combined with the Raspberry Pi, this is what makes this project possible.  It uses a 5 megapixel sensor of the type normally found in smarphones.  List price is $25.

My original inspiration for this project came from a project someone posted to the instructables.com web site, where they took a Raspberry Pi model A (larger than the A+) and fit it and the camera module into the body of a Kodak Duaflex TLR camera.  If you are interested in seeing how they did it, you can find the project at http://www.instructables.com/id/Retro-Pi-Cam/.  My goal was to do the same thing with an Argus 75, but to also make it cleaner and more complete with buttons, LED's, etc.



The first step of the project was to see it was technically possible to do everything that I wanted.  I used a solderless breadboard and jumper wires to tie everything together.  I used a Raspberry Pi model B+ for this phase of the project.  Most of the programming was done via the serial console by way of a USB to serial adapter cable that you see in the background.  This allowed me to do programming in Notepad in Windows, then copy & paste into the Nano text editor on the Pi via the PuTTY telnet/SSH/serial communications program.



Here's a close-up shot.  The switch to the left is to control the USB wireless adapter - Access Point Mode, Off, and Client mode.  The circuit board in the middle is a DS3231 real-time clock module so the Pi will know what time it is when an internet connection is not available.  Just in front and to the left of that is an infrared receiver to enable self-timer type photos.  To the right are buttons for the shutter, shutdown, etc.  LED's are for indicating system status, photos being taken, and self-timer indicator.  The resistors are required to make all the buttons, swtich, and LED's work properly.

Let me detour a moment and further discuss the clock module.  Feel free to skip this paragraph if you don't care about RTC's.  Many inexpensive RTC modules use the DS1307, which does not keep very good time.  The DS3231 is much more accurate, and not appreciably more expensive, at least not when purchased from China via ebay.  The module I chose uses an LIR2032 rechargeable button cell battery.  Unfortunately, when powered at 3.3v from the Pi, it does not appear to charge properly, which makes sense, as the nominal voltage is 3.7v.  From other online sources, I have found that it is possible to remove a resistor to prevent charging, then install a non-rechargeable CR2032 battery, which should last a long time.  I have not yet done that modification, but I need to, as the LIR2032 does not seem to hold a charge all that long.  Another possibility would be one of the DS3231 modules that are built on a very small circuit board and designed to plug directly into the GPIO header on the Pi.  I'm not sure it is possible to swap that out in this project as that 3.3v pin in the GPIO header is already allocated for use in one of the circuit boards.  Another possibility would be adding some wiring and pins to the mid-body custom board and attaching it there.  I have not yet decided for sure which route to take, though I will most likely just modify the existing module.

Next came camera modifications to make it all fit and work.

 


Above Left - front shutter mechanism has been removed and a slot cut for the camera module ribbon cable to go through.

Above Right - Film chamber greatly cut down to make as much room as possible for compontents to be added.

Left - Above components back together.  The side part of the shutter mechanism is still in place with flash contact wires seen at the top.  This part of the shutter mechanism allows for the wind knob to the turned to cock the mechanism, then pushing the front shutter button will trip the mechanism and short the flash contacts together.  The flash contact will act as a shutter button to take a photo.

I did bend the flash contact to get it to work more reliably as a shutter.  Earl English's notes at http://www.earlrock.us/argus/argus75flash/index.html were helpful for this purpose.


 

Above Left - The original lens has been removed and the hole enlarged for the camera module's lens to poke through.

Above Right - Camera module installed and lens is poking through.  The retainer for the original lens will be placed back into the opening to make it look more original.

Left - The camera module is attached from the back using foam mounting squares.




I then created two custom circuit boards for the rear buttons and LED's, along with containing all the necessary resistors.  Someone asked why I didn't create a custom PCB.  That would certainly have made a much neater appearance...but I was able to do this without waiting for a custom board to be manufactured and shipped.  If I was to do it over again, and had more time, I would probably go that route.  I designed these by printing out a wide-spaced dot pattern on paper, then drawing out how everything needed to be connected.  It was easier to draw it than it was to solder it!


 

(Left Image) Top-left, I used a dremel to make room for wires to route under the Raspberry Pi board.  Along that "shelf" are two holes, drilled and tapped for 4-40 screws to mount the Pi.  Top-right is cut out for wires to the front-panel LED and top LED.  Towards the bottom-left is a hole drilled and filed to glue in the infrared receiver.


 

At left you can see the body cut away for wiring for the front and top LED's.  Right image shows the hole added for the top LED.  The hole was sized such that the LED would stick through but be stopped by the wider "base" of the LED, then glued in place.


 

At left is the back of the camera drilled for switches, LED's, and mounting screws (it was pretty dirty - looked much better after I cleaned it up!).  What I learned from this is that I really need a drill press!  The rectangular holes were drilled and then filed to proper shape.  The back appears to be made of aluminum or other soft metal, so it was not too difficult.  The top center hole, however, goes through the catch that holds the back closed.  If you choose to follow in my footsteps, avoid drilling that strip of metal, it is apparently spring steel, and very near impossible to drill through.  At right you can see the mount I created for the clock module.


 

Radio Shack's demise (in my area at least) ended up being a great benefit to this project.  The last day our local Radio Shack was open, I left with a large bag of odds and ends for $20, with hopes something would work for a battery.  There were a number of smartphone replacement batteries that also included a charger.  I picked the one with the greatest capacity and cut one up for a battery holder.  I have two others that can be used for spare batteries and for charging those batteries.  I was not able to incorporate the battery charging circuit into the camera due to lack of space, so the battery must be removed for charging.  I chose to use the Adafruit PowerBoost 500 to step up the voltage from the battery level to the 5v required by the Raspberry Pi.  I couldn't figure out any better way to do it, so the 5v is fed to the Pi via the 5v GPIO pin.


 

The resistor/power distribution board is mounted to the back (or would that be front?) of the film chamber.  At right you can see everything else installed...top-left (as you look at the photo) is the clock module, below it is the PowerBoost power converter (attached with foam mounting squares).  Top-right is the other custom board with LED's and buttons coming out the back of the camera body.  Bottom-right are the power and wireless control switches.  The power switch is rated for the full power load and switches power between the battery and the PowerBoost module.  There is a low battery indicator LED on the back panel, and the PowerBoost provides a low battery signal.  I have not yet figured out a clean way to get the Raspberry Pi to receive a low battery signal from it, in order to get the Pi to turn on the back panel LED, then shut itself down after a period of time.  It's an odd setup, and I've about given up on getting it working as I would like.




Another useful item from the Radio Shack haul was this "Make: it Robotics Remote Control".  Originally designed to control a robotics kit, I was able to program LIRC (Linux Infrared Remote Control) to read its signals.  All buttons other than the two at the bottom will continually repeat the IR signal if the buttons are held down (as will pretty much every other standard remote control I've since tried), and thus don't work well for a camera trigger.  If held down for more than a very brief push, it will cause the Pi to take two photos, etc.  The buttons at the bottom are set to do a 2 second or 10 second self-timer.  The other labeled buttons (instant shutter, power off, and reboot) will only be acted upon by the Pi if it receives the signal 5 times, thus the (5) labeling.




And here is a final image of everything wired up and ready to go.


Here is a front view of the finished product.  The red LED at the top left blinks for self timer, slowly at first, then quickly for the last second before the image is taken.  At the middle right you can see the infrared receiver for the remote control.  The Instant/Time adjustment has no function.  If you cock the shutter using the wind knob, the shutter button will function to take a square image, thus matching the original format, and the same as you see when looking through the viewfinder.

The "Digital" lettering at the bottom is a vinyl decal created with the help of my wife and her Silhouette Cameo craft cutting machine.




And lastly, this is the back panel.  At the top of the camera, you can see the green LED that lights up to indicate when a picture is taken.  On/Off is of course the power switch.  The Client/AP switch is a 3-position switch.  At the left it connects to a configured wireless network as a client.  In the middle, the wireless adapter is shut down to save power.  At right, the Raspberry Pi becomes a wireless access point, allowing connections from a laptop, smartphone, tablet, etc.  More details on that in the next paragraph.  The power LED lights up as soon as the power switch is turned to the "on" position.  The Status indicator lights up when the Pi has finished booting and is ready to take photos.  The LB LED is for the low battery indicator, but is currently not functional.  The unlabeled button to the right, which needs to be labeled now that I've decided for sure it's purpose, is a shutter button that will take a normal 4:3 rectangular image, rather than the square image produced by the shutter button on the front.  To shut down the Pi cleanly, press and hold the Shutdown button for 2 or seconds or longer.  After two seconds the Status LED blinks off for one second and then back on to indicate it is shutting down.  When the status LED turns off again, wait several seconds, then it is safe to turn off the power switch.

There is additional unseen functionality.  The (perhaps) obvious is an FTP server which allows photos to be transferred from the camera.  A web server (Lighttpd) is also installed, along with a thumbnail gallery program, which creates a simple web page on the fly to display thumbnails of the photos that have been taken.  The thumbnail gallery I am using is UberGallery - http://www.ubergallery.net/. In Access Point mode, it also takes over any web requests and re-directs them to the internal web server.  For example, if you try to visit google.com, it will instead display your photos.

Another neat trick is to use your smartphone to view the camera stream live.  If you use an Android device, check out "RaspiCAM Remote".

Here are a couple of sample images - click to link to a full resolution image:

   

   

   

Overall, the image quality is decent.  Sometimes the color cast is a bit off as seen in some of the outdoor photos - yellowish/greenish.  Minimum focus distance is listed as 1 meter, so you can't get but so close to your subject.  If you look closely, you'll notice the frogs are a bit out of focus from getting too near when taking that particular image.  There is no flash capability, so any indoor low-light photos are prone to blurring, much as with a smarphone, which is more or less what this digital sensor is.


Programming

Now let's look at the details of how this camera is programmed and set up.  I'll try to put all this in an order that makes some amount of sense, as well as try to include some links that I found useful during the process.  This likely will not be a guide to allow you to exactly clone what I have done, but should help you get going in the right direction, and if nothing else, hopefully provide some guidance for your own project, much as I have gleaned details from notes others have posted online.

I have included links to individual files, but they may not display well when clicked in your browser.  I have combined all of them into a .zip file that you can download for offline viewing.  I chose not to include the text of them in the body of this web page in order to save space in a page that is already very long.

Serial Console

If you use the serial console as I have done, by default, you will not see much of the boot information scrolling down the screen like you would with a monitor attached.  If you look in /boot/cmdline.txt, you will see that there are two console= parameters: ttyAMA0,115200 for serial console and tty1 for the monitor console.  Messages about configuring software and starting services at boot time go only to the primary console, which is the one named last.  If you move console=tty1 before console=ttyAMA0,115200 they will go to the serial console instead of to the monitor.

GPIO Pins

First off, here is a layout of my GPIO pin connections (switches and buttons use a pull-down resistor):

4 – Status Indicator LED
25 – Shutter LED
22 – Shutdown Button
23 – Front Shutter Release (Square Image)
18 – IR Reciever
24 – Self Timer LED at Front
6 – Rear Shutter Button (4:3 Image)
13 – Low Battery LED
26 – Low Battery Input Signal
17 – Switch in Client Mode Position
5 – Switch in AP Mode Position

rc.local

As the system boots, /etc/rc.local runs at the end.  These are the lines I have added:

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
python /home/pi/campi.py &
python /home/pi/switchboot.py
python /home/pi/switch.py &
tvservice -o

The first two lines set up the DS3231 RTC and set the system time to the clock time.  More notes on this later.

campi.py is the main python script that drives nearly all of the camera's functionality.  The & at the end tells it to run in the background and continue to the next line.

switchboot.py sets up the wireless switch functionality.  The system always boots with wireless turned on and in client mode.  This shuts it down, figures out the correct mode based on switch position, then starts it back up as needed.  Notice this does not have the & at the end, so this step completes before moving to the next line.

switch.py runs in the background to make changes to the wireless configuration if the switch is changed while the system is up and running (note the & again).

tvservice -o turns off the HDMI output on the Pi.  This saves a small amount of power.  Since the system is running on battery, and the HDMI port is unusable due to its mounting location, may as well turn it off.

/etc/modules

The /etc/modules file has been edited to include the following lines:

lirc_dev
lirc_rpi gpio_in_pin=18
i2c-dev
i2c-bcm2708
rtc-ds1307

This loads the modules to enable the system to work with LIRC for the IR remote control, and i2c for communicating with the RTC clock module.

/boot/config.txt

I have added these lines to /boot/config.txt to control the hardware configuration on the Pi:

dtoverlay=lirc-rpi
dtoverlay=rtc-i2c,ds3231
dtparam=spi=on
dtparam=i2c_arm=on
disable_camera_led=1

The first two lines set up support for LIRC and the RTC.  The second two enable SPI and I2C.  I don't think SPI is needed for what I have done, but it is turned on here anyway.  The last line disables the LED on the camera module - it normally lights up when taking a photo, but it is not at all useful in this application, so I have disabled it.

DS3231 RTC Clock Module

The resource I used that got me going in the right direction for the RTC was this web page - http://www.drewkeller.com/blog/adding-hardware-clock-raspberry-pi-ds3231

Most of the setup for this has already been covered in the above config files, but to recap:

/boot/config.txt add line dtoverlay=rtc-i2c,ds3231
/etc/modules add line rtc-ds1307
/etc/rc.local add line echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device and hwclock -s

I did not disable the ntp daemon and fake-hwclock during boot as suggested.  If it can pick up a time sync when connected via wireless, it may as well do so.  If it can't, hwclock -s in rc.local will set the time from the clock at boot.  In the wirless switch script, I have set it up to force a time sync and to update the hardware clock any time the switch is moved from the off position to the client position, so if it does stray over time, this will help keep it synchronized.  Those commands are:

sudo ntpd -gq
sudo hwclock -w

Wireless Switch Control

At boot time, the Raspberry Pi always starts up the wireless connection as a client.  In order to sync the system to the switch setting, the switchboot.py script shuts down the wireless interface, waits two seconds, then brings the interface back up as either client or AP if the switch is so set, or it leaves it down if the switch is in the center position and neither GPIO pin is high.

The next line in rc.local fires up the switch.py script to run in the background.  This script monitors for changes to the wireless switch, and adjusts the interfaces accordingly.

Sometimes, the wireless connection does not come up properly when coming up in client mode.  You will notice both scripts bring up the wireless, wait 5 seconds, then check to see if the connection is up.  If not, it tries again, waits 5 seconds, and checks a final time.  If still not up, it tries one more time.  I went with the assumption that three tries would likely always be sufficient.  If not, flip off the switch and try again!

/etc/network/interfaces is configured differently depending on whether the system is operating in client mode or AP mode.  While the wlan0 interface is down, the script copies into place the proper interfaces file prior to bring the wireless interface back up.  Here is my interfaces file for Client mode and for AP mode.

There may be a more elegant way to do what I have done using ifconfig or otherwise, but I managed to get it working this way, so I decided it was good enough.

Camera Control Script

The campi.py script is what drives the camera and its buttons.  When it starts up, the first thing it does is turn on the status light on the back so you know it is ready to take photos.  It then waits for buttons to be pushed - front shutter button, rear shutter button, or shutdown, and acts accordingly.  The functions of these buttons are pretty well documented above, so I won't repeat them here.  The script should be fairly self-explanatory.

You will also notice some sections commented out.  These are a part of my failed attempt to trigger a low battery LED and shutdown based on signal from the PowerBoost module.  The problem is that when the battery voltage is good, the PowerBoost puts out voltage on the LB pin that is at battery levels, which can be as high as 4.2v.  As you probably know, the Pi is only tolerant of 3.3v input.  When the battery gets low, the LB pin voltage drops to zero.  Some indications from reading online say just tie the LB pin to a GPIO pin and it works.  I wasn't successful in getting it work that way.  It may work better with a few electronic components to regulate voltage, etc, but I have given up for the time being.  If you have any experience with this, I would love to hear from you - just email me at webmaster at megley dot com.


Software Setup

I'm going to assume you know the basics of software installation on the Pi.  I am running Raspbian, which uses apt-get for installation via the command line.  If you don't know how to do this, or most anything else you see mentioned on this page, just remember - Google is your friend.  Everything I have done for this has been done on the command line.  Don't let that scare you...once you get used to it, you'll actually find it faster and easier than having to hunt and click on everything...

HostAPD (Wireless Access Point Mode)

I apparently did not keep very good notes on this part of the setup.  These two pages look like what I likely used to get it working:

http://elinux.org/RPI-Wireless-Hotspot
https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/install-software

HostAPD is designed to be used to create a wireless access point and route traffic through the wireless adapter to the wired adapter.  In our case, we don't care about that routing or wired adapter, so not all of those setup steps are necessary.  It appears this software is somewhat hardware-specific in that it may not work with all wireless adapters.  I am using an Edimax EW-7811Un adapter, but I don't recall exactly how I got it working.  This page has some notes about it that may or may not be up to date for the Edimax adapter, they seem a little different than one of the links above - http://www.daveconroy.com/turn-your-raspberry-pi-into-a-wifi-hotspot-with-edimax-nano-usb-ew-7811un-rtl8188cus-chipset/  Ultimately, you will have to work that out depending on your wireless adapter.

You will need to install both hostapd and a dhcp server.  Here are my hostapd.conf and dhcpd.conf files.

LIRC

LIRC, or Linux Infrared Remote Control, is what drives the IR receiver and converts IR signals into commands for the system to act upon.  http://www.dkographicdetails.com/myPi/?p=20 is an article that I found extremely useful for configuring LIRC.  Please take a look there for better information than what I will present.

Basically, the setup is to apt-get install lirc, then edit /etc/modules to include (as noted above):

lirc_dev
lirc_rpi gpio_in_pin=18

Along with adding "dtoverlay=lirc-rpi" to /boot/config.txt as noted above.

Edit /etc/lirc/lircd.conf to include a line that loads the appropriate remote control configuration.  You can have more than one line if you wish to have multiple remotes configured.  Mine lircd.conf has one line:

include "/etc/lirc/rsrobotics.conf"

Here's a download link to get a copy of the Radio Shack Make:it Robotics remote control config file.  I submitted the file after creating it, so it is hosted somewhere in a directory of LIRC remote control config files, but I couldn't find it from a quick Google search.  Not sure if the project has more than one web site or branch or what.  Config files for many remotes are posted if you search for them.  I did my initial testing with a cable box remote and config file from the web.

Lastly, /etc/lirc/lircrc is the file that tells the system what to do based on button pushes received.  Here's a copy of my lircrc file.  It is made of sections such as this:

begin
button = KEY_7
prog = irexec
config = python /home/pi/irsnaptimer2.py
end

One for each button you wish to configure.  You can repeat the "button =" line multiple times if you want to require a certain number of button presses before taking action, such as I did with the repeating keys as noted above.

My lircrc file, as noted above, is what drives things based on buttons pushed.  Here are the scripts that are run from that file:

irsnap.py - This takes a photo immediately.  With the Radio Shack Robotics remote, this requires 5 pushes of the button I labeled "Inst".

irsnaptimer.py - This is the 10-second self-timer button.  This flashes the front LED on and off at 1/2 second intervals for 9 seconds, then on/off at 1/10 second intervals for one second, then takes a photo.

irsnaptimer2.py - This is the 2-second self-timber button.  Timing as above for the blinking light, but only slower for the first second.

Web Server

The web server is running lighttpd.  The config file is located in /etc/lighttpd/lighttpd.conf.  The web root should default to /var/www.  I have edited the lighttpd.conf file to include the line:

server.dir-listing = "enable"

So that the directory contents can be displayed by the web browser connecting to the server.  The UberGallery app is the default web page, but I modified it slightly so that there is a link to the raw directory listing so you can also browse a list of all the image files currently on the camera via the web browser.

Web Server Redirection

I didn't want to have to remember the IP address of the camera to connect to when it is in wireless access point mode, so I forced a redirection using this command:

sudo iptables -t nat -A PREROUTING -s 10.0.0.0/32 -p tcp --dport 80 -j DNAT --to-destination 10.0.0.1

This is assuming the IP address of the Pi/Camera is 10.0.0.1 and it is providing DHCP leases that are 10.0.0.x addresses.  This is only re-directing port 80 requests, so if you try to go to an address starting with https:// (or to any other port) it will not work.  I believe it also does not re-route address paths, meaning that if you try to go to something.com/somethingelse/ it will not work.  You have have to go to something.com without anything after it.  Help for this came from:

http://serverfault.com/questions/365000/how-can-i-use-iptables-to-forward-all-traffic-to-a-certain-website

UberGallery Thumbnails

Details about UberGallery and a download can be found at http://www.ubergallery.net/

About the only change I made was to edit /var/www/resources/themes/uber-blue/index.php to edit the header and to include link to gallery-images folder.  /var/www/gallery-images/ is where I have the camera script saving files, which are then picked up and thumbnails created on the fly by UberGallery.  The link is simply an (a href="gallery-images/") edit.  I will leave you to your own devices if you don't know how to edit HTML code to create a link.

If I've missed anything, or you have any questions, I can try to help.  You can reach me at webmaster at megley dot com.