Embedded Eye

Give your gizmo the gift of sight

ArduEye Aphid Initial Tutorial (Part 2): Sample Firmware Shipped with Sensor

Note: It is recommended that you look through the "Getting Started Guide" on the ArduEye site (www.ardueye.com). In particular, look through the sections on installing the software to install the Arduino IDE and ArduEye libraries. You should also be familiar on how to use the Arduino IDE- excellent tutorials may be found on the Arduino site.


The ArduEye Aphid ships with a basic firmware already programmed. The Arduino source code for this firmware may be found here: ArduEye_AphidExample_v1.ino

This Arduino sketch includes examples of how to use the Serial interface to receive commands, as well as acquire imagery from the Stonyman chip and perform some elementary optical flow processing. This sketch also includes an example of how to prepare data for sending via the I2C interface. We will go over the latter in a later tutorial. The sketch will not work with the ArduEye GUI- we will go over that as well in another tutorial. For now we are just going to get started.

Step 1: Plug the ArduEye into the Sparkfun 5V FTDI breakout as shown in Part 1 of this tutorial and then plug that into your computer via the USB cable.

Step 2: Open the Arduino IDE. Connect the Arduino IDE to the proper serial COM port, and then start the serial terminal. You should see something like this below:

(I will send a free Aphid to the first person who can guess what city or town the wallpaper background was taken- if you are in a location we ship to.)

Note four items in the Serial terminal window. The command input box is where you enter text to send to the ArduEye. Once you have entered text, you press the "send" button to send it. Anything generate by the ArduEye will get sent to the Serial Output window. Finally, and most important, note the Baud Rate Selection drop down menu. This needs to show 115200 baud, the default baud rate we use for ArduEyes. If another value is shown, use the pull down menu to select 115200 baud, then close and reopen the Serial terminal window.

Step 3: In the command input box, type a question mark e.g. "?" (without the quotes) and then press the send button. You will see something like the picture below. This is a simple dump of commands available.

Step 4: Hold the ArduEye so that the camera side is pointing at a blank texture, such as a white sheet of paper, as shown below. Enter "f" in the command window (without quotes) and press the send button. After a couple seconds you will see the words "FPN Mask done" in the serial output window. What you just did was acquire a fixed pattern noise mask for the ArduEye and store it in EEPROM. Whenever you reset or power cycle the ArduEye, it will load up this mask.

Step 5: Displaying basic optical flow odometry:

Send the command "d1" to the ArduEye. You will see a string of numbers appear as shown below. This is simple optical flow odometry information. The first column shows vertical accumulated optical flow while the second column shows horizontal accumulated optical flow, e.g. X and Y respectively. If you move the sensor around you should see these values change drastically, especially if you are viewing stronger texture. If the sensor is still you may still see some drift especially if you are in a noisy environment or if you are viewing a blank environment. If you point the sensor at strong texture the drift should stop.

You can reset the accumulated optical flow to zero by sending the "r" command.

Wrapping Up:

This is it for Part 2 of the tutorial. In Part 3 (which I'll try to post tomorrow) and onward we will upload different firmware examples to the ArduEye Aphid to demonstrate different functions.

Views: 527

Reply to This

© 2017   Created by Geoffrey L. Barrows.   Powered by

Badges  |  Report an Issue  |  Terms of Service