How to Make an Auto 35mm Film Scanner with Arduino Nano and Python


Ready whereas flatbed scanners scan a shade adverse movie is nothing to be enthusiastic about. This course of and the following shade precorrection can take anyplace from an hour to 2.

Instruments out there at present, equivalent to Destructive Lab Professional, make it straightforward to realize nice shade adverse conversions. So fastening the scanning course of utilizing a digital camera makes extra sense than ever earlier than. Nevertheless, the software program to automate this course of to this point didn’t exist. Till at present!

A typical digital digital camera scanning setup features a digital digital camera, a tripod (or a duplicate stand), and a movie provider. Among the many 3, I’d think about probably the most scarce merchandise is the movie provider. Fortunately firms equivalent to Destructive Provide began to make these much-needed movie carriers. However these will also be fairly costly. Fortunately, any DIY movie provider made out from cardboard that is ready to push and pull an uncut 135 format (35mm) movie by way of a easy shaft system will work nice. Extra on that later!

A little bit of background. Proper off the bat, I ought to say that I’m not affiliated with Destructive Provide, Seize One, or Destructive Lab Professional. I occur to personal their merchandise, and I occur to love utilizing them (for now). Earlier than, I used to be working the venerable Epson V600 for scanning movies. This was very good because it enabled me to scan my very own movies, however the pace wasn’t there. Furthermore, I used to be not utterly having fun with the grains I used to be getting.

Having mentioned that, my causes for why I made a decision to make this venture is extra multifaceted. I take pleasure in supporting the movie neighborhood and film-centric firms like Destructive Provide, Lomography, and Destructive Lab Professional. I additionally like the concept of barely jolting the DIY neighborhood towards this area of interest area. Lastly, I additionally actually wished to program a microcontroller for the primary time. Taking over this venture has thought me so many issues. I admit, solely a month in the past, I couldn’t inform the distinction between an Arduino and a Raspberry Pi.

After randomly deciding on an Arduino, principally due to its worth level, I wanted to seek out an issue to unravel.

This did NOT take very lengthy! I first fastened my UniRoller developer situation, which was a results of utilizing a JOBO professional tank 3010. After which I targeted on routinely watering my tomato vegetation for the instances I went on a hike. And my closing and present venture was to repair this situation I had with scanning movies. This additionally gave me the excuse to follow some Python programming.

As of at present, I’ve now accomplished 2 separate movie scanning packages. One written in Python language, and the opposite one written in C++ (additionally known as an Arduino sketch). They each use the identical {hardware}, however there are main variations in how they operate. One is enabled by Python laptop imaginative and prescient and is totally autonomous (automated positioning, image taking, and shifting to the following body). The opposite solely mechanizes the movie development. The person makes the required corrections in movie place after which takes the image utilizing the controller buttons.

To implement this venture understanding Python (C/C++ for Arduino) could be superb, however it’s not vital for clicking the run button on a browser that runs Jupyter Pocket book (present in Anaconda). That mentioned, the person is required to obtain Python and Four libraries. I extremely recommend the Anaconda bundle as it’s a one-shop answer, with a really wealthy on-line neighborhood.

After this set up, Python libraries, Numpy, pyFirmata, SciPy, and cv2 are additionally required. You may set up these Python libraries utilizing the Anaconda-Navigator or PIP set up em from the terminal. The web is suffering from how-to tutorials on this. Having mentioned that, I’ve used the Jupyter internet interface for making and operating the Python code. These packages could have an ipynb extension. Nevertheless, it could be greatest to start out by putting in the Arduino IDE, as that is the place all of it begins (Arduino scripts have a .ino extension). There shall be extra particulars on this later.

Okay, lets transfer on to the precise superior Setup:

A) Seize One is related to the Fufifilm X-T2 with a A-Male to Micro-B USB cable for knowledge switch and powering the Fujifilm X-T2 battery. B) Video Seize card, merchandise 4 (objects used are listed on the very backside), is related with a micro HDMI, and C) the digital camera shutter is managed by way of a 2.5mm (Three pole) cable. The move of data is depicted by the arrow.

