Skip to content
C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
gerber
src/arduinoflake
LICENSE
README.md

README.md

Arduinoflake

Arduinoflake is an awesome winter decoration that will light up every dark night. It is no ordinary decoration. This frozen looking beauty is Arduino compatible and can be programmed to do whatever you want to! It features a capacitive touch button which let you interact with it. Last but not least it is open-source.

Arduinoflakes

Sponsored by PCBWay - PCB prototype the easy way.

Features

  • 30 LEDs grouped into 18 independent segments
  • touch button for interactions
  • ATmega8 Arduino compatible microprocessor
  • AVR ISCP programming interface
  • runs up to 12 hours on a single CR2032 battery

Building your Arduinoflake

The easiest way how to get your own snowflake is to order a DIY kit on my Tindie Store. Kit contains professionally manufactured PCBs by PCBway and all compatible components needed to assemble a fully functional Arduinoflake.

The second option is to manufacture the PCB and get all necessary parts yourself. Arduinoflake is Open-Source. Schematic and Gerber files are included in this repository. Don't forget to share your creation with me, I would love to see that!

Parts list

  • ATmega8A TQF32
  • TTP223 SOT23
  • 18x bright white flat-top crystal clear LEDs
  • 12x bright white 1206 SMD LEDs
  • 18x 68Ω resistors
  • 3x 100nF capacitors
  • 10kΩ resistor
  • CR2032 battery holder
  • MSK-12C02 power switch

Understanding Arduinoflake hardware

Arduinoflake consists of 30 white LEDs grouped into 18 segments. Each group is connected to one of the ATmega8 output pins and can be programmatically controlled. The touch button is handled by standalone TTP223 integrated circuit and is connected to PD3 input pin with interrupt support.


Arduinoflake LED groups to ATmega8 digital pins mapping

Preparing your environment

Arduinoflake can be programmed using Arduino IDE. In order to do so, you need to have a programmer - special hardware to upload code to microchip - and library installed in Arduino IDE.

USBasp

USBasp is a cheap $1 board that allows you to connect any ATmega chip with your computer via USB. Including Arduinoflake. It translates USB commands into AVR ISCP commands that can program the processor.

There is an ISCP interface in the left corner on the back of Arduinoflake. You can either use pogo pins if you have those or solder 6-pin header directly to the board to easily connect your ISCP cable. Before powering it up don't forget to change power on USBasp board to 3.3V.


AVR ISCP programming interface

Arduino as ISP (alternative to USBasp)

You can turn common Arduino UNO or any other Arduino board into programming hardware. its a bit messy, but does not require special hardware. Read how to turn your Arduino UNO into a programmer. The rest is same as with USBasp.

Installing MiniCore

It's time to start your Arduino IDE. In order to be able to program Arduinoflake, you need to first add support for ATmega8 device into Arduino IDE and configure it.

  • Install MCUdude/MiniCore device library
  • Open Tools > Boards and select ATmega8
  • Select Tools > Bootloader > No
  • Select Tools > Clock > 8 MHz internal
  • Select Tools > BOD > Disabled
  • If you are not working with a Kit run Tools > Burn Bootloader

Arduino IDE ATmega8

First upload

Checkout this repository and open arduinoflake.ino project file. Run Sketch > Upload Using Programmer. You should get a sweet 'avrdude done. Thank you.' message at the end of the console. Now you can make your own personalized Arduinoflake.

Arduino IDE upload

Getting started with the Arduinoflake library

Getting started with the Arduinoflake library Arduinoflake comes with handy canvas.cpp class which creates an abstraction over the Arduinoflake hardware. You will use it to paint your Arduinoflake with lights.

Features

  • LEDs are addressed with index (0-18)
  • setup single LED
  • setup range of LEDs
  • power management
  • software PWM for each LED (to be done)
  • touch button abstraction (to be done)

Constructor

CANVAS(byte numLedsAtOnce);
  • numLedsAtOnce - power saving factor, number between 1-18, high number high power consumption but also brighther LEDs

Basic functions

void setup()

Need to be called in project's setup() function to setup hardware.

void render()

Need to be called every 1ms in project's loop() function to be able toproperly control LEDs.

Draw functions

void set(byte index, byte value);

Set brightness value to LED on index. Use LED_ON or LED_OFF constant for value.

void setByRange(byte fromIndex, byte toIndex, byte value);

Set brightness value to LEDs on indeces <fromIndex, toIndex). Use LED_ON or LED_OFF constant for value.

void clear();

Turn off all LEDs.


Arduinoflake LED groups indexes used in library

Backlog

  • Add touch button abstraction to hardware class
  • Add support for PWM
  • Add more animations
You can’t perform that action at this time.