Sunday 3 July 2016

Pi Zero with steerable pi camera

I wondered how minimal I could go for a pi based camera, both in terms of size, power and to a lesser extent cost. I have been using webcams, but I soon found that even on a pi 3, 2 USB webcams wouldn't run reliably at more than very basic resolution under motion.

I decided to see how far I could go with a Pi Zero and a pi camera. Of course this means I can only put 1 camera on the Pi, but I gain flexibility in that the cameras are no longer USB cable length limited.

The result is very successful:

I also decided to I to try making the camera steerable using this little adafruit gadget.

Here is the final BOM:
  1. Raspberry Pi Zero with basic case and kit of leads
  2. Raspberry Pi Camera (mk 2)
  3. Raspberry Pi 2 Camera cable
  4. Adafruit mini pan tilt kit
  5. a few bits of wire
  6. 220uF & 100nF capacitors
  7. High power usb wart
  8. oh yes and a wifi or lan dongle
Total cost about £60 if you have to buy it all.

You will also need a usb hub for initial setup at least (I run mine with just the wifi dongle, so I don't need a hub)

The parts of this I was concerned about were:
  1. Were the servos and the pan tilt kit going to be stable / accurate enough?
  2. Would a single core processor cause glitching or other problems?
  3. Could I drive the servos from the Pi's 5v supply? (they draw about 250mA running, 600mA stalled and 10mA idling.)
  4.  Was there a reasonable way to route the ribbon cable?
 And the answers (so far):
  1. just about
  2. No, all looking good (using pigpio to drive the motors)
  3. Yes, adding the capacitors improved stability (of the motors - the Pi was fine)
  4. meh - ribbon cables are always a pain with 2 axis movement.
One arising questions:
  1. is it safe to run the 5v servo supply from pin 2?
Well on the Zero there is no fuse between the usb power socket and pins 2/4 so assuming your servos are well behaved, then yes. On other recent models the polyfuse has been uprated to 2A, so those should be fine as well.

3 comments:

  1. what if I have one SG90 servo and a 28BYJ-48 stepper motor? Would that still be okay to power them using the 5V supply from the Pi Zero when I power the Pi Zero with the micro USB wall power?

    ReplyDelete
  2. As long as the driver board you are using for the stepper has isolating capacitors (or you add your own close to the board) it looks like it should be fine as the stepper looks like it only draws about 100mA.

    ReplyDelete
  3. thank you. where did you hook the 220uF & 100nF capacitors in your circuit? and why are they different capacities?

    ReplyDelete