Comments (12)
Hey!
Can you run the Adafruit test program (the one that draws text and all kinds of lines one the screen) just to make sure that the issue is not with connection to the screen? The issue probably isn't with the screen, but it would be good to make sure because it is easy enough to check.
It seems that either pixel reading is a little out of sync or one or more pixel wires have bad connection. How long are the wires from the camera to Arduino?
If you try a slow version (for example 2 FPS) does this still have the stripes?
from liveov7670.
Hi!
The Adafruit test program and the 2 FPS version of your code shows no stripes. The wires are about 20cm from the camera to the Arduino.
from liveov7670.
What does pixel clock signal look like from the Arduino's side if you measure it with oscilloscope? It should be PIN 12 if you connected it as shown in my schematic. On higher frequencies it may start distorting with longer cables and also the bread board connection in-between. I had everything mounted onto a PCB with very short connections.
Was the image brighter on lower FPS?
from liveov7670.
I have connected it as shown in your schematic, with the exception of not using level shifters. I only use a voltage divider on XCLK and pullups for SIOC and SIOD like in this image (the pin numbers in the image does not match your/my setup):
The pixel clock looks like this (@10FPS):
I think the image is equally dark, here is a comparison between 10 and 2 fps:
from liveov7670.
This looks OK.
Could you do the same measuring on the XCLK pin from the camera side. Maybe the voltage divider isn't fast enough. At 10FPS I am not checking the pixel clock PIN on each pixel because there is no time for that. I just detect the first pixel of a new frame and then start reading "blindly". If XCLK is uneven then it can get out of sync.
In lower frame rates code actually checks pixel clock pin.
from liveov7670.
The XCLK on the camera side did not look good:
I change the voltage divider to a mosfet based bi-directional level shifter:
and got this:
The streaks disappeared (yay!) but now I get some kindof "animated/scrolling" purple/cyan errors in bright areas of the image and some weaker stripes all over the image:
from liveov7670.
The new one actually seems worse than the voltage divider version. At least some of the bumps may count as clock cycle. It is probably because of the wire length.
I used the same kind of level shifter. For me it looks like this:
Maybe you can try voltage divider with lower resistor values? Arduino PIN can handle up to 40mA. Maybe 20mA to be safe. 5V/0.02A = 250 Ohm total (instead of 20k).
from liveov7670.
That did the trick! Found a couple of 330 Ohm resistors first so tried with them and got this signal:
I can't thank you enough for helping me debug this! I hope it will help someone else in the future!
On a side-note, what FPS did you get with the STM32?
from liveov7670.
You are welcome!
Not much higher than Arduino. Maximum reliable image I got was at 12FPS.
With Arduino I got the camera and Arduino to be in perfect sync so I could read pixel data while ignoring pixel clock.
For some reason I could not do that with STM32.
There is a topic for OV7670 on http://www.stm32duino.com/ forums. I read that it is probably possible to capture pixels on hardware level with STM32. So I believe it is possible to go higher than 12FPS but I haven't tried it since my initial goal was to get it working with Arduino. I ported it to STM32 just to see if I can get it working.
Is the image still too dark? The camera object has methods "setContrast" and "setBrightness" you can try those. Although for me the default settings work pretty well.
from liveov7670.
Ok, thanks for the STM32 info!
It's still a bit dark. I will try to fiddle with the histogram auto exposure thresholds.
I got an idea for improving framerate: since you are blindly reading pixels, could you not double the framerate for grayscale video by doubling the pixel clock, changing to YUV and only reading every other byte (the luma (Y)) from the YUYVYUYVYUYV.. byte stream? (I'll move this to a feature request)
from liveov7670.
I ordered a couple of your PCB:s from ALLPCB by the way :) They offer free world wide DHL shipping so I only paid $5.5 for 10pcs. Seems too good to be true, I guess time will tell :)
from liveov7670.
That does sound too good. Last time I ordered from PCBWay. They also have 5 USD for 10pcs (up to 10cm10cm size) but DHL delivery is around €25 (or China Post which is cheaper but takes over three weeks to arrive).
Next time I'll try ALLPCB. $5 isn't too much of a sacrifice if it isn't as promised.
from liveov7670.
Related Issues (20)
- WAVGAT boards support? HOT 2
- Energia CC1350 Version HOT 3
- Led and button HOT 6
- No issue: This is amazing.
- Problem with installing "ArduImageCapture" Plug-In HOT 5
- How can I make VSYNC pulse when I need to capture frame? HOT 1
- TFT image Mirrored. Please Help
- CameraOV7670.h: No such file or directory HOT 3
- I have issues getting it to output a clear image HOT 2
- Camera OV7670 on SAMD51
- Camera output turned red after showing image HOT 1
- Command checksum failed HOT 1
- How to use on LCD TFT 3,5" ILI9488
- Can't compile for Nano Every HOT 1
- ov7670 library HOT 1
- Is this code compatible with the TFT ST7735S Display?
- Pin Definitions, ESP32-Applicability and Image Classification
- green square and no Vsync no matter what I do HOT 3
- Cannot upload the code. Error: ".... was not declared in this scope"
- can't compile while trying to compile to arduino uno
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liveov7670.