Let’s see this setup in motion!

Mode 1: Arduino solely and utilizing manually correcting place:

Mode 2: Automated correction with Python:

Mode 3: Arduino plus Python in motion on a DIY cardboard movie provider:

I made this cardboard field slightly below 2 hours. In an effort to make this a day venture, I’ve used the 3D printed movie guides and rubber movie rollers used on the Destructive Provide provider.

If Python and automation shouldn’t be your cup of tea, however you continue to desire a stepper motor to drive your movie. You may as well discover a devoted Arduino sketch on the Github website. I like this code as this can be very easy to make use of and as soon as uploaded to the microprocessor, utilizing the Arduino IDE app, one would by no means must see a pc script, plus it’s a tad sooner, which is admittedly handy.

Right here, the micro corrections to left and proper are made utilizing the devoted buttons (the center two in Determine 5). The button to probably the most left is the shutter launch button, and probably the most proper is to progress to the following body. This setup ought to work on Fujifilm and Canon cameras. That’s as a result of the shutter launch cable I as soon as owned was Canon-branded and I attempted to mimic the voltage values I learn from it. Please keep in mind that there are dangers related to connecting exterior circuitry to your digital camera. Please try this DIY setup at your personal threat.

What does a microcontroller do?

Firstly, the microcontroller used right here is known as the Arduino Nano. There are a gazillion YouTube movies of DIYists utilizing this board. Important a microcontroller is an built-in circuit (a chip that has many many discrete electrical parts) that makes use of discrete voltage (3.3V or 5V) in an effort to say sure (in laptop phrases equals to 1, True, and so forth.) or 0V for saying no (0, False, and so forth.). There’s additionally a gray zone in between the place it’s not good, however I don’t know the small print presently. It communicates utilizing its pins which can be situated on its aspect.

These pins may also learn voltages too. Pins that learn and write 1s and 0s are referred to as digital pin and are denoted by D. A number of the D pins may also modulate pulse over time. That is denoted by PWM or ~. And a few pins can learn analog indicators that are denoted by A. These will not be 1s or 0s. They usually learn a spread of 0-1000 on an Arduino board, and that is how we enter the specified pace of the stepper motor. The pin structure of the microcontrollers is on the market on the web. So when wiring your circuit please deal with the wiring. Additionally, don’t energy your board whereas wiring.

Correcting movie place utilizing Python.

In an effort to right the place of the movie, Python requires suggestions. To do that we make the most of the Video Seize Card HDMI to USB 1080p (merchandise 4).

By completely positioning the movie on the movie provider, most digital camera sensor decision is achieved for each 35mm body.

When most decision is paired with a superb macro lens, the grains generally is a pleasure to take a look at. To energetic this, edges between frames are decided, and this data is used throughout the correction section. Which means if we’ve a 24-megapixel sensor like we do in Fujifilm X-T2, our scans will virtually have a 4000 by 6000 pixels per picture. To place the body completely our Python program solely requires a 100p decision. Subsequently, the 1080p video seize is downsized in Python. Nevertheless, a full 1080p video streaming with the cardboard would make a wonderful WebCam over Skype, Zoom, and so forth.

The present model of the Python program won’t work with shade optimistic movies.

I’ve solely been part-time engaged on this venture since this previous August. I’m hoping to replace this system within the close to future for shade optimistic movie rolls. Subsequent time I’ve an uncut optimistic movie roll, I’ll take a weekend time to make this occur.

That is an open-source venture subjected to MIT open supply license. Which signifies that it’s free to distribute, change, and use. In flip, the software program for detecting frames may drastically get higher with new and fancy algorithms over time. I extremely encourage fellow Python programmers and knowledge scientists to fork the venture from my Github and showcase their skills.

I supposed this web page to be understood by people who find themselves simply beginning off their journey into the world of microcontrollers. Thus, when you have a query or have a suggestion please don’t hesitate to share them.

Lets begin making our scanning machine:


1. Mounting the Stepper motor and making a brand new shaft

2. The controller

