Shop OBEX P1 Docs P2 Docs Learn Events
Questions on cameras for streaming video — Parallax Forums

Questions on cameras for streaming video

T ChapT Chap Posts: 4,199
edited 2016-05-30 15:34 in General Discussion
I want to experiment with some cameras to start learning how they work. Also, I have a number of locations in my house and yard I'd like to monitor and was thinking about trying to do a DIY version instead of buying a system that I learn nothing from. I will be ordering some boards soon for several projects and would like to include a board for a camera. The remote camera module can have a Prop on it. Does anyone have a suggestion on what to look at based on the idea that I want to monitor on LCD 800x480 in color, some distances may be 150'+, and there would be multiple cameras to choose from to watch on the screen. If a camera resolution was smaller than 800x480, hopefully there are some tricks I could find to center the image. At a nice color depth, that means a ton of data so I would not be so worried about high frame rate, even if it were jumpy quality I could still see who is at the gate etc and record some amount of data from a motion trigger. The ideal concept is to run power to the module with a CAT5/6 and it could be shielded if needed. I use RS485 for those lengths easily and could send power, gnd, A, and B over the unshielded CAT5 with no problem and get a lower frame rate but good color. At those lengths I don't know if a 4 bit + CLK home cooked scheme would work. The last resort would be video cable(ie RJ6) + Cat5, but really do not want to run extra cables. The problem also with RS485 is that the cameras would be in positions such that daisy chaining multiple units would not work without a lot of wiring, a star would be more practical. I'd can build a separate Prop board dedicated to only multiple RS485 chips to create a star, then on some motion trigger or manual camera select I could start an RS485 engine to stream from that location to the LCD in the house. For cable lengths this may even be best.

Anyways hopefully this gives the idea and problems to solve. Thanks for any suggestions.


Addit:
For TX RS485 100Mb max device Quad RS485
http://cds.linear.com/docs/en/datasheet/16889fa.pdf
For RX RS485
http://cds.linear.com/docs/en/datasheet/15189fa.pdf

16889fa Datasheet shows 20Mb-33Mb at 200'. Seems like highspeed RS485 may be a good solution for an custom SMT camera at one end and a receiver at the other for LCD display.

800*480=384000 * 16bit color = 6144000b / 8 = 768000 bytes needed per frame * 2 = 1,536,000 color words needed per frame for 16 bit color

20,000,000Mb per sec data rate / 8 bits = 2,500,000 bytes per sec / 2 = 1,250,000 color words per sec

1 Frame per sec full 16 bits with one of the quad drivers. Or use an extra pair in a CAT5 and double the rate. Third pair and triple the rate to 3 frames per second.

In a CAT 5 from a Prop with the camera and Quad Driver on board, 3 pairs RS485, Power, Gnd.



«1

