Auto Eyes Demo

LED Light Strip Controlled by Python on Raspberry PI

Project Auto Eyes is about creating common communication protocols for common road scenarios, however, technology works better when demonstrated in the real world.

Follow this guide to build your own real world example and see Auto Eyes work with your own eyes.

What it Does

Point a mobile phone at an Actor and the lights on the LED strip follow the Actor giving the sense the Actor is being watched.

Video demo coming soon

Purchase

For approximately $150, you can set up this prototype, although the costs could be reduced by a knowledgeable person since this parts list caters to ease of setup.

Optional:

Assemble

  1. Setup the Raspberry PI with the included USB power supply, per the instructions that came with the kit.
    1. Install the Raspian Lite OS without the desktop environment.
  2. Shut the Raspberry PI down once you confirm it works (either by direct keyboard+monitor or ssh).
  3. Connect the LED Strip power wires to the female DC connector using a small screwdriver.
    1. Negative (-) connects to black.
    2. Positive (+) connects to red.
  4. Connect the LED 3pin JST-SM connector to the Raspberry PI GPIO connector with the jumper wires Connection Photo
    1. Use the 3 wire with a female JST-SM connector provided with the LED strip
    2. Choose a red, green and blue jumper wire from the jumper wires
    3. Cut and strip one end of each of the jumper wires
    4. Connect each jumper wire to the corresponding color of the 3 wire JST-SM connector
      1. Ideally solder each wire, but twist + tape will suffice.
    5. Connect each wire to the GPIO board
      1. Red (Power) -> Pin 2
      2. Black (Ground) -> Pin 6
      3. Green (Data) -> Pin 12 GPIO Diagram Source: CanaKit
  5. Plug the female DC connector to the male DC connector and plug power cord into the wall.
    1. Notice this powers both the LED strip and the Raspberry PI so do not use the USB power supply.
  6. Confirm the Raspberry PI is powered up and available.
  7. Continue with the software setup to confirm the light strip is working.

Software Setup

Test the Light Strip

Demonstrate the light strip works by running a quick test in python3.

python3 --version -> Python 3.5.3 (known to work)

Install PIP used to install python packages:

sudo apt-get install python3-pip

Install the light strip python3 driver:

sudo pip3 install rpi_ws281x

Download the test python

wget https://raw.githubusercontent.com/rpi-ws281x/rpi-ws281x-python/master/examples/strandtest.py

Run the test:

sudo python3 strandtest.py -c

Expected Results: You should see the first 16 LEDs cycle through Red, Green, Blue and some rainbow cycles.

Modify the test to illuminate all of your pixels.

nano strandtest.py

Change the LED Count on line 13:

LED_COUNT = 16 -> LED_COUNT = 144

Run the test again and you should see your entire strip light up.

Auto Eyes Setup

Change the hostname to autoeyes.

sudo raspi-config -> 2 -> N1 -> Ok -> autoeyes -> Ok then Finish and reboot

Confirm hostname changed and determine IP address.

ping autoeyes.local

Install git so you can download the source.

sudo apt-get install git

Clone the AutoEyes source code.

git clone https://github.com/aroller/autoeyes

Install package dependencies.

sudo python3 setup.py install

Run the API connecting to the LED strip.

cd ~/autoeyes/demo/python

sudo AV_EYES_LED_MODE=true python3 api.py

Confirm LED Strip shows splash sequence of two white lights looping around in opposite directions ending with 4 segments of different colors.

curl -X PUT "http://autoeyes.local:9090/v1.0/actors/abc123?bearing=5" -H "accept: application/json"

Confirm the first 5 LEDs are lit in white.

Get to Know the API

Visit the API in a web browser of a computer on the same network.

http://autoeyes.local:9090/v1.0/ui/

Use the web api user interface to PUT various combinations of bearing, action, direction, urgency. You should see the LED lights change accordingly.

Run the Compass Client

View the compass UI in a web browser on a computer.

http://autoeyes.local:9090/client/compass.html

In a mobile web browser you may need to access by ip address.

http://{autoeyes.local ip address}/client/compass.html

Demo

Auto Eyes scenario demos To Be Determined.