ov7670-no-ram-arduino-uno
ov7670-no-ram-arduino-uno copied to clipboard
Request
can you upload a single sketch file for arduino... Or please tell me how to run the code...
To compile and upload this to your arduino uno run
make writeflash
To compile without uploading run
make
Note that this should work on other atmega328 based development boards or on a breadboard, but you may need to modify the makefile.
It looks like an extension to some code that I wrote. I would assume it works. My concern about the code is what has been added.
They are sending pixels in an extremely nonoptimal way. It is better to simply send binary data then it is to convert it to text. Text conversion is slow and unnecessary. You will end up transferring up to four times as much data as text than you would sending the data as is. It also takes CPU time to do the conversion which means an even slower framerate.
I have already done so much. To put this issue bluntly: I lack the motivation for some of these tasks. Others on the message board have made schematics and all you need to do is copy and paste the code into the Arduino IDE and rename a few functions. You will need to add WIFI support.
Use google. I do not use the Arduino IDE. Add some code to blink the led to tell if it uploaded. Also if you want to use my frame grabber on windows you will need port it.
I think the issue lies in the fact that you are not grasping the fact that I have code that is working and can be easily compiled. Just run
make writeflash
and the program will be compiled and uploaded to your board. No need to mess with the Arduino IDE.
Thanks for all the help, I want to make it work in ardiuno IDE because this is just one module of my project. I have to integrate some other hardware as well. So, what I did is I changed the main.c file to "sketch-name".ino and copied the code of ov7670.c to it. It compiled successfully. Then I did all the connection like you said in your readme file and after uploading code when I opened serial monitor nothing is displayed.
Please do not blindly copy code without understanding what it does. While I appreciate your politeness I understand that the end goal is to get me to do a larger proportion of your project for you.
My code does not send text (doing so is inefficient) and it does not use a baud rate that is supported by the serial monitor. Of course you will not see anything. You will need to come up with a program to capture the pixel data. My program can still function as a base see https://github.com/ComputerNerd/simpleFrameGrabber.
Dude, I am not trying to make you do anything extra. I just want you to give me a little support about the code you have already developed. I never asked you to do anything. I always only wanted your support. Thanks
Support is something extra. Also you deleted most of your comments most likely in hopes to make your comment appear true when it is not. Please do not do that. Fortunately Github emails me whenever you posted a comment so it turns out that deleting the comments did not accomplish much.
That problem is I do not understand why you need support. I have already told you what you need to do.
Also for everyone's reference here is the deleted comments. The more recent comments are at the bottom of this post.
Edit: removed long code
Sir, I want to capture image from my OV7670(w/o FIFO) and send it to my PC via Wi-Fi(ESP8266)(Which I know How to use) using Arduino Uno. I have read so many blogs and threads on internet but couldn't find simple and exact solution for the problem. I am a newbie in this and all I want is the simple wiring schema, code that can be used with Arduino IDE and the direction on how to proceed. Thanks
Hello, I am really thankful to you for doing this. I understand that you can not provide me with the kind of information I asking. Just clear few doubts, 1- Now this happened accidentally I was trying something else. As I told you before I want to make it work in arduino IDE in my windows. So what I did is I created an empty sketch and just copied all your files with main.c, ov7670.h and everything. Then when I opened the sketch in arduino IDE all those files get automatically opened in the IDE and when I compiled it compiles successfully then I uploaded to my arduino uno and it was successful. so, tell me is anything uploaded on my arduino or nothing is uploaded because my .ino file is empty.? 2- I made the connection according to the readme file, and when I opened serial monitor it shows nothing, i tried with all the baud rate. I don't know of it's suppose to happen or what. 3- Please tell me how to save this Image or how is it sent to my PC and how do I recieve it in my PC? I looked at your code simple grabber but it's for linux and I couldn't understand anything. please tell me another way to get the Image.
See I have used google enough and only answer I have got it your github repository or that it's not possible. Since you have done it only using arduino uno and OV7670(w/o FIFO) I want to just know exactly how to do it. please help
Also I just noticed you had an arduino.stackexchange.com question. It provided more information that let me provide an answer that may advance your progress in getting this to work see http://arduino.stackexchange.com/questions/10170/how-to-use-code-for-ov7670-in-arduino-uno/10194#10194.
Sir, You are probably elder than me and I never wanted to disrespect you and I actually never did. I can go on and on about what you said and then what I said but I think that's not necessary. I am sorry if you feel disrespected anyway possible, that is certainly not my intention. Clearing the air about why I deleted my comments, I only deleted those comments just to shorten this big unnecessary conversation and because of the long code I posted. I never wanted accomplish anything with deleting the comments and If you want to keep it that's completely fine by me. The problem with my project is that getting this camera to work is not my ultimate goal. I have to get this camera work and then integrate with other hardware in my project that's why even if I get it working in linux it still won't help my project. So, I need to get this code to work in Arduino IDE on windows platform. And let me tell you that in my project I have to use OV7670 camera as a image capturing device and I need to get that image on my Matlab code via Wi-Fi for image processing and then display the result on LCD interfaced with my board. I still am genuinely thankful for your code.
I worried about offending you as well. I can get harsh when I suspect that I am doing lots of work for someone without the favor ever returned.
Also thank you for providing me with more details on your project I have four words for you that may make your life easier:
Get a webcam.
You are sending this to your PC anyway so why not just skip the trouble and purchase a webcam. You can buy them on Ebay for less than $5.00 with shipping included (a price comparable to the ov7670). The quality can be improved by putting a better lens on the webcam.
The reason I did all this work for the OV7670 is because I wanted a standalone system that could be used for a low power dedicated time lapse machine as an example. I also wanted to experiment with Raw Bayer data and I need more control over the image sensor. Do you need any of this? If not get a webcam.
The reason these capture programs to the PC exist is primarily for testing purposes and any needed lens calibration.
How about this. Try and tell me why you think you need the OV7670.
Hello, Thanks for helping me. Using Webcam is my "Plan B" as using it would make my device wired and the device I want to make is wireless and buying a wireless camera which can connect to the internet would not be cheap. That's why I want to connect OV7670 to arduino to send images over Wi-Fi to my PC for image processing. Although now this is getting too complicated and I do not have much time and I think even If I get OV7670 camera to work the image quality will be very poor for image processing. So, I think I should go for webcam. let me know if you have another solution. Thanks for all the help.
Hello, Thank you for this program, I am able to compile it on my Arduino Uno, but the hard part is to capture the pixel data. Could you give me the instructions to do so with your program: simpleFrameGrabber ?
Respectfully
@arpit-reddfox You can have a digital wireless camera. There is no reason why a webcam will force you to use wires. You could get a low cost single board computer such as a raspberry pi and use the raspberry pi camera or plug in a webcam to it's USB port(s). @Mr-Julien it is just a matter of reading the serial data. Nothing complicated.
hi ComputerNerd,
i have been trying to get my ov7670 working with my arduino uno. I have been following your posts on the arduino forum extensively, and me being a noob am still very confused about a lot of things. anyway, ive decided to deal with my issues one by one. So for starters, im used to compiling and uploading code from the arduino IDE, so im unable to understand how to run the code that you have given. i have followed all the circuit connections as described by you ( including the pull up resistors & voltage regulator ) but am unable to understand how to upload the code onto the board! i do realize that you have explained how to do the same earlier in this post, but, if im supposed to type make writeflash then where exactly am i supposed to write it? im using a mac by the way.
also, once the code does upload, what am i supposed to look out for? will successful compilation of the code initate an applet on my screen within which i would be able to see my camera feed?
please could you help sort out this confusion of mine! it would be of great help!
thanks!
Hi, I have successfully compiled the project in arduino IDE, simply concatenated main.c and ov7670.c ov7670.h into .ino file
didn't test it with the camera yet, but it uploaded to my arduino (Duemilanove) Tell me if it worked for you...
see here: https://github.com/eranws/ov7670-no-ram-arduino-uno
Dear "ComputerNerd", thank you very much for sharing your work with us. I think there are a lot of people trying to get work the ov7670 and the documentation about it very good (check datasheet), but people expect to find already existing code which will take a picture with just calling a function like takeApictureForMe(). That is the problem with most of the people who work with Arduino, they have libraries for everything.
Your code works, of course, and is compatible with a lot of microcontrollers, not just the Arduino's Atmega328. I am amazed that ONLY the user "eranws" was able to copy paste your work into an Arduino project AND compile it successfully (and actually it work). What could possibly go wrong if you copy-paste? I don't get it.
Dear eranws, Your code works, indeed. Thank you for "converting" it into .ino project so that every Arduino "programmer" could use it. The next step would be converting the received data.
I suggest everyone to take a look at the datasheet of the module, because otherwise even if you get it work, some day it could (it will) stop and you won't know why because you won't be able to debug.
I have gotten a bit behind on issues so I will respond to them in reverse chronological order.
@TodorGinchev Yes I understand your point and my program comes close to that. I already have a takeApictureForMe() function called captureImg(). However before using it all you need to do is initialize the camera by calling camInit() and then set the resolution by using the setRes() function and set the pixel format using setColorSpace(). Then you can use the captureImg() function and it will send pixel data over UART.
I would not be surprised if more people had success creating an INO; it is just that he posted about it. You are right not much can go wrong when copying and pasting.
@eranws Tell me if it works. I will be interested to find out.
@silvergravel I am confused by your post just as your are confused about mine. There is no way an applet will magically appear. You can use my frame grabber to capture an image https://github.com/ComputerNerd/simpleFrameGrabber
To know that the code is working watch the TX LED light if it blinks/stays on it is working. If the LED on pin 13 is blinking it is not working.
@ComputerNerd - I am a beginner to using I2C, and I found the LED 13 blinking when I used your simpleFrameGrabber program. Could you tell me some possible reasons for this?
I really appreciate the help you are providing, and for spreading the joy of electronics! :)
thanks guys
@eranws thanks for compling the code in arduino IDE! i did manage to compile and upload computerNerd's code through the terminal though my project involves interfacing with a few other sensors etc, so your arduino version is going to be of huge help for that! still have to try the code though.
@ComputerNerd thanks for the reply! im going to go ahead and try to compile the frameGrabber code..
@silvergravel - tell me if simpleFrameGrabber works for you. For me it is showing a green pixelated image which does not correspond to anything in front of it.
@ComputerNerd - I got I2C working, but the problem of the green image is still there. Any suggestions?
Thanks.
Yes, you have 3 parameters if I am not wrong: baud rate, resolution and format. You have to match the parameters of the Arduino program with those of your FrameGrabber.
I had not time to try it, but I will. Hope it will work.
And BTW, it's not I2C, the data is sent via UART and the protocol that controls the camera is similar to I2C but it's not the same thing
@TodorGinchev - can you please suggest a ready made solution to grab and view the image generated on USART ?
@TodorGinchev - yes, you were right, I2C is not the same as SCCB, but for our purposes using this camera they can be considered the same, right? Anyway, I checked that the baudRate is 1M, the resolution is qQVGA. I still get extremely pixellated and noisy images. I really have no idea why it doesnt work. Any ideas?
@abbanerjeersm - I heard that the minicom monitor utility for Ubuntu is extremely useful for UART...but I dont know how to view images using this utility. Try it out, tell me how it goes.
@themathgeek13 : Unfortunately I use windows 7 - so installing linux seems to be a long way round. Lets see ...
A ready made solution is the frame grabber. If you need Linux, you can always use a virtual machine, that is what I do because I still need windows for my work and cannot fully migrate to Linux.
@themathgeek13 you at still missing the format, maybe that's your problem, you have raw, rgb565, etc
@TodorGinchev - thanks for the suggestion, but that was not it. I tried all three formats, and it didnt work. I am using a 20.025 MHz quartz crystal oscillator for the clock signal. Does it need to be less than the Arduino's 16MHz for it to work? Does the HREF pin need to be connected anywhere? I dont think so, but I cannot find any other problems...