PiScanner | Project Execution [Demonstration/Distribution]

I should preface this by saying that it is no where near as polished as it could be. But it works, and the objects taken by the camera are recognizable. Eventually, if I have the funding, I will upgrade the Camera.

There are many elements to this project. There really isn’t a great place to start with this project, so well start with the fritzing schematic and a list of materials needed.

You will need:

2 Attiny85’s
16 wires
a breadboard
a 100k ohm resistor
a 330 ohm resistor
a raspberry pi
PIR motion detector
the cables for interfacing with the raspberry pi
an isp programmer for the attiny’s

So let’s look at this schematic:

When motion is detected, the signal pin on the motion detector gets pulled low. at this point the 3.3v attiny pulls pin 1 high, sending a signal into the rpi (it’s 3.3v so it’s safe for the broadcomm) and illuminating an LED so the user can see that motion is being detected.

The raspberry pi then sends a signal to the 5v attiny indicating that motion has indeed been detected. Once this occurs, the 5v attiny pulls the 5v pin going to the webcam high. I had to integrate this step of turning the webcam on via the attiny because there is a hardware misconfiguration that causes the software i’m using to take the picture hang. Turning the camera off and on each time a picture needs to be taken gets rid of this problem, because the camera always takes the first picture after being turned on.

At this point a picture is taken and moved to a flash drive. They could be moved wherever, but a flashdrive works the best for now, as I will be deploying this system in a place where there isn’t internet (in my garage)

Now time for source codes!

Software wise you will need:

The Arduino IDE

Python (I’m using Geany on the raspberry pi)

fswebcam which you can obtain by running

On your raspberry pi.

This is the source for the 3.3v attiny85

This is the source for the 5v attiny85

This is the python source, you will need to install this to make it work though.

This is the Fritzing document.

Here’s a sample image from the camera. It is looking at the breadboard.

9 Comments

  1. I officially dig it. I believe I have several similar cameras, and the weird thing is they work fine on the same Debian distro on my x86 boxes. I’m wondering if there’s something weird about gspca ( http://mxhaard.free.fr/download.html ) on ARM? Can you name your bad (single-frame!) camera?

    1. Awesome! First of all I have to say that’s it’s extremely validating to have a non-bot comment. About the camera’s I think it’s a Logitech Quickcam Express Web Cam. I found it in the “electronics” bin at my town dump, so i’m not really sure. It was plug and play on windows however if that helps. But as you can tell I really had to jump through some hoops to get this thing to be able to take more than one picture. What problems are you having?

  2. Hey, I just thought I’d come by to say good work!
    I’ve been really wanting to get in to the programming scene for a while, so checking out a lot of Raspberry Pi videos. Interesting, that you have this motion capture going on.

    How long did this project take?

    1. Thanks for commenting! The hardest part about getting into these kinds of projects is coming up with an idea. I’m pretty well versed with programming but I would say start to finish it would probably take me a few weeks to do start to finish If I had no knowledge of programming. That being said, in reality it took me about a weekend to do.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.