Diy optical flow sensor

Thread Starter

ddc

Joined May 7, 2025
10
Hi Everyone,

I want to make a optical flow sensor similar to adns3080 for drone project.

My plan is to take a normal mouse sensor,remove the default lens and change it with the ov7670 camera lens.

Can anybody let me know if this is possible?

Thanks
 

Ya’akov

Joined Jan 27, 2019
10,300
Welcome to AAC.

There is no reason why, in principle, this is not possible, Whether it is practical of not is a different question.

In commercial optical flow sensors targeting small UAVs, the output is just a simple XY displacement. This makes the flight controllers job of correlating the optical flow with altitude and position information much easier.

While your approach seems doable, it will require replacing the dedicated conversion hardware in the optical flow sensor with flight controller CPU—and I am not sure that is practical.

The actual sensor is only part of the system in the sort of optical flow sensor used in a sUASs, and if it was practical to use software to replace the extra hardware that would seem to be a cost savings manufacturers would jump on.

Some mouse sensors offer the three critical signals separately—ΔX, ΔY, and image quality—but while that reduces computational cost over the type that expose only raw pixel data it will still requite extensive integration of the IMU data to account for apparent motion caused by aircraft roll, pitch, and yaw—something a mouse doesn't deal with.

One possible strategy would be to front-end the sensor with a small FPGA to do the heavy lifting for the MCU in the FC. The result would be nicely cooked data for the FC to consume and a greatly reduced CPU utilization which I surmise will be the biggest challenge.

N.B.: The foregoing is speculative. I have not tried to do this myself, and I could be wrong, so free advice is like all ofter free things—you tend to get what you pay for.
 

MisterBill2

Joined Jan 23, 2018
28,302
EXcuse me, please, for not understanding what part of drone operation requires a flow sensor? I find that a real puzzle. So also asking what property of whatever is flowing would the flow sensor detect and measure?
I have used in the past, pressure-differential across orifice flow sensors, and turbine with optical sensor flow sensor systems that were quite accurate. All of them were both fairly heavy and consumed power such that they would not be suitable for a small drone.
 

ronsimpson

Joined Oct 7, 2019
4,812
what part of drone operation requires a flow sensor?
I do not know but the word "flow" in the dictionary might be used as movement. He might be looking for a way to know how fast the drone is moving and what distance. If this is true, the mouse is a good idea. I have used this idea to track movement in a two-dementia world. I do not know if it will work in a 3-D world of a drone. Some of the mice ICs have a mode where you can see what the "camera" is seeing. The resolution is very low. Years ago, I had some data from HP engineers on this subject that they probably did not want out.
 

MisterBill2

Joined Jan 23, 2018
28,302
OK, afterdoing a search for that part number (adns3080) I see my error. Quite an incorrect understanding on my part!
In my career a "flow sensor" meant a flowmeter with an electrical output. A "flowmeter"actually. The item listed is more specificly a relative motion sensor, which is a much more descriptive term, as well as being accurate. Of course we also had actual pipeline FLOW SENSORs that simply sensed a liquid flow thru a check valve arrangement. They were much cheaper than flowMETERS, and easier to implement.
 
Last edited:

atferrari

Joined Jan 6, 2004
5,029
I do not know but the word "flow" in the dictionary might be used as movement. He might be looking for a way to know how fast the drone is moving and what distance. If this is true, the mouse is a good idea. I have used this idea to track movement in a two-dementia world. I do not know if it will work in a 3-D world of a drone. Some of the mice ICs have a mode where you can see what the "camera" is seeing. The resolution is very low. Years ago, I had some data from HP engineers on this subject that they probably did not want out.
I recall programming a PIC to use one of those chips, very old by now; pretty sure mine ended in an 8. Finding the datasheet online was a nightmare. It processed all those image frames internally, so it just spat out the final (x, y) offset.
 

MisterBill2

Joined Jan 23, 2018
28,302
What it seems that the TS is seeking is a device to sense the relative motion between the drone and the ground. The sensitivity and resolution required will depend on the intended use of the sensor signal. It may be that a simple device could be adequate, or it may be that an actual video camera will be needed.
So we need more information from the Thread Starter, so that we can avoid guessing. Simple Doppler Radar should work quite well.
 
Last edited:

Ya’akov

Joined Jan 27, 2019
10,300
What it seems that the TS is seeking is a device to sense the relative motion between the drone and the ground. The sensitivity and resolution required will depend on the intended use of the sensor signal. It may be that a simple device could be adequate, or it may be that an actual video camera will be needed.
So we need more information from the Thread Starter, so that we can avoid guessing.
Optical Flow is a term of art and extremely unambiguous. It specifically refers the the kind of sensor (system) that uses optically detected changes in a surface to determine horizontal motion.

In sUAS (Small Unmanned Aircraft Systems, "drones") Optical Flow is used to estimate horizontal motion by capturing frames of the ground texture and comparing them frame-to-frame. This is very important indoors or where there may be a poor satnav fix. It's a reason why flying a drone over water is risky since it can often lack useful texture confusing the flight controller.

In principle, the TS' proposal is sound but the challenges I outlined in my post are definite roadblocks that will have to be overcome. In the end, just buying a purpose built OF sensors is probably more practical.
 

MisterBill2

Joined Jan 23, 2018
28,302
OK, "flow of the ground image" is what the TS is seeking to know! THAT is very different. Some drones have a video link that can provide useful information about that. But not the less expensive ones. Knowing actual ground-speed of a drone can also be achieved from good, high resolution, GPS data and quite a bit of software. Adding that feature may not be a simple task.
 
Top