Rogers postbag

Tell us about the cool things you've recently got
User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Rogers postbag

Post by RogerClark » Tue Jul 04, 2017 9:10 pm

I don't know whether the code on that site is every worth having.

I suspect all it does is spit out the movement via the Serial port, which is probably trivial to write.

I had a quick look at the bin file, retrieved from the STM32, but I could not see any useful strings of text, that would indicate it was parsing for commands via the Serial input

I will hook it up to a USB to Serial converter and see what it spits out via Serial

I presume as this module is designed to be used by drones, that it's output data is documented somewhere, but I did not come across a definitive reference when I did some cursory research into this variant of the sensor

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Rogers postbag

Post by RogerClark » Tue Jul 04, 2017 10:12 pm

Well... I connected a USB to Serial to the TX and RX lines and it does not give any output at all

I've no idea what baud rate it is supposed to run at, but I would expect something, even if it was jibberish

I tried sending a few random chars to the module via Serial, but I didnt get any response.

I'll see if I can track down any docs

Edit.

I found this

https://tw.bid.yahoo.com/item/CJMCU-308 ... 0294500459
Communication: serial TTL to USB interface output computer. Mobile sensor, can directly read the data, can also take any microcontroller to read data.

Module power supply: 3-5V

After connecting, open the serial assistant, set the serial transmission rate of 115200, can be
To obtain information on the X and Y travel distances.
The format of a frame is as follows:
Byte1 X's upper 8 bits
Byte2 the lower 8 bits of X
Byte3 Y's upper 8 bits
Byte4 Y's lower 8 bits
Byte5 end bit 0x53
Byte6 end bit 0x53


Where X and Y are signed 16-bit numbers.
Unfortunately mine is not outputting anything.

There is code in the STM32, perhaps its broken :-(

I think I'll need to try putting some code in the STM32 and do it myself, as its not exactly complicated what its doing what its supposed to be doing

Edit 2

I found the same information on CJMCU's website (in Chinese), there is a PDF but its too big to upload, and it doesnt give any additional informtion

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Rogers postbag

Post by RogerClark » Tue Jul 04, 2017 10:34 pm

Just a quick update.

It does work, but it only sends data when there is a change in position, and my lens was not focussed.

Actually, I think lens focusing could be a problem, as there is no way to tell if its in focus.

However I recall that some of these optical sensors (not sure about the A3080) have a way to read the raw camera image data (even though its only a very small picture)

So perhaps that would be a useful enhancement if the sensor has that feature

Edit. Looks like its possible

https://www.bidouille.org/hack/mousecam

User avatar
zoomx
Posts: 523
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: Rogers postbag

Post by zoomx » Wed Jul 05, 2017 7:35 am

Your hypotheses are all right. This sensor in your configuration output the movements in X and Y direction, quad-copters uses these information to stay stationary when near the ground. But I remember that is a work done by the sensor, so the STM32 maybe use a filter.
You can get the small 30x30 image too, it is what I do with my sensor. I believe that you can find the points to connect directly to the sensor.

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Rogers postbag

Post by RogerClark » Wed Jul 05, 2017 11:22 am

zoomx wrote:
Wed Jul 05, 2017 7:35 am
Your hypotheses are all right. This sensor in your configuration output the movements in X and Y direction, quad-copters uses these information to stay stationary when near the ground. But I remember that is a work done by the sensor, so the STM32 maybe use a filter.
You can get the small 30x30 image too, it is what I do with my sensor. I believe that you can find the points to connect directly to the sensor.
I'll look at the PCB and see which pins are connected to the sensor

As its SPI, I suspect it will use the normal pins for SPI1, and the only additional pins are the GPIO for the CS and NRST etc

So it should be easy to figure out and then find some code to communicate with the sensor

stevestrong
Posts: 1735
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Rogers postbag

Post by stevestrong » Wed Jul 05, 2017 11:59 am

RogerClark wrote:
Wed Jul 05, 2017 11:22 am
As its SPI, I suspect it will use the normal pins for SPI1, and the only additional pins are the GPIO for the CS and NRST etc
So it should be easy to figure out and then find some code to communicate with the sensor
I used the blue pill (in SPI slave mode) once for sniffing the SPI traffic between a CPU and nRF905 chip on a remote controller. This way I could find out the used radio address which is normally hardware software coded in the master CPU. ;)

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Rogers postbag

Post by RogerClark » Wed Jul 05, 2017 9:26 pm

That's a good idea.

But I also have a logic analyser and the PC software will decide the SPI traffic.

I could also disassemble the binary of the firmware from inside the MCU, but I think there is probably Arduino source code to setup and read this sensor, so I should also look for that

User avatar
zoomx
Posts: 523
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: Rogers postbag

Post by zoomx » Thu Jul 06, 2017 6:06 am

There are libraries for the ADNS3080, I used this one
https://github.com/Neumi/OpticalFlowA30 ... Processing
that has a processing visualizer but there are others like
https://github.com/Lauszus/ADNS3080
https://github.com/shimniok/ADNS3080

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Rogers postbag

Post by RogerClark » Thu Jul 06, 2017 7:02 am

Thanks

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

5V 1W solar panel

Post by RogerClark » Thu Nov 09, 2017 10:45 am

I bought 3 of these to try from a eBay vendor, at $1.60 AUD (about $1.20 USD) each
P1060368.JPG
P1060368.JPG (71.62 KiB) Viewed 23 times
They were surprisingly good. Almost 1W at 5V (well more like 0.8W but its hard to an exact figure of the maximum obtainable power)

I've done a blog post with full details

http://www.rogerclark.net/cheap-5v-1w-solar-panel/

Post Reply