8 Replies Latest reply on Feb 14, 2016 4:08 PM by jim.gilmartin

    WiFi Camera with PSoC5

    matteo.trov

      Hi all.

      Some months ago, I was looking about the possibility to acquire an image from an optical sensor with the psoc 5, and send it through WiFi, in order to make a sort of remote camera for surveillance.
      I already had an optical sensor, that actually is the Omnivision OV7675, a 640*480 optical sensor, with 256 colors.

         

         

      For the WiFi module I found this Cypress/Redpine kit RS-CY8C001-220X
      that mount a RS9110-N-11-22 module.

         


       

         

      The PSoC 5 board is the CY8CKIT-050, and here there is a photo of the complete camera.
      Sorry for the very raw mounting, but it is just a test :)

         


       

         

      The concept from an Hardware design point of view is the following

         


       

         

      The data is read from the camera bus (8 bits) and transfered to a RAM buffer through the DMA.
      When the transfer is finished, the buffer is pushed out through the wifi module, to an Host PC, that read the data and draw the frame received, through a program wrote in C#.
      The camera handling is all implemented in the HW part of PSoC5, so the ARM is not used, and it is free to do other tasks.
      The resolution of the camera is set to 540*400, and every pixel is 1 byte size.
      The color scheme of the camera is RAW Bayer. The camera is able also to give data in other more usefull format like RGB or YUV, but it will lead to a pixel size of 2 bytes, and the whole PSoC RAM will be not enough, so the conversion RAW Bayer -> RGB is done by the host PC.
      The buffer length for image storing into the PSoC is of 54000 Bytes. In order to be able to use so many bytes of the whole 64KBytes of RAM I reduce to the limit the stack and the heap area.

         

      This buffer is not enough to keep all the data coming from a frame of 540*400*1byte, so the PSoC HW is actually filtering
      removing 1 bytes and keeping the next, and the same for the row, removing 1 line and keeping the next, in order to half the resolution keeping the same viewing window size.
      I have so the sensor view size of 540*400, but downscaled on a resolution of 270*200.

         

      The maximum fps that i measured in this condition, with 4 Mhz clock on the camera, is of 1.67 fps, and it is equivalent to a baudrate of about 88 KB/sec.

         

      No extra hardware was used for realizing this project. The only hardware parts are the wifi module, the camera, and 2 resistors for the I2C line...

         


      Here there are some snapshot taken from the camera:

         

      My backyard:

         


       

         

      Road in front of my house:

         

         

      Flowers:

         


       

         

      My dog:

         

         

       

         

      This is just an experiment, and i know, there are a lot of improvements possibile, like jpeg compression on the fly,
      or adding external ram to PSoC, in order to buffer more frames.
      I would really appreciate any feedback or suggestion on my project :)

      Thanks

      Matteo