Raspberry Pi camera module v2.1


#1

Not sure why, but I do love seeing a forum where the topic of conversation is always telecine! I’ve been playing with it off and on for years, focusing on converting Super8 film frames to digital.

Recently I saw they upgraded the Raspberry Pi from the 1.x versions I’ve used in the past to the new 8MP camera. I have to say, for use for macro work like we need, this is a way better model with higher resolution.

While I read many people here talking about pros and cons of multiple systems, my focus is building something compact, so the Raspberry Pi is a great idea for controlling the motors and capturing the image. Not that I know anything about what’s required for coding, but it does make things compact. And what’s great is you can easily adjust the lens for macro work! We’ll you make want to 3D print a few tools to make it easy on yourself. But that’s all you need.

If anyone know’s how I can control the stepper motors from the raspberry pi, please let me know. Thanks.


#2

I’m struggling with the „raspberry and stepper control” on this project: https://github.com/jphfilm/rpi-film-capture
The movement of my motor is very unstable.

I also tried to run a simple python script to feed a PWM signal to the STEP input of an A4988. Even with this simple configuration the motor had some intermitted stops for some ms – probably due to the multitasking of the raspberry o/s. There are also some comments o different blogs that recommend an “intelligent motor controller” which is connected via i2c to the raspberry.


#3

I’ve been experimenting with the Pi Cameras ever since they appeared for my Super8-focused telecine project. In fact it started to seem realistic just when the cameras were released. The best thing about them is they’re using reasonably small sensors so achieving the required magnification of the tiny Super8 film frame was easy.

I experimented with both Pi Cameras - v1.3 (5Mpix OmniVision OV5467 module) and v2.1 (8Mpix Sony IMX219 module) in both cases adapted to the M42 mount allowing me to use my favorite lens for this kind of work - Flektogon 35/2.4. This set up doesn’t even require a reverse mount, just some macro rings. Now, the extra resolution doesn’t seem to make much difference. The amount of details is roughly the same, perhaps it’s just the sample films I used, but my impression was that I couldn’t really get more resolution from the tiny frames anyway.

What I hoped the newer camera would be better at was dynamic range, noise, white balance and especially the uneven color cast, which seemed to be a common issue with the v1.3 camera. This is much better with the v2.1 camera, but there’s some uneven shading, presumably from the built-in lens correction algorithms. There’s also a bit of uneven red-colored noise patterns across the image, somewhat similar to what older compact cameras shown when pushed to the limits. I have a bunch of sample photos but haven’t had the time to put these together as comparisons.

My personal conclusion was that I’d probably want to get a better machine vision camera for production quality, or perhaps give some mirrorless system a try (Nikon 1 is promising due to its smaller sensor size). But Pi Cameras are both (5Mpix and 8Mpix) good enough for “proof of concept” and for fine tuning, and the newer camera may be sufficient for preserving home videos.


#4

To comment on stepper control: I think this may better be discussed in a separate thread (since this is titled “Pi Camera”) but my goal was the same - control it from the Pi to reduce components. But right now, I have a separate Arduino Pro Mini connected to a microstepping driver using A4988. Perhaps it would be actually be easier to just keep it this way - arduino being dedicated to motor control, and being real-time unlike Raspberry Pi, would allow more precise control. There’s a nice AccelStepper library for Arduino, which has built-in acceleration/deceleration support for a smoother motor control.


#5

Sorry I have been away for a while.

Hopefully this helps:
I am using an Easy Driver board connected to my Pi, as a means of Isolation with a separate power supply. Unsure how you have or are planning on connecting yours and what size motor you are wanting to use (I stole mine from an old Scanner), it is actually quite easy.

Gerhard34, If I had to guess you just don’t have your motor leads hooked up properly. Must make sure that each pole is orientated properly positive and negative. I am controlled one of mine right from the PI, as smooth as can be, at high and low speeds. With the Easy Driver it is even less tasking on the PI so it will be even smoother yet.

If your looking for the coding to drive a stepper motor, to a certain degree I need to know how your hooking it up and from where are you controlling it (Terminal, Python Script, ect). Here is an example that should work if your hooked up the same as me (it can be something different that the Easy Driver, just as long as it has the same type of control):

import RPi.GPIO as GPIO
import time

try:
    import RPi.GPIO as GPIO
except RuntimeError:
    print("Error importing RPi.GPIO!  This is probably because you need superuser privileges.  You can achieve this by using 'sudo' to run your script")

GPIO.setmode(GPIO.BCM)

GPIO.setwarnings(False)
# Inputs

# Outputs
enblPin = 4 # Broadcom pin 4 or PI1 pin 7
dirPin = 5 # Broadcom pin 14 or PI5 pin 5
stepPin = 6 # Broadcom pin 15 or PI5 pin 6

out_list = [enblPin,dirPin,stepPin]

#GPIO.setmode(GPIO.BOARD) # Use the Physical pin numbering
GPIO.setmode(GPIO.BCM) # Use the broadcom layout for the GPIO
GPIO.setwarnings(False) # Disable GPIO Warning Messages
GPIO.setup(out_list, GPIO.OUT) # Define / Setup Outputs

while True:

    frm_step = 2000 # Number of Motor Steps to Travel
    time.sleep(5)
    i=0
    for i in range(frm_step): # Cycle through the number of steps to move one frame
        GPIO.output(stepPin, True) # Turn on the step signal to initiate the move
        time.sleep(0.01)
        GPIO.output(stepPin, False) # Turn off the step signal
        time.sleep(0.01)  # Wait before taking the next step. This controls rotation speed 
    time.sleep(30)
    print(frm_step & " Steps Forward")
    GPIO.output(enblPin, 1) # Disable the Easy Driver

GPIO.cleanup()