3. Beginning with the Arduino Nano (Blue) and the Stepper Motor board (RED)

4. The wiring

5. Downloading from Github and getting began

6. Gadgets used and prices

1. Mounting the Stepper Motor and Making a New Shaft

This a part of the venture is probably one of the vital enjoyable elements as issues begin to take form. It’s the simplest half, however paradoxically the toughest half too. The essential half to concentrate to is to verify the strain on the belt is equal throughout the rotation of the shaft. And that it doesn’t pull the stepper motor, as it’s mounted by a sticky silicon mounting tape (Gorilla double-sided tape). Additionally, phrase of warning, when mounting GT2 timing pulleys and knobs (Determine Three a, b, and c), please don’t put an excessive amount of pressure on the screws because the screw thread may tarnish mushy aluminum piece. That is what occurred with me with the Destructive Provide knob.

Figure3: (a) is a adverse provide knob to manually rotate the shaft, (b, merchandise 22) is mounted on (e, merchandise 6), and (c, merchandise 6) is mounted on the stepper motor (merchandise 1). (d, merchandise 5) is a 158mm belt. Mounting (a),(b) and (c) are achieved utilizing (f) and (g) are 1.27 and 1.5 hex key respectively (from merchandise 10).

The stepper motor (merchandise 1) is first mounted to the stepper motor holder (merchandise 19). Utilizing the Gorilla double-sided clear tape, the motor holder is mounted onto the adverse provide provider as seen in Determine 3. I used this sort understanding it wouldn’t be an enormous downside to peel off if wanted.

It ought to appear like this on the finish when all these items are mounted and adjusted. The shaft size may very well be 1 cm much less. However generally getting issues achieved is best than simply ready for the proper piece.

Determine 4a
Determine 4b

2. The Controller

The controller would be the identical for each variations of the movie pusher program. Nevertheless the buttons have a special operate apart from one, that’s the shutter releases. Additionally, the blue knob adjusting the movie development pace, on the highest left, shouldn’t be used within the full-automatic model. That is due to Python. It’s not so good as Arduino IDE on the subject of the exact timing of issues.

Determine 5: The swap on the backside left (merchandise 17) engages the stepper motor to activate and off, the blue knob on the highest left is a 10ok potentiometer (merchandise 9) adjusts the pace of the motor when utilizing Arduino sketch, the Four resistors used are all 5K Ohm (objects 8). For the Arduino sketch, the buttons (merchandise 15) from left to proper are: shutter launch button, micro-left shifter, micro-right shifter, subsequent body. For the total computerized, that is: shutter launch button, transfer the following body and proper place, transfer the following body, right place and take the image, transfer the following body, right place, take the image and keep on till a user-specified quantity. You may at all times disengage the total computerized mode utilizing the swap and stopping the python program.

3. Beginning with the Arduino Nanon (Blue) and the Stepper Motor Board (Crimson)

Importing Arduino sketches are required for each modes. To do that you have to to put in the Arduino IDE app. After opening the app, from the instruments/board, choose “Arduino Nano”, from the instruments/Processor, choose “ATmega328P (outdated bootloader)“ and lastly from the instruments/port, choose that appears like “/dev/cu.usbserial-14xx” for mac customers and presumably “ /com3 “ for home windows customers. Make a remark of this deal with as it’s wanted for the Python program.

At this level, I’d extremely encourage you to check out the Blink Sketch that’s within the Recordsdata/Examples/01.Fundamentals/Blink. A brand new sketch window will seem. On this window, hit the Add button that’s on the highest left, subsequent to the button that has a tick signal. On the underside left, the opened sketch window will present Compiling Sketch/Importing/Performed Importing and it’s best to observe an LED in your Arduino Nano blinking. This exhibits that the board is working and you’ll be able to add an Arduino Sketch. On my Macbook Professional 2012mid, solely the USB port closest to the show port works for importing Arduino sketches. So, in the event you expertise an issue right here, test if different USB websites work in your laptop computer work.

Determine 6: On the left is the stepper motor management board (merchandise 2) and on the suitable is Arduino Nano (merchandise 3), the resistors are used to dive voltage: horizontally positioned is a 2k resistor and vertically place resistor is a 5k resistor. These are used to decrease 5V to three.3V.

The two Orange wires in Determine 6 (aspect by aspect on the highest half, the opposite is pink however I admit appears orange too) energy the stepper motor controller board. Incorrect wiring right here will make your stepper motor controller board cease working. Additionally, take note of the wire colours of the stepper motor. The right wiring will make sure the bipolar stepper motor to obtain the voltages within the right sequence for a profitable 360-degree rotation. However this isn’t as delicate.

Determine 7: When connecting the 9V DC supply it is very important match the optimistic aspect of the capacitor with the optimistic energy supply and adverse aspect (marked in gray) with the bottom of the facility supply. Within the case you mismatch, the capacitor will make a small explosion and spew out fuel.

4. The Wiring

This can be a easy system to wire and it doesn’t have numerous parts. Nevertheless, throughout wiring, it is very important flip off the facility.

Let’s begin with the two.5mm jack that’s chargeable for the digital camera shutter. You have to a Three pole jack, Determine 8(A). Utilizing Three as an alternative of two will stop the activation of the autofocus (guide lens are superb right here). The center part (pink in Determine 8) is triggering the autofocus and isn’t related to the mini breadboard. The black wire is floor and the white wire triggers the shutter.

Subsequent, could be to determine which wire is which in your 2.5 mm jack. One unorthodox but trusty methodology is the 9V battery and the tongue sensor. One other approach could be utilizing the facility of deduction. For this you’ll insert the two.5mm jack into your digital camera, having all wires uncovered (white, pink, and black). Figuring out that the autofocus is activated when the center part is related to the suitable part (most likely black), and the digital camera shutter is activated when the left aspect is related to the suitable (most likely white), we are able to deduce our wires. However I need to admit, I’m not positive what occurs left aspect it first related to the center. Hopefully, nothing 🙂 The most effective answer could be to make use of a multimeter.

I often wish to run the stepper motor on 9V because it does warmth up over time, but when the strain on the belt is just too sturdy it might want its specified 12V energy supply.

Determine 8: (A) is a 2.5mm jack, (B) and (C) are 2K Ohm and 5K Ohm resistors, (E) is a 1000uF 35V capacitor to dampen voltage spikes (100uF must be sufficient), (D) all Four resistors are 10Okay Ohm resistor. The white arrows present the tiny wires. You don’t want to solder a capacitor to wires as proven on (E), see Determine 7. Ensure the – adverse website of the electrolytic capacitor is related to the adverse and + aspect to the optimistic DC supply.
Determine 9: The wiring inside mini breadboards. Holes on the blu line are all related to one another. So any two level on the blue line shall be related, guaranteeing a solderless venture, with no flux fumes.

5. Downloading from GitHub and Getting Began

I’ve simply began utilizing GitHub. It’s a wonderful method to observe modifications and share concepts. In case your all for how Python strikes to the proper place, please be happy to take a look at the algorithm. And in addition, please don’t maintain again to Fork the venture and share your concepts. You will discover and obtain them right here.

A very good place to start out is by operating the Arduino Sketch. It will guarantee right wiring and parts working. To do that obtain the Semi-automaticUsingArduino.ino from GitHub and add this sketch into your Arduino Nano as described in Part 3. This must be all.

In case your stepper motor is making a humorous noise, mess around with the blue potentiometer till it sounds right and the pace is to your liking. If the development of the movie body is repetitively falling brief improve the FrameLength variable within the sketch, and conversely whether it is progressing an excessive amount of. This worth might be particular to your machine, as there may very well be small variations between units. Make a remark of your FrameLength variable, as a result of will probably be useful when utilizing the Python program.

If you want you possibly can change the stepper motor decision, you are able to do so by altering the three motMS(X)Pin values. For instance, with mode 0,0,Zero is 200 steps per one full rotation (which is the quickest), with mode 1, 1, 1 it’s 3200 steps per full rotation, often known as microstepping. That is the most important spatial decision we are able to obtain with this stepper board. This stepper controlling board additionally has Three different modes 400, 800, and 1600 steps per 1 full rotation (merchandise 2). That is simpler to alter within the Arduino sketch that it’s within the Python program, because it requires modifications at a number of locations.

