Alexa Eyes

I saw the excellent “Uncanny Eyes” project on the Adafruit website a while ago and came up with the idea to add these eyes to my 2nd Generation Echo Dot Alexa device. 

This ‘eye module’ simply sits right on top of – and doesn’t require any modifications to – the Echo Dot.

The main case parts are designed in Fusion 360 and are 3D printed using my Creality CR-10S printer using white PLA. I put the stl and step files on Thingiverse. There is a top case part that houses the electronics, a cover for the bottom of the top part where the photoresistor is mounted, and a base ring to fit around the Echo Dot.

There’s also a piece of plexiglass for the light ring designed to fit in the middle – it was cut out using my CNC machine.  The plexiglass ring could also be cut using a scroll saw or laser cutter, or possibly it may be able to be 3D printed using clear plastic, but I have a CNC machine so that’s what I used.  The edges of the plexiglass ring were sanded with 220 grit sandpaper to make them diffuse the light better. The 3D printed base puts the Echo Dot’s light ring just at the right height to let the light diffuse through the plexiglass ring.

The base is also a bit shorter than the height of the Echo Dot so there’s a gap of about 2mm at the bottom of the assembly when the unit is placed onto the Dot. This allows the sound of the bottom-firing speaker of the Dot to escape without sounding muffled. The microphones of the Echo Dot work just fine with the eyes sitting on top – the density of the plastic doesn’t seem to affect the voice recognition operation at all. The eye module parts are all screwed together with four 3/4 inch long screws in the recessed holes.

The electronics are two SSD1351 OLED displays, a Teensy 3.2, a photoresistor, and a 10K ohm resistor. The displays are connected similarly to the Adafruit project website instructions, but the photoresistor and resistor were added to the circuit to sense when the Echo Dot’s LED ring lights up. The photoresistor is glued into a recess in the lid so it detects when the light ring is illuminated. This way, the software can make the eyes turn on for 15 seconds following an Alexa wake event and then automatically turn off. This is important because OLED displays like those used only have a finite lifetime of a couple thousand hours before they start to lose brightness, so you don’t want to leave them running continuously with the OLEDs on.

The eye holes of the case are sized to fit 30mm cabochons very snugly. The cabochons are like little glass lenses – they are frequently used for jewelry or other craft projects. I added a bit of epoxy around the rim of the cabochons on the inside of the case but it was probably unnecessary since they fit in the holes so tightly. After the cabochons are in place, the OLED displays are inserted and held into their openings with a few dabs of hot glue. The Teensy 3.2 is soldered to a small piece of perfboard and the corners of the perfboard are screwed to the top part with some #2 screws. There’s a hole in the back of the case to connect a USB cable to the Teensy – this powers the whole eye circuit.  I have a USB power outlet with 4 ports where I keep my Echo Dot in the kitchen – it neatly powers both the Echo Dot and the Teensy using short USB cords.

The photoresistor and resistor are wired as a voltage divider which feeds into an analog input port of the Teensy. A continuous rolling average of 50 samples are taken to determine a baseline light measurement and if the LED ring turns on the eye displays are enabled for 15 seconds. The rolling average method of detecting when the light ring turns on is nice because the ambient light in my kitchen can vary – so the software continuously adapts to the current background light environment and reliably detects when the Echo Dot light ring illuminates.

To complicate things a bit, the Echo Dot LED ring also will flash at about a 1/4 Hz rate when a “notification” is received – notifications can be messages from Amazon, shipment status updates, and other things. This flashing would continuously retrigger the eyes to be on until the notification is cleared, which I don’t want because of the OLED life considerations discussed above. While notifications can be turned off entirely in the settings of the Alexa app, I designed the software to recognize when the LED ring is blinking and blank the displays after the same 15 second timeout if this occurs. The state machine diagram shows how all this is detected and mechanized.

I modified and reconfigured the Uncanny Eyes software from the Adafruit website to remove all the conditional compilation ‘#ifdefs’ and strip it down to just the hardware that I was actually using (the Teensy 3.2 and two SSD1351 OLED displays). This made it much easier to add my photoresistor and state machine logic to enable and disable the displays. The disabling of the displays is really just a modification to the “both eyes blink” function that’s built into the code – but instead of blinking when digital I/O pin 1 is grounded, the eyes go into the blink state when the state machine says to ‘blank’ the displays – this effectively turns off all the OLEDs in the display.  You can download my modified software from this link.

Update: this project was featured on Hackaday

 

Comments are closed.