Hi, all I am making a wind measurement and direction sensor using arduino UNO and serial jpeg camera, I tried to make the code but I am not able to do that so i want help in the code. The camera will capture image of a light pointing towards it and when will wind come the direction of the point will move so I want to calculate the pixel displacement that how many pixels have been displaced when there was no wind and when there was wind. I am using the default code of the camera and i want the piece of code which will do this work i want to show the result to the lcd and after that i will remove the lcd and have to display the result to labview via Xbe. I just have 4 days left you guys please help me i am struck very badly.
and serial jpeg camera
The clue here is in the jpeg bit.
The arduino has not got enough memory to decode a jpeg image, so you are never going to be able to get at any of the pixels. The best you can do is to ship the image to some other place.
Then what can i do where can i ship the image?
To a PC.
But why are you using a camera to detect wind speed???
Than please tell me that how to send images to labview which the camera is capturing automatically
I want the project to be automatic how the files can be directly transfered to the labview
talhazaki:
I want the project to be automatic how the files can be directly transfered to the labview
How ever you want, serial is the simplest over USB. It will take 15 to 20 seconds to transfer depending on the image size.
Let me ask again.
Why are you using camera to detect wind speed and/or direction? There devices that are designed specifically for this purpose and are much better at it.
Can u please let me knaow the devices that are better than it? I am recommended to use a camera
talhazaki:
Can u please let me knaow the devices that are better than it? I am recommended to use a camera
No Arduino with the exception of perhaps a Yun can do this.
The simplest way to do this is with a Raspberry Pi and a web cam, but you have left it a bit late for this.
Well, this for example.
Shpaget:
Well, this for example.
Anemometer Wind Speed Sensor w/Analog Voltage Output : ID 1733 : Adafruit Industries, Unique & fun DIY electronics and kits
Doesn't tell you anything about direction.
Of course.
An absolute rotary encoder would fill that gap.
talhazaki:
Can u please let me knaow the devices that are better than it? I am recommended to use a camera
Yeah - but were you recommended to use a serial JPEG camera (coupled to an Arduino)? If you were, then whoever told you this knew less than you.
Now - I can imagine a scenario which could -possibly- work with an Arduino, using a camera - to tell wind speed and direction. But it wouldn't be easy to implement:
-
First off the camera would need to be a standard composite output camera, ideally with no IR filter.
-
Solder some thin gauge insulated wires to an IR LED; drill a hole through a ping-pong ball, and thread the wire through the ball, leaving the LED sticking out so that it points down, and the wire extends upward - like a pendulum. You might want to add a small amount of weight to the ping-pong ball by using clay or something similar (the amount will need to be experimented with).
-
Build a structure such that the ping-pong ball and LED can be hung from. Make sure that the supports are narrow enough to not deflect much wind - a tripod-type structure made from stiff piano wire (or something similar) would likely be best. It needs to allow the wind to pass on all sides, and can be anchored so that the wind doesn't carry it away.
-
Now, when the wind blows, the ping-pong ball should catch it, and deflect (swing) in the opposite direction of the wind, proportional to the force/speed of the wind. The LED will move by the same amount, since it is attached to the same.
Now - if you are with me so far - it should be obvious that if you were able to look up at the ping-pong ball from below this contraption, you would be able to see the LED move in a 2-axis manner, which would give you enough information to tell direction of the wind and speed from deflection. Again, you would need to experiment with the amount of weight on the ball so that it would move properly, yet return to vertical (or the center) when the wind died down. There's also the question of random movements and such that I won't address (suffice to say, though, that this whole thing I am describing will need some experimentation - and really might not work at all!).
- So - we need something to "look up" at the LED from the bottom. That is where the composite camera comes in! Mount one (sans the IR blocking filter that some cameras have) pointing up, so that the ping-pong ball (and IR LED) is in the center of the frame of the camera's view (use a TV or something to center it). Once that is done, add a IR pass filter (a piece of exposed and developed 35 mm film can work perfectly for this - just a piece of the leader of the film from a developed roll will be OK) over the camera lens to cut out any ambient light; we only want to see IR on the camera.
Now - when the IR LED is turned on, it should appear somewhat in the center of the camera's view (on a TV) - a somewhat bright white "dot" in the middle of a mostly dark (or completely black) frame/image. That dot's movement is what needs to be detected.
Enter in an IC called the LM1881 Video Sync Separator:
It's a very simple chip that can be used - in combination with our composite camera - to know where and when the sync timing signals occur from the camera's output, and from that be able to tell the position of the output from the camera when we see a signal from the camera - which mostly will be black - with one bright "blip" on it. Such a system we know already will work with an Arduino - because it exists as a shield:
Now - in theory you might be able to use the above shield to do what I am about to discuss, but it might be better not to; it's likely as not you would need to modify the shield anyhow (but maybe not...).
What you will be doing is looking (in the code) for that point of light, to be able to calculate it's deflection from the center of the image (which if you pretend is 0,0 on the Cartesian coordinate system, using some offsets and some simple trig you can figure out the angle and the distance from the center). Another article which might be helpful, that uses the same LM1881 (in this case, for a laser distance sensor):
http://www.seattlerobotics.org/encoder/200110/vision.htm
Something to keep in mind is that the faster you can run your code, the greater the resolution you'll be able to discern; the Video Experimenter board uses a modified version of the TVOut library - as such, it is designed to put it's data from the camera into a memory buffer stored in SRAM, where it can then be operated on as a whole. For your purposes, this is both unnecessary and too slow. Instead, you will simply want to use the system to note when you see the "blip" and where (X/Y) you saw it. So - while some of the code that the VE uses will be useful (and you'll need a good understanding of how it works as well) - most of it is superfluous to your needs. Also - you will likely want your code to be as tight and efficient as possible - again, speed means more resolution (heck, maybe you could re-clock your Arduino @ 20 MHz as well).
I won't go any further on the above idea - it is more to show you and give you an idea on what is possible using a camera as you have defined the problem. Honestly, I would have to side with others on this that there are other more standard ways to easily measure wind speed and direction that have nothing to do with a camera. Even with the constraint of no moving parts, I would be willing to bet that you could devise a method to measure wind speed and direction that didn't require the use of a camera. Your main limitation here - in regards to the use of a camera (whether it is the serial JPEG camera you already have, or some other camera) - is honestly the Arduino. It isn't the right platform for the purpose at hand, because of its limitations in speed and memory.
Or maybe you need to use a camera does not have a lot of pixel something like this https://www.tindie.com/products/AP_tech/tsl1401cl-linescan-camera-/?pt=directsearch