If you wish to make the system work in full computerized mode, the Arduino wants a file referred to as Standart Firmata uploaded from the Arduino IDE. That is sketch is discovered below File/Examples/Firmata/StandartFirmata. This makes the Arduino Nano able to work together with Python. On the opposite finish, the Python library chargeable for speaking with Arduino is known as pyFirmata. Hopefully, pyFirmata is already put in both from the Anaconda-Navigation window or by PIP set up, together with Cv2, Numpy, and SciPy. The time library is a typical library that’s already put in. The Python program is known as Full-AutomaticUsingPython.ipynb and may be downloaded from Github.

6. Gadgets Used and Prices

I typically used Amazon to buy what I wanted for this venture. This was principally out of comfort. It additionally didn’t require me to bodily go to retailers throughout the pandemic. I additionally generally when for the sooner supply choice. That meant that I often purchased extra elements than I wanted. I justified this to myself as a result of I believed I’d apply it to different tasks.

If you happen to additionally find yourself with elements you don’t want on the finish you possibly can at all times donate them to your native colleges. I spent about 300 Canadian {dollars} on this setup. And I now have sufficient resistors, capacitors, jumper cables, and Arduino Nano’s to final me a lifetime. Nevertheless, I believe you possibly can cut back the price to about $100-150, in the event you scout and search the web for websites like Alibaba, eBay, and so forth.

A fast disclaimer, in the event you use the hyperlinks under to your buy I’ll obtain a small fee. This little kickback may additionally encourage me to share different tasks sooner or later. Utilizing these hyperlinks doesn’t have an effect on the worth. That mentioned, I additionally recommend you utilize different web sites for cheaper costs.

0. Venus Laowa 65mm f/2.Eight 2X Extremely Macro Apo Lens. I actually like this lens.

1. The stepper motor. (On paper that is equivalent to the one I’ve used. I simply hope the shaft diameter is identical. Sadly, the one I purchased is now not out there)

2. The stepper motor driver

3. The microcontroller

4. The HDMI to USB out video seize card

5. Belts (158mm was used)

6. 100mm x 6mm Stainless Metal Spherical Rod (Additionally presently unavailable). Sooner or later I would strive 6.5 or 7mm diameter.

7. Mini breadboards

8. Resistor field (4 10ok Ohm was used on the controller, one 2k Ohm and one 5k ohm was used as a voltage divider for the digital camera shutter launch)

9. Regulate the stepper motor pace when utilizing solely Arduino (not wanted for Python aided)

10. Hex key 1.27 and 1.5 have been used to make the brand new shaft

11. DC energy provide. I minimize out the wire to show them and used alligator clips to energy the board. This isn’t a long run answer.

12. Important for connecting the circuits. Nevertheless you should have far more than you want

13. This wire was useful for the shutter cable, nevertheless it won’t be vital

14. This mounting tape was fairly good. The adhesive was sturdy and I used to be capable of take it off with out a hassle

15. Far more than what is required, however I used this type of button

16. Just one GT2 pulley was used on the stepper motor (Tooth: 20, 5mm diameter)

17. Switching on and off the stepper motor (essential if you wish to use the movie provider deal with)

18. I used 1000uF 35V capacitor, which was a overkill. A 100uF 25V ought to suffice

19. Motor mount

20. Electrical tape for solderless wire connections

21. 2.5mm Three part jack (seems you don’t want to chop your shutter launch cable)

22. Tooth: 20, 6.35mm diameter used on the shaft

I hope you loved this how-to guide.

Concerning the writer: Seckin Sinan Isik is a photographer exploring the world of analog. The opinions expressed on this article are solely these of the writer. You will discover extra of Isik’s work on his web site, Fb, and Instagram. This text was additionally revealed on his weblog.


Please enter your comment!
Please enter your name here