Lucid Dreaming Goggles

Lucid Dreaming can be summarized as being aware that you are in a dream – being aware of being in a reality of your own making means that you can control it.  Sort of.

 

Recently I needed some electronic parts for my other projects when I noticed the ATTiny85 processor.  To someone who is accustomed to using Arduinos, microprocessors like this are for the bare-bones people.  The number of pins are limited, and the power requirements differ from the typical Arduino Uno.  Sometimes, when you just want a couple of LEDs to blink, using a small limited chip like this makes sense in many ways(cost, size, power needs).

 

Using this post as basically instructions, I was able to craft a similar version w/o much trouble.  The real purpose is to familiarize myself with the process of preparing and using the ATTiny85.  But, it also happens that I had enough parts around to make this build.

Parts :

  1. goggles
  2. circuit bread board
  3. 2 LEDs
  4. ATTiny85
  5. IC socket(8 pin)
  6. CR2032 coin battery holder
  7. bunch of wires
  8. Arduino Uno
  9. Capacitor with >10uF(mine was 1000uF!)
  10. cardstock

Tools :

  1. Dremel
  2. scissors

Hardware

My girlfriend had gotten me a pair of steampunk-like goggles, the kind where the eye pieces are screwed on.  Unscrewing that, I removed the lens, this will be the template for the lens replacement as well as the circuit board

goggle lens and a circuit bread board
goggle lens and a circuit bread board

Tracing the lens on the board gives us the area to work with;

lens replacement - traced an outline on the circuit
lens replacement – traced an outline on the circuit

the main components are IC socket(for the ATTiny85) and the coin cell battery holder.  Tried to utilize the real estate, as cutting this with the dremel tool would be time consuming.

test fitting the parts
test fitting the parts

Also used the goggle cover to make sure the components don’t fall under the lip of the goggle cover.

I decided to not use the entire circle when cutting; to prevent waste and I figured I may need some wiggle room for the LED.

maximizing the real estate, also making it easier to cut using a dremel
maximizing the real estate, also making it easier to cut using a dremel

As predicted, cutting this was a bit time consuming

cutting complete
cutting complete

…and damaging to the cutting wheel.

cutting this chipped the cutting wheel badly.
cutting this chipped the cutting wheel badly.

Yikes.

The battery holder and the IC socket holder are soldered to the board

battery holder and IC socket soldered
battery holder and IC socket soldered

I soldered the +/- pins of the battery to the IC socket (refer to the diagram to see where the power wires need to go on the ATTiny85)

soldered power between battery holder and IC socket
soldered power between battery holder and IC socket

The first LED is added facing away from the components on the circuit board.

soldered LED 1
soldered LED 1

Of course, now we’ll need to create a lens replacement to hold the LED/circuit board in place.  Enter cardstock.

card stock + goggle lens
card stock + goggle lens
fold once
fold once
fold twice
fold twice
trace lens
trace lens
4 lens replacements
4 lens replacements

Poke a hole(center) and poke the LED through.  The hole should hold the LED in place.  Test fit in the goggle.

cardstock lens on top of the circuit board
cardstock lens on top of the circuit board

Excellent, now for LED 2.

LED 2
LED 2
added extensions to LED 2
added extensions to LED 2
marking ground wire on LED2 with duct tape
marking ground wire on LED2 with electric tape

add extension wires as necessary and solder them to the circuit board(LEDs are to be synced so ground wires and positive wires go together)
I made a mistake here, I soldered the wires to the battery directly!  This means the LEDs will light up as soon as the battery is inserted

Oops, wired LEDs' positive leads to battery
Oops, wired LEDs’ positive leads to battery

Now this is the correct way – the Arduino sketch from this article uses pin 2.  Note, pin 2 refers to the pin labeled pin 2 and is under the VCC pin on the ATTiny85 chip!

wired LEDs' positive leads to pin 2
wired LEDs’ positive leads to pin 2

assemble the goggle together carefully and it should look like the following:

finished(outside)
finished(outside)
finished(inside)
finished(inside)

Software

The software can be found from this article and the following is noteworthy :

  1. Make sure the ATTiny Core is installed in your Arudino 1.0 IDE!
  2. If using the Arduino Uno as an ISP programmer, you will need to put a 10uF cap across RST and GND.  I had a 1000uF cap that I used and it worked fine.  Since the purpose of the cap is to absorb the signal from RST to gnd(which would reset the arduino and prevent it from working like an ISP), 1000uF seemed to do the job!
  3. I ran into some issues using Arduino as ISP.  The way it worked for me was:
    1. Wire up the Arduino Uno and the ATTiny85 as instructed in this article.
    2. Remove the capacitor from RST+GND
    3. File->Example->ArduinoISP
    4. Tools->Board->Arduino Uno
    5. Tools->Serial Port->select the port where your Arudino Uno is connected to
    6. Upload (should get no errors)
    7. Add the capacitor to RST+GND
    8. Tools->Board->Attiny85(8mhz Internal clock)
    9. Tools->Burn Bootloader (should get no errors)
    10. Load the script from this article
    11. Tools->Programmer->Arduino as ISP
    12. Upload (should get no errors – but the following warnings are okay)
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85

Insert the IC to the socket and the battery to the coin holder and dream away!

 

Note : I didn’t have any tiny switches, this will be updated when I find some.  For now, the device works when the battery is inserted with no way of shutting it off unless the battery is removed or depleted! 😛

Leave a Reply