Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18

Thread: The picaxe can see!

  1. #1

    Default The picaxe can see!

    After entirely too many hours of work . . . behold! The first ever picture taken from a picaxe:
    Attached Images Attached Images

  2. #2

    Default

    Amazing! Would you like to explain exactly how?

  3. #3

    Default

    I used a 28X-1 running at 16 Mhz, and wired into a sensor taken out of a Nintendo Gameboy Camera. It gives 123x128 resolution. I sent it back to my computer via serial, and then converted it into an image with Matlab.

    I need to play around with the exposure time, gain, etc. to see if I can make it look a little better. Each image is about 16 kilobytes. I want to experiment with writing it directly to an FRAM buffer first (and caching it in the scratchpad, as well), as that would be MUCH faster. Lots of room left for improvement, but it's a cool first step.

    Oh, and the camera cost me about $5 on Ebay.

  4. #4

    Default

    Now, with scratchpad-buffered goodness! (and slightly better lighting!).
    Attached Images Attached Images

  5. #5

    Default

    Ah, thought I recognised MATLAB axes...

    That's pretty damned cool. Potential for robot obstacle avoidance there I think.

  6. #6
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    19,867

    Default

    That is superb, and well done. I am sure there were cries of "OH YES!" and spiralling of arms in the air when you got it working, and you deserve that moment of celebration. You've definitely scored a first here and I'm sure a lot of people will be looking forward to seeing a write-up when you get the time.

    It will be interesting to see what images you can extract using the various modes of the camera sensor. It's quite a powerful beast with edge detection and other useful modes.

    As a simple serial camera interface for a PC I can see this being very useful, and it probably would need a PC to do clever video analysis. For PICAXE robotics, the lack of contrast may not be a major problem as it may well be possible to determine which pixels show an IR Led and which do not using just a PICAXE. An IR or 'silhouette' tracking camera on a rotate/tilt platform would be an interesting project. This may also be useful for flame detection in fire-fighting competitions and even for micromouse wall detection.

    You've opened the door to many possibilities and it will be interesting to see what projects people do come up with. I would say a Gameboy Camera to PC interface via serial is definitely something 'Make' / 'Instructables' readers would be interested in.

  7. #7
    Senior Member
    Join Date
    Jan 1970
    Location
    Australia NE VIC
    Posts
    1,683

    Default

    Well Done, Congrats.

    PC Optical Mouses use Low Res Image Sensors typ-
    36 x 36 pixels some up to 64, Streaming Video
    posibilities there maybe, Woo Hoo !
    Last edited by Michael 2727; 23-09-2007 at 14:28.

  8. #8

    Default

    Can anyone make sense of this? There is a setting for "exposure time" in one of the registers, but the scene needs to be perfectly still for the duration of the "capture" while i'm doing ADC reads. It can't be a "per-pixel" exposure time, as that would take a rediculous amount of time (i currently have it set to like 320 uS - although, I think it may be based on the "clock" going in, which is supposed to be ~500 khz). Hmm.

    For those who don't know how the camera works, you write to its registers to set up all of the parameters (bit-banged serial), and then set a "start" line. Supposedly, after the duration of the "Exposure time", you are free to clock out all 16k-pixels, and the image data is presented following every leading clock edge as an analog voltage that you have to sample with an ADC. It currently takes me about ~1 minute to capture a photo and send it back over serial.

  9. #9
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    19,867

    Default

    My understanding ( analogy rather than implementationally factual ) is that the array is 'zapped' at reset to clear the capacitors and these then charge up on the exposure to light. The exposure time sets how long the caps are allowed to charge up before being being latched at the the value they've attained.

    It could be that each pixel in turn is zapped and then its cap allowed to rise which would explain any requirement to keep the image still during the entire sampling period, although the timing diagrams in the data sheet suggests there's only one exposure time, between Start and Read ( page 17 in the datasheet I have ).

    If you can live with black and white only, it should be possible to convert the analogue signal to a digital bit and stream these in using hardware or bit-banged SPI. With 115,200 baud you should be able to transfer the entire 128x128 image in around 200mS, 5fps.

  10. #10

    Default

    Interesting thought. Black and white would SIGNIFICANTLY degrade the picture, but that is a heck of a lot faster. Especially with the "edge detection" mode turned on, it might be useful.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •