How To make (Almost) Anything
How To make (Almost) Anything
Week 7: Input Devices
Monday, November 2, 2009
I embarked on no less than 3 separate projects this week, and finished none of them. I learned quite a bit along the way, though, so I’ll relate some of this knowledge here before I go drink a mug of warm milk and bitterly go to sleep.
PROJECT 1: VGA CAMERA MODULE

First of all, since the camera has no internal buffer, the microcontroller controlling it has to be able to read the data coming out of it at whatever data rate the camera wants to send it, which is somewhere between 4 and 6 MHz. This can be slowed, but the images would become washed out because this just increases the exposure time, since a longer amount of time is being allowed to read off each imaging element.
So, the microcontroller must not only be able to keep up with the data coming off of the camera, but it must also be keeping track of how fast that data is coming in. Also, since the microcontrollers available to us do not have near the amount of SRAM needed to buffer an entire 640x480 color picture (around 1 MB or so) it must also be sending that data to somewhere that can store the data. We looked into using a FIFO buffer or even just an external SRAM, but we were never able to get around the point that the microcontrollers available to us just were not fast enough to handle talking to the camera. It can be done with an ARM processor, but we decided that this was outside the scope of what can easily be be made in most fab labs, especially with the constraint of only being able to use single sided pcbs - the routing would be very difficult for chips with such a high pin count, if not outright impossible.
Resources:
SparkFun discussion thread regarding this camera and others in its family.
Camera module implementation using an ARM processor with enough internal SRAM for images.
Camera module implementation using PIC32 and FIFO buffer to store images.
PROJECT 2: OPTICAL MOUSE IMAGE SENSOR

Resources:
PROJECT 3: ULTRASONIC RANGEFINDER
Since nobody else was doing anything with the ultrasonic transceiver modules in the fab inventory, I decided to give it a shot. I spent some time researching these modules, and found out that they are basically speakers whose center frequency is 40 kHz. The idea is that one sends out a 40 kHz pulse, bounces off of an object, and excites the other module. The time between transmit and receive can then be converted to distance since the speed of sound in air is known.
The speaker itself is effectively a capacitor, and driving it with a wider voltage swing gets it to output a stronger signal. I found a project which takes advantage of this property and a carefully chosen inductor to use resonance to step the AC voltage across the speaker up to 20V. I could not find any appropriately sized inductors lying around anywhere, and it was too late to get in on the week’s parts order, so I went back to the drawing board.

I decided to just try driving the speakers directly from the output pin of the attiny44. I designed and fabricated a board, only to find that I had hooked it up to the counter output pins also happen to be the input and output programming pins, rendering my board unprogrammable due to the added capacitance. Whoops.

Moral of the story: PAY ATTENTION.
Bedtime.
********************INCOMING MESSAGE FROM THE FUTURE********************
Hello again, past self. You’ve got to quit relying on me to fix stuff for you. In the next week, you will discover that the reason for your frustrating janky PWM signal is that you were trying to power the board with only 3.3V and the microcontroller cannot handle a 20MHz clock at that voltage. You will also get the rangefinder firmware to work, but it will only be able to sense distances between 15cm and 25cm - not all that functional. This is about as far as you’re going to get it without a hardware redesign. Why did you connect the receiver to the ADC and not the comparator? Why? Another tip - if you (me?) ever does a hardware design, you should try biasing the receiver like in Neil’s Hello Microphone example board.
*************************TRANSMISSION END*******************************
Resources:
Previous student from fab class who made a rangefinder.
Simple ultrasonic rangefinder which uses a cool LC resonance trick to get 20V across the speaker.
Learned a lot this week. Didn’t actually make anything that works. Sigh.