Tuesday, May 28, 2013

Arduino Dice Box: Round One

I have not had much time to play recently. I was meaning to post this for some time now. I present the first iteration of my Arduino Dice Box. This project is a 5 way nav switch and a LCD display with I2C backpack that lets you roll virtual dice of various sizes and quantities. The program uses the random number function tied to an open pin to generate all the rolls. I have still not decided on a housing for this project and I am thinking of making another version that can use an 8x8 LED grid instead of a LCD display. So, lets get to it.

The Parts:
1 x Arduino Uno
1 x 5 Position switch (
1 x LCD 16x2 display (
1 x i2c / SPI character LCD backpack (

The Buildout:
The switch is wired up to pins 2-6. The switch is wired with built in pull ups so you will want to wire that up with Vcc and GND. The other pins are:
  • Left is pin 2
  • Down is pin 3
  • Press is pin 4
  • Right is pin 6
  • Up is pin 5

The display is wired using i2c so aside from Vcc and GND you have 2 pins:
  • DAT (SDA) is A4
  • CLK (SCL) is A5 
The Code:

Code also available on GitHub here

The Output:
The output is the dice on the top and the roll on the bottom. if you change the die size or quantity it will display the last roll and die choice on the bottom. You can see from the attached pictures what the output looks like.

Tuesday, May 21, 2013

ATTiny Lantern - Battery Powered

As a small project around the time I made my ATTiny AVR I decided to make a battery powered flicker light and a pulsing night light. The lantern is a simple ATTiny running a modification of the ever available REAL flicker effect code that uses 3 LEDs. In this build I used 3mm LEDs 1 orange and 2 yellow. Parts for the lantern as as follows:

The Parts:
1 x ATTiny
1 x 8 pin DIP Socket
1 x Proto Board
1 x AA battery holder
1 x switch
1x Lantern
assorted lengths of wire I keep in a drawer

The Buildout:
Below is the diagram for the circuit note that the diagram below uses a coin type battery instead of a 2 x AA connector.

The Code:

also available on git-hub here

The Results:
The results here were a smallish circuit that I can place in a lantern and have it give off a flicker effect. Why not use on of those flicker LEDs you ask? I wanted to build something with a more random flicker and that I could adjust the flicker speed on.