Comments

  • There's not a lot of ways a Prop is likely to help with this sort of project. A Prop can overlay text on a NTSC signal but a Prop can't capture color video in a useful resolution in real time.

    I think there's two main options when it comes to video, analog (NTSC) or digital. Analog has the advantage of being cheap and pretty easy to use. You just run coaxial cable from the camera to the monitor. You also need to power the camera.

    These analog security cameras are relatively inexpensive.

    The price of digital cameras has come down a lot recently. There are lots of inexpensive (about $20) WiFi cameras. These sorts of cameras are also really easy to use but you need a WiFi enabled smartphone or tablet (I imagine they work with desktop computers as well).

    Digital cameras can have much higher resolution than than NTSC cameras. The Raspberry Pi's camera is an example of one of these relatively high resolution cameras. Bill Henning posted about his experience using the RPi camera here.
  • T ChapT Chap Posts: 4,199
    edited 2016-05-30 15:43
    Thanks Duane, see my added notes above on TxRx Rs485. What about a 4 port Full Duplex serial driver, the Prop reads in ( SPI? ) the full color from an SMT camara module. Transmits over 3 twisted pairs. Seems the Prop could handle reading a few frames a second and transmitting a few frames.

    Wifi is not a good option for some locations. I have some wifi cameras now on a security system and they are neat but have range issues. Part of it is to learn how to get video into my own systems. I can live with up to 1 Frame per second of good quality image. But was partly trying to find out what methods people were using for this.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2016-05-30 16:06
    It would be interesting to see a low frame rate video stream from a Prop but I don't recall ever seeing this on the forum.

    I think the closest something like this I've seen are from the cameras on the Laser Range Finder (designed by Joe Grand) and the CMUcam4 (designed by Kye).

    I think the large amounts of memory required to store a color image becomes a big problem when trying to use the Propeller to process color images.

  • T ChapT Chap Posts: 4,199
    edited 2016-05-30 16:50
    I was thinking to capture a frame on one end to SRAM, transmit to a Prop receiver that stores the frame in SRAM or HyperRam, then load the frame to the video driver ram, then display on LCD. In any case, some camera recommendations would be helpful for SPI or parallel input to P1 just to have something on a board to play with later. Simpler the better for the SMT camera module. Also recommendations for SRAM that you guys are using would be nice. Although on the receiver Prop using the 3x RS485 scheme then it would possibly have to be 3 separate SRAM to be able to buffer 3 at a time. Then on upload to the LCD buffer, reconstruct the color word from the 3 SRAMs/HyperRams.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2016-05-30 17:27
    I've wanted to make a board for the camera used in Parallax's Laser Range Finder. The camera is available at Digikey.

    Here's a thread about using the LRF as a camera.

    I started laying out a board for the camera once but I couldn't find a fab house which offered resolutions high enough for the camera's pads. It's been a while since I've looked for a fab house and I didn't look very hard.

    I'm not familiar with current SRAM options. I've used 23K256 SRAM chips and I've played with the Propeller Memory Card (PMC) which has a 128KB SRAM chip on it. I think the SRAM chip on the PMC can operate in a 4-bit mode. I believe there are now 8-bit SRAM options but I'm not sure about this.

    There's also the option of using multiple SRAM chips in parallel. I copied the work of other forum members and used eight 23K256 SRAM chips in parallel.

    If you decide to use a parallel bus for either your SRAM or your com lines, place the bus on the lowest number I/O pins. This eliminates the need to shift the bits to high I/O pins and makes the PASM driver a bit faster.
  • T ChapT Chap Posts: 4,199
    edited 2016-05-30 18:18
    Those OMV7690 look nice, no datasheets online though. 4x5 grid BGA? 2.5 x 2.9 x 2.5 looks like the pad size would be 2.5x2.5 and to fit 4x5=20 balls in that area means a very tight fit. Not something I want to try I think by hand, routing would be a challenge too. Who knows without a datasheet.
    operates at up to 30 frames per second (fps) in VGA resolution with complete user control over image quality, formatting
    and output data transfer.
    8 bit output means two reads to get 565 out of it

    So the FPS is configurable via I2C commands? It shows RGB565 which works for a nice image.

    128KB SRAM is too small to even park one color out of 565 onto it, problem with the large Flash with millions of bits is they wear out. You'd need to store an entire capture I think and then process it/transmit it. HyperRam would be the solution I think to buffer a stream.
  • T ChapT Chap Posts: 4,199
    edited 2016-05-30 18:44
    Here is what I can come up with with absolutely know knowledge about how this would normally be done in a wired scheme. Basically you have to read a camera to get a single image, then xmit RGB separately over RS485 with 3 different Serial engines ie FDS. The other end has 3 serial ports reading in the RS485 in their own cogs and buffering to 3 separate SRAMs. Then once the image is received, the Prop takes each color, puts the word back together and sends 16 bits to the LCD controller. It needs a 256k byte SRAM x 3 for a 768k byte image separated into 3 parts. 2Mb SRAM? 1M SRAM for 2.1 http://www.digikey.com/product-detail/en/microchip-technology/23LC1024-I-SN/23LC1024-I-SN-ND/3543084
    no stock on 2Mb
  • T Chap wrote: »
    Who knows without a datasheet.

    Apparently someone violated their NDA; the datasheet is available online from a couple different sources.

    Here's a link to a pdf of the datasheet.
  • I think that is a 4 layer project. .5mm pitch. Not something I want to try for sure.
  • jmgjmg Posts: 15,148
    edited 2016-05-30 22:02
    T Chap wrote: »
    ...
    no stock on 2Mb
    what part code ?

    T Chap wrote: »
    HyperRam would be the solution I think to buffer a stream.

    Yes - my reading of HyperRAM data has two 'domains of use',
    a) IF Faster than 64ms, you can do anything that repeats, and it will refresh automatically.
    b) If you cannot guarantee 64ms (and here that means about 24MBd, so that is out) then you flip to the faster than 4us, dynamic CE#, mode.

    A Std Prop (with modest HW support ) can deliver ~40 byte sets in that time, (overclocked might get to 50) which you could alternate between LCD read-back and image write.
    ie one 4us burst is LCD read, the next 4us burst is Camera read.
    Say ~20 of those byte sets are lost for address+delays, and assuming 2 x HR for 16b wide, that's about 20~30 pixels in 4us, halved again due to alternate, so 20~30 pixels in 8us, each way.
    Your links could use Run-Length coding to try to get back some bandwidth.
  • T ChapT Chap Posts: 4,199
    edited 2016-05-30 23:46
    Digikey shows no 2Mb SPI SRAM at all. 1Mb to 4Mb jump. If my 3xRS485 scheme is the plan, it will require a dedicated Prop Receiver with 3xSPI 2Mb RAM to park 768k bytes which arrive separated in 3 colors. 565. Which wastes 3 bytes on R and B, 2 on G. Maybe send two bytes only RRRRR_GGG GGG_BBBBB, which is how it can be presented to the EVE as sent in 2 bytes via SPI.

  • rjo__rjo__ Posts: 2,114
    edited 2016-05-31 03:11
    If I have my head straight on this... I think all of this will eventually be done using chips from the P2 family. The issue is how to prototype it... get the data rates and paths straight. You can know that it will work before the P2 arrives and all the assorted software bits are in place.

    Here is a set-up that you can put together over a weekend for about $100 per camera "nest." A camera nest is one or more cameras within about 8 feet of each other... add $10-25 per USB camera in the nest.

    1. High-Res USB cameras
    2. Cheap WIFI win box. I like the 64bit Kangaroo Win10 for this (about $100)
    3. P1 connected over duplex serial to nest computer... same P1 connected by your choice of serial to home base. P1 controls everything through applications on both ends. We aren't using serial to pass images because the data rate to the P1 is a problem.

    4. Use WIFI to Share the screen for the nest with your central computer. Parse the data on the compute side. Use multiple serial lines from your central computer to your P1(or P2v) to get the data from the computer onto your LCD screen.

    I use Processing.org for USB imaging on the PC side. This allows you to use a High-Res USB camera but only display and transmit the data you want... full resolution scaled down to 800x480.. any portion of the image at full resolution or anything in between...effectively giving your 800x480 display a digital roam and zoom function. Simple to do. I can give you the code.

    By doing it this way, you can also limit your data rate to the P1(P2v or P2). Since you have electronic zoom... you can cut the data by 4 without fear of losing a detail... you just have to decide what details are important... motion? -> zoom to motion.

    If you are worried about electronic security, you could encrypt the data before displaying in the nest (and therefore before sending by wifi). WIFI can go away when the P2 comes or hang around using your own wifi board. Only problem is that the higher the USB resolution, the slower the frame rate... all limited by USB. I would consider cheap USB3 cameras, the kangaroo has USB3.

    I haven't heard any talked about USB3 on the P2... but from where I am...USB3 looks a lot like several USB2 lines with some sort of mediation in between... so I'm guessing we won't have complete USB3
    but that we will be able to use some USB3 devices and I'm guessing cameras... I could be wildly wrong about this.

    If you want to build a camera board... bless you. You can prototype it and get it working... it just can't be put into the prototype system very easily without a P2v.








  • rjo__rjo__ Posts: 2,114
    edited 2016-05-31 03:22
    I did some work on imaging with a P1V hooked to a generic omnivision camera. I had it almost working when everything seemed to go up in a puff. No actual smoke... just a Verilog bug or my failure to tie something to ground? At that point the P2V arrived and I lost interest. If you are interested I could go back and see if I can find it. Maybe between me, you and the entire country of Australia(or just OzPropDev) we could get it working:)
  • jmgjmg Posts: 15,148
    rjo__ wrote: »
    I haven't heard any talked about USB3 on the P2...

    That's because it is 2 generations ahead of P2.
    rjo__ wrote: »
    but from where I am...USB3 looks a lot like several USB2 lines with some sort of mediation in between... so I'm guessing we won't have complete USB3
    but that we will be able to use some USB3 devices and I'm guessing cameras... I could be wildly wrong about this.
    Most USB3 systems can fall back, but they need to fall back to 12MHz FS USB to be P2-useful with no added chips. Check the data sheets.
    rjo__ wrote: »
    ...
    it just can't be put into the prototype system very easily without a P2v.

    That depends on the frame rate, The OP has suggested a rather modest frame rate, that should be testable with P1 and HyperRAM.

    A P1 should manage in the region of 3MPixels/sec Read and write interleaved with HyperRAM.

    A P2 should manage rather more, with the streamer.
  • rjo__rjo__ Posts: 2,114

    jmg

    I was a little off topic, but thought it was worth it.

    Your comments are always helpful. My only useful experience with USB3 is watching the system report on the streams coming from a Kinectv2... which all seem to arrive at USB2 type speeds. The magic behind this is ... magic to me:) I am much better at reading data sheets now than I was 10 years ago, but it is a last resort... everything else first, then the data sheet, fingers crossed.


    Thanks again,

    Rich
  • T ChapT Chap Posts: 4,199
    edited 2016-05-31 04:05
    Thanks rjo, but I am working on a scheme to connect any number of cams over several hundred feet. But first need to find a camara to get started. Suggestions on a nice color image where a P1 can read up to 16 bits, SPI or parallel? I would like to read at least one frame per second.
  • rjo__rjo__ Posts: 2,114
    I didn't understand that you only wanted 1 frame per second.

    At the low end, almost every cmos camera board supports 16 bits... arriving 8 bits at a time. So each pixel actually takes two camera clocks and arrives in parallel. Almost all of them support RGB as an option that has to be set through i2c. The RGB data type can be selected, with the most common being 5/6/5 RGB.

    In my experience, the best camera is the one that has a code base. Fiddling with the register sets is a good source of headaches. If you want the shortest route, take Duane's advice, use the camera from Parallax's range finder... then you get not only the proper register settings but the Prop code to boot!!!

    If for some reason you don't want that... the OmniVision xx40 series is good. I've used most of them successfully with a P1, but only in 8 bit monochrome from yuv... so I only need every other byte from the usual default setting... easy peasy. One disadvantage to lowering the frame rate on some cameras is that you also inadvertently change other acquisition parameters... so you might get 1 frame per second... but it might also be integrating throughout that second... making motion a complete blur.
    Color distortion will happen on some but not others... Again color is not my thing, so I can't really help, except that I know it is an issue.

    When you are designing the board... please make it so that you can leave two or three boards attached to each other. This makes potential stereo alignment fixed and pretty much constant.


  • "take Duane's advice, use the camera from Parallax's range finder."

    You can't solder it, requires a multi layer board which I am trying to avoid. But even with a multi layer board, not something you want to be trying without a very expensive machine.


  • http://www.mouser.com/ProductDetail/Cypress-Semiconductor/FM25V20A-G/?qs=sGAEpiMZZMtsPi73Z94q0NgxFDRNs5jAFWc8uJcmBTA=

    http://www.mouser.com/ds/2/100/FM25V20A_2-Mbit_256_K_8_Serial_SPI_F-RAM_Datasheet-748798.pdf

    14.00 each! Anybody heard of this? I was looking for a 2Mb quad SPI to experiment with my 2x or 3x RS485 transmission from the camera with no luck yet finding it. Change to 1Mb which is easier. But I ran across this part. Seems interesting. Expensive. Single in SPI only. I would need 2 or 3 of each RAM to try this scheme, as there are 2 or 3 receivers that need to buffer the image at the same time.

    NoDelay™ writes
    The FM25V20A is capable of supporting 10^14 read/write cycles, or 100 million times more write cycles
    than EEPROM. These capabilities make the FM25V20A ideal for nonvolatile memory applications, requiring frequent or rapid writes.Examples range from data collection, where the number of write cycles may be critical, to demanding industrial controls where
    the long write time of serial flash or EEPROM can cause data loss.

    Still looking for a Quad SPI 2Mb.
  • jmgjmg Posts: 15,148
    T Chap wrote: »
    ...FM25V20A 2-Mbit F-RAM...
    14.00 each! Single in SPI only.
    FRAM will always be niche pricing, and the single SPI only is just daft.
    Unless you really need the non volatile / RAM mix, best avoided...
    Cypress also have NV Rams, at even higher prices...

  • https://cdn.sparkfun.com/datasheets/Sensors/LightImaging/camera_interface.pdf

    https://www.sparkfun.com/products/13249

    This OV5640 has an eval board on Sparkfun with a ribbon cable designed for some duino board, I think it is easy to find the FPC connector and make a board for this connected to a P1. The module itself is BGA, but has a large open area inside the BGA area for vias so it looks very easy to solder. Duane/rjo others, any thoughts on this working with P1? If so I can add a P1 board to my next order for testing.

    I intend to stack up 4 of these http://www.digikey.com/product-detail/en/microchip-technology/23LC1024-I-SN/23LC1024-I-SN-ND/3543084

    1Mb Sram on the P1/Cam board for a buffer if needed. On the receiver side P1 module, use the same SRAM to receive the data from the remote camera. Then send the data to whatever display.
  • I don't know enough about the OV5640 to know if it's a good match for the Propeller or not.

    I still like the OV7690 as a camera to use with the Prop. If we could find a fab house capable of making clean 4mil traces, then we might be able to solder the camera with toaster/reflow oven.

    The fab houses I've used require traces at least 6mil wide. Three years ago I laid out the pads of the OV7690 to see how they would look with 6mil traces. Here's what I came up with:

    CameraTraces160601a.PNG

    Obviously 6mil traces are too wide but I think 4mil traces would work fine.

    If any of you know of a fab house capable of making boards with 4mil traces, I'd like to know about them. If I could find a place to have boards made at a reasonable price, I'd try to make some OV7690 breakout boards.
    449 x 460 - 10K
  • rjo__rjo__ Posts: 2,114
    T Chap wrote: »
    https://cdn.sparkfun.com/datasheets/Sensors/LightImaging/camera_interface.pdf

    https://www.sparkfun.com/products/13249

    This OV5640 has an eval board on Sparkfun with a ribbon cable designed for some duino board, I think it is easy to find the FPC connector and make a board for this connected to a P1. The module itself is BGA, but has a large open area inside the BGA area for vias so it looks very easy to solder. Duane/rjo others, any thoughts on this working with P1? If so I can add a P1 board to my next order for testing.

    I intend to stack up 4 of these http://www.digikey.com/product-detail/en/microchip-technology/23LC1024-I-SN/23LC1024-I-SN-ND/3543084

    1Mb Sram on the P1/Cam board for a buffer if needed. On the receiver side P1 module, use the same SRAM to receive the data from the remote camera. Then send the data to whatever display.

    The problem is that if you decrease the frame rate so that the P1 can handle the pixel rate, then you end up with terrible smearing of motion. There are already 20 pin DIP boards... very cheap. I have no idea how you have to adjust the color at those kinds of frame rates.

    I can help you with the software... I have it somewhere. I clipped the data and stored to uSD(If I'm remembering right). In my opinion, it isn't worth the trouble. For the P2... I think it would be ok, but I have no proof and I could be wrong.

    For your stated goals, my best advice is to listen to Duane.

    My second best advice:

    Aptina has a chip MT9V034... I have no experience and just came across a "cheap" Chinese source ... ~$50. Expensive chips... so it looks like at least 100% mark to market.... but really isn't:)
    http:/onsemi.com/pub_link/Collateral/MT9V034-D.PDF

    I love it. Global shutter should make color a non-issue(although the proof is in the pudding);

    I am eager to work with this chip. If you were to go with this, I would be happy to order up a board and see what happens.
    I know nothing about the register set, but I have seen some public "open" work done with an older brother of this chip.

    How hard could it be? :)

  • rjo__rjo__ Posts: 2,114
    If my memory is correct, I think you have a pick and place without cameras, so the ball grid might be a problem.
    If this is a problem, let's solve it. Let's figure out a way to place those chips without spending another $8000.
    We have a lot of guys with a lot of experience around here.
  • I was just looking through the datasheet of the "HyperRAM" being discussed in another thread.

    I don't understand these chips well enough to know if they would be a good match for this project but I think it's interesting these chips have a similar pad layout/spacing as the small camera.

    If I'm reading the datasheet correctly, the HyperRAM has one more column of pads than the camera. The pads could be brought out to the side of the chip without the need of vias under the chip.

    HyperRamTraces160602a.PNG

    In the above layout I used 0.1mm traces (I was using metric units). 0.1mm is about 3.9mil.

    I think I'm going to look for a fab house capable of making boards with 4mil traces so I can try my had at making breakout boards for these interesting parts. If any of you have fab house suggestions, I'd love to hear them.
    577 x 528 - 15K
  • Anyone recognize this connector use on the camera from Sparkfun? They don't mention the connector type but I'd like to find a SMT version to mate with this. It is a breakout cable for the OV5640 camera. I am looking to test this with the Prop.

    https://www.sparkfun.com/products/13249
  • On the pcDuino schematics, the PCB connector has designation Q1S02B, and on a different schematic it has a part number of: CON24TDS-6_9X4_4-P0_4-H1_5.

    Google did not help with either of those identifiers.
  • T ChapT Chap Posts: 4,199
    edited 2016-06-07 03:44
    Very nice! I put the first part of the number in digikey and found the parametric for the type and found the exact same part here

    http://www.digikey.com/product-detail/en/panasonic-electric-works/AXK724147G/255-2535-1-ND/1986698


    Then click on mating products and find this

    http://www.digikey.com/product-detail/en/panasonic-electric-works/AXK824145WG/255-2528-1-ND/1986691

    May not be exact but at least it gets me very close.

    Thanks, now I can get the camera and figure out how to adapt it to the propeller. The only thing still is their schematic shows a number of parts on it including a regulator, but the ribbon cable only has 2 caps and some IC. Not sure if they really meant that all those parts were really include on the ribbon cable.

    https://cdn.sparkfun.com/datasheets/Sensors/LightImaging/camera_interface.pdf
  • rjo__rjo__ Posts: 2,114
    When it comes to industry standards and protocols, I lose. That is a CSI connector? But with all the pins, it has to support parallel data, right? Or are you going all MIPI on us:)?



Sign In or Register to comment.