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.
- circuit bread board
- 2 LEDs
- IC socket(8 pin)
- CR2032 coin battery holder
- bunch of wires
- Arduino Uno
- Capacitor with >10uF(mine was 1000uF!)
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
Tracing the lens on the board gives us the area to work with;
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.
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.
As predicted, cutting this was a bit time consuming
…and damaging to the cutting wheel.
The battery holder and the IC socket holder are soldered to the board
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)
The first LED is added facing away from the components on the circuit board.
Of course, now we’ll need to create a lens replacement to hold the LED/circuit board in place. Enter cardstock.
Poke a hole(center) and poke the LED through. The hole should hold the LED in place. Test fit in the goggle.
Excellent, now for LED 2.
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
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!
assemble the goggle together carefully and it should look like the following:
The software can be found from this article and the following is noteworthy :
- Make sure the ATTiny Core is installed in your Arudino 1.0 IDE!
- 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!
- I ran into some issues using Arduino as ISP. The way it worked for me was:
- Wire up the Arduino Uno and the ATTiny85 as instructed in this article.
- Remove the capacitor from RST+GND
- Tools->Board->Arduino Uno
- Tools->Serial Port->select the port where your Arudino Uno is connected to
- Upload (should get no errors)
- Add the capacitor to RST+GND
- Tools->Board->Attiny85(8mhz Internal clock)
- Tools->Burn Bootloader (should get no errors)
- Load the script from this article
- Tools->Programmer->Arduino as ISP
- 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! 😛