Introduction: HackerBox 0025: Flair Ware

Picture of HackerBox 0025: Flair Ware

Flair Ware - This month, HackerBox Hackers are building a variety of electronic flair for use as wearables, demos, or even holiday ornaments. This Instructable contains information for working with HackerBox #0025, which you can pick up here while supplies last. Also, if you would like to receive a HackerBox like this right in your mailbox each month, please subscribe at HackerBoxes.com and join the revolution!

Topics and Learning Objectives for HackerBox 0025:

  • Assemble a simple coin-cell-powered circuit board with self-flashing LEDs
  • Explore cascaded analog oscillators to implement a wearable name badge
  • Experiment with multiple Digispark devices for miniature Arduino projects
  • Interconnect wearable LilyPad modules including NeoPixel full-color LEDs
  • Program blank ATtiny85 microcontrollers using USBasp

HackerBoxes is the monthly subscription box service for DIY electronics and computer technology. We are hobbyists, makers, and experimenters. We are the dreamers of dreams. HACK THE PLANET!

Step 1: HackerBox 0025: Box Contents

Picture of HackerBox 0025: Box Contents
  • HackerBoxes #0025 Collectable Reference Card
  • LED Star Wearable Kit
  • Color-Cycling Sign Kit
  • BitHead ATtiny85 Wearable Kit
  • Pluggable Digispark DevBoard
  • Extra ATtiny85 8DIP Microcontroller
  • CJMCU LilyTiny Digispark Module
  • Three LilyPad NeoPixel Modules
  • LilyPad Coin Cell Module
  • CR2032 Lithium Coin Cells
  • USBasp Atmel AVR USB Programmer
  • Green Prototyping Board 4x6cm
  • Lapel Pin Backs
  • Shrink Tubing - 100 Piece Variety
  • Tin Project Box
  • Exclusive HackerBoxes Decal
  • Exclusive HackerBoxes Knit Cap

Some other things that will be helpful:

  • Soldering iron, solder, and basic soldering tools
  • Computer for running software tools

Most importantly, you will need a sense of adventure, DIY spirit, and hacker curiosity. Hardcore DIY electronics is not a trivial pursuit, and we are not watering it down for you. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from learning new technology and hopefully getting some projects working. We suggest taking each step slowly, minding the details, and never hesitating to ask for help.

FREQUENTLY ASKED QUESTIONS: We need a really big favor from the HackerBox members out there. Please take a few minutes to review the FAQ on the HackerBoxes website prior to contacting support. While we obviously want to help all members as much as necessary, most of our support emails involve simple administrative issues that are very clearly addressed in the FAQ. Thank you for understanding!

Step 2: Express Yourself With Wearables

Picture of Express Yourself With Wearables

We need to talk about your flair. Wearable electronics can be a flashy way to learn about miniaturization, power-reduction, and aesthetic PCB layout. You can really express yourself with projects like these. Wear them, decorate your workspace, or even using them as holiday ornaments. Get creative and share your very own wearable winter wonderland with the world!

Step 3: LED Star Wearable

Picture of LED Star Wearable

Let's get started with a example that is quite elegant in its simplicity. This design features five self-flashing 5mm LEDs. Since these LEDs are self-flashing, no external control circuitry is required. The only other parts are a CR2032 coin cell clip and an on/off switch.

Assembly: Orient the coin cell clip and the five LEDs according to the markings on the PCB silkscreen. Note that each LED has a "flat side" shown on the board. Before placing the battery clip, entirely tin all three pads with solder. Even though nothing gets soldered to the center pad, some tinning helps to build the pad up a bit to ensure a good contact with the negative surface of the coin cell.

Step 4: Color-Cycling Sign Kit

Picture of Color-Cycling Sign Kit

This miniature "sign" features eighteen LEDs with color-cycling controlled entirely by analog oscillators. This analog design reminds us that microcontrollers, as much as we love them, are not always required to obtain interesting results. The completed circuit board assembly may be worn as a blinky name badge.

Kit Contents:

  • Custom Purple Printed Circuit Board
  • Two CR2032 Coin Cell Clips
  • Six RED 3mm LEDs
  • Six Orange 3mm LEDs
  • Six Yellow 3mm LEDs
  • Three 9014 NPN Transistors
  • Three 47uF Capacitors (note that there is also one 10uF Capacitor)
  • Three 1K ohm Resistors (brown-black-red)
  • Three 10K ohm Resistors (brown-black-orange)
  • Slide Switch
  • JST-PH Socket with Pigtail
  • Decal with Three Interchangeable Sign Faces

Step 5: Sign Kit Theory of Operation

Picture of Sign Kit Theory of Operation

The design features three cascaded oscillators to control the LED color-cycling. Each of the 10K resistors and 47uF capacitors forms an RC oscillator that periodically pushes the associated transistor on. The three RC oscillators are cascaded in a chain to keep them cycling out of phase which makes the blinking appear random around the sign. When the transistor is "on" current passes through its bank of 6 LEDs and their 1K current limiting resistor causing that bank of 6 LEDs to blink on.

Here is a nice explanation of the basic concept using a single stage (one oscillator and one transistor).

Step 6: Sign Kit Assembly

Picture of Sign Kit Assembly

Use the schematic and the PCB placement diagram while assembling the sign kit.

There are two different values of resistors. They are not interchangeable. In order to keep them straight, note the values on the schematic and the part numbers on the placement diagram. Resistors are not polarized. They may be inserted in either direction.

Note that there are three "banks" of LEDs D1-D6, D7-D12, and D13-D18. Each bank should be all one color in order to balance the current load and also for a nice visual effect. For example, LEDs D1-D6 could all be red, D7-D12 all orange, and D13-D18 all yellow.

The capacitors are polarized. Note the "+" making on the placement digram and the "-" marking on the capacitor itself. These indicate opposite pins, obviously.

The LEDs are also polarized. Note the "+" marking on the placement diagram. The long pin of the LED should be in that "+" hole. The "flat side" of the LED should be adjacent to the OTHER hole.

Again, entirely tin all three pads for each of the coin cell clips with solder. Even though nothing gets soldered to the center pads, tinning helps to build the pad up to ensure a good contact.

Step 7: Digispark

Picture of Digispark

Digispark is an open source project originally funded through Kickstarter. It’s a super-miniature ATtiny-based Arduino compatible board using the Atmel ATtiny85. The ATtiny85 is an 8 pin microcontroller that is a close cousin of typical Arduino chip, the ATMega328P. The ATtiny85 has about a quarter of the memory and only six I/O pins. However, it can be programed from the Arduino IDE and it can still run Arduino code without a hitch.

Being an open source design, there have many variations on the Digispark. Some of the most common are shown here. We'll be working with a couple of these.

Review of the schematic should immediately beg the question, "Where is the USB chip?"

Micronucleus is the piece of magic that allows the Digispark design to work without a USB interface chip. Micronucleus is a bootloader designed for AVR ATtiny microcontrollers with a minimal usb interface, cross platform libusb-based program upload tool, and a strong emphasis on bootloader compactness. It is, by far, the smallest USB bootloader for the AVR ATtiny.

LIBUSB DRIVER

libusb is a C library that provides generic access to USB devices. It is intended to be used by developers to facilitate the production of applications that communicate with USB hardware. The functionality of libusb should be automatically available on Linux and OSX. A driver, such as zadig, is may be required for Windows machines.

Step 8: Digispark As USB Rubber Ducky

Picture of Digispark As USB Rubber Ducky

The USB Rubber Ducky is a favorite hacker tool. It is a keystroke injection device disguised as a generic flash drive. Computers recognize it as a regular keyboard and automatically accept its pre-programmed keystroke payloads at over 1000 words per minute. Follow the link to learn all about Rubber Duckies from Hak5 where you can also buy the real deal. In the meantime, this video tutorial shows how to use a Digispark like a Rubber Ducky. Another video tutorial shows how to convert Rubber Ducky Scripts to run on the Digispark.

Step 9: CJMCU LilyTiny and NeoPixels

Picture of CJMCU LilyTiny and NeoPixels

The CJMCU LilyTiny uses the same hardware design and bootloader as the Digispark. However, the LilyTiny is built on a purple, disc-shaped PCB reminiscent of the LilyPad boards. Read more about LilyPad wearables here.

FLASH LED BLINK

Our first step will be to flash the LilyTiny with the LED blink example just to make sure our tools are in order.

If you do not have the Arduino IDE installed, do that first.

Follow instructions here to load digistump support into the Arduino IDE.

Load the "Start" example code:

File->Examples->Digispark_Examples->Start

Hit the upload button. The IDE will instruct you to plug in your target board. Once you do so, the Digispark programmer will scan the USB ports for it and program the ATtiny85.

After the upload completes, the LED should be blinking.

As a test, you can change BOTH “delay(1000)” statements to be “delay(100)” and reflash.

Now the LED should be blinking ten times faster (delay changed from 1000 to 100).

LILYPAD NEOPIXEL MODULES

Wire up the three NeoPixel modules as shown here.

Load the strandtest demo code in the IDE:

File->Examples->(for Digispark)->NeoPixel->strandtest

In the code:
Change Parameter 1 (number of pixels in strip) to 3
Change Parameter 2 (Arduino pin number) to 3

Upload and enjoy the light show - all without any USB chips!

Step 10: USBasp - Atmel AVR USB Programmer

Picture of USBasp - Atmel AVR USB Programmer

When you buy a raw ATtiny85 chip (like the two 8pin DIP chips in this box) from Mouser or DigiKey, it is completely blank. The chips do not have micronucleus or any other bootloader on on them. They will need to be programmed. For example using an ISP (in-circuit programmer).

USBasp is a USB in-circuit programmer for Atmel AVR controllers. It simply consists of an ATMega88 or an ATMega8 and a couple of passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed.

Insert the ATtiny85 into the Plugable Development Board (mind the pin one indicator) and wire the board up the USBasp as shown here.

Add ATtiny support to your Arduino IDE (see details at High-LowTech):

Under preferences, add an entry to the list of board manager URLs for:

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Under Tools->Boards->Board Mangers, add the board manager package from ATtiny by David A. Mellis.

This will add ATtiny boards to the board list, where you can now select...

Board: ATtiny25/45/85
Processor: ATtiny85
Clock: Internal 1 MHz

[IMPORTANT NOTE: Never set the clock to external clock unless the chip actually has an external clock source.]

Load the code example for "blink"

Change LED_BUILTIN to 1 in three places in that sketch and upload it to the ATtiny85 using USBasp.

The Pluggable DevBoard LED should now blink just as the LilyTiny LED did out of the box.

Footnote - Using the Pluggable DevBoard as a Digispark:

Technically, we are using the Pluggable DevBoard here as a breakout for attaching the USBasp, not as a Digispark. To user it as a Digispark, the microcontroller will need to be programmed with the micronucleus bootload which can be downloaded here.

Step 11: BitHead ATtiny85 Wearable Kit

Picture of BitHead ATtiny85 Wearable Kit

BitHead is the HackerBox super-sexy mascot skull. This month, he comes in PCB-form ready to rock an ATtiny85 micro, a piezo buzzer, and a couple NeoPixel eyeballs.

Kit Contents:

  • Custom Black BitHead Printed Circuit Board
  • Two CR2032 Coin Cell Clips
  • 8pin DIP Socket
  • 8pin DIP ATtiny85 Integrated Circuit
  • Passive Piezo Buzzer
  • Two 8mm Round NeoPixel LEDs
  • 10uf Capacitor
  • Slide Switch
  • JST-PH Socket with Pigtail

Step 12: BitHead Wearable Assembly

Picture of BitHead Wearable Assembly

Since the PCB silkscreen is used for artwork, the typical silkscreen indicators are not present on the PCB. Instead, they are shown here as an assembly diagram. Carefully orient the buzzer, capacitor, DIP8 socket, and both NeoPixels according to the markings on this assembly diagram. The leads on the NeoPixels have a wide point a few millimeters down from the plastic dome. These are tough to get through the PCB holes, so it can help to cut the leads off just above these prior to insertion. Be sure to leave enough of the leads to extend through the PCB for soldering.

Remember to entirely tin all three pads for the coin cell clips with solder. Even though nothing gets soldered to the center pads, tinning them helps to build the pad up to ensure good contact.

Step 13: BitHead Wearable Programming

Picture of BitHead Wearable Programming

The attached sketch "WearableSkull.ino" demonstrates controlling BitHead's buzzer and LEDs from an ATtiny85.

Use the Pluggable DevBoard to program the sketch into the ATtiny85.

In oder to use the NeoPixel library, we need to bump the internal clock rate from 1MHz to 8MHz under Tools->Clock. Whenever you make a change to the clock rate you have to perform a "Burn Bootloader" operation under tools, so do that now too.

Upload the BitHead demo program to the ATtiny85, carefully pop the chip out with a little flathead screwdriver, plug the chip (mind orientation) into BitHead, flip the switch, and if everything is right... IT'S ALIVE!

You can play around with the lights and sounds. See how long it takes to get sick of the "burn and learn" cycle of popping the chip in and out. Welcome back to the 1980s.

Step 14: Hack the Planet

Picture of Hack the Planet

If you have enjoyed this Instrucable and would like to have a box of electronics and computer tech projects like this delivered right to your mailbox each month, please join us by SUBSCRIBING HERE.

Reach out and share your success in the comments below or on the HackerBoxes Facebook Page. Certainly let us know if you have any questions or need some help with anything. Thank you for being part of HackerBoxes. Please keep your suggestions and feedback coming. HackerBoxes are YOUR boxes. Let's make something great!

Comments

droneb (author)2017-12-12

Is anyone else getting the star pcb to shine (slowly) even when switch is off?

I had to pull the battery off

simis69 (author)droneb2017-12-15

make sure that your solder joints are not bridging, you may need a magnifying glass to see it clearly. or one could use a multimeter to see where the power is not being turned off at.

ptrebilcox-ruiz (author)2017-12-11

Anyone have any luck getting the Digistump connected on osx? I've got the board manager AVR selected, but the device never shows up under port.

droneb (author)2017-12-05

I have not been able to make Arduino IDe to detect the Programmer.

It keeps saying:
Arduino:1.8.1 (Windows 10), Tarjeta:"ATtiny25/45/85, ATtiny85, Internal 8 MHz"

avrdude: Warning: cannot query manufacturer for device: No such file or directory

avrdude: Warning: cannot query product for device: No such file or directory

avrdude: Warning: cannot open USB device: Function not implemented

avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'

Already done the Zadigs steps and Windows is no longer reporting the device with no drivers.

Th3rm (author)droneb2017-12-06

It's a driver issue try this
http://forum.arduino.cc/index.php?topic=415210.msg2862244#msg2862244

droneb (author)Th3rm2017-12-07

Thanks, although i am still not able to program it either.

now i get
avrdude: warning: cannot set sck period. please check for usbasp firmware update.

avrdude: error: program enable: target doesn't answer. 1

avrdude: initialization failed, rc=-1

Double check connections and try again, or use -F to override

this check.

I have tried the slow programming jumper and different attiny chips i had at hand, none are working. I am really unsure if the programmer still has driver issues, the Attinys are DOA. triple checked all connections already.

MikeM551 (author)droneb2017-12-10

Remember.. pin 8 and 10 from the USBasp 10 pin connector are ground for the pin 4 of the ATTINY85 in Step 10. Relocate the green wire in step 10 to pin 8 or 10 on the USBasp. You WILL get the SCK period warning, it is fine, no need to mess with a firmware update for the USBasp, as programming works with out any troubles.

tiggerslowski (author)droneb2017-12-05

I was having this issue until I was able to get the driver to work. I ended up using the driver from https://protostack.com.au/shop/accessories/usbasp-...
Check if the driver is installed by pressing "win + x" then "m". That will bring up the device manger and you can see if it is installed. Mine is listed under libusbk devices
I rebooted windows as well for good measure. I still get an avrdude warning but the upload to the chip does work.

MikeM551 (author)2017-12-10

Remember.. pin 8 and 10 from the USBasp 10 pin connector are ground for the pin 4 of the ATTINY85 in Step 10.
When I followed the wiring diagram ( Step 10: USBasp - Atmel AVR USB Programmer ) for the pluggable Dev board on this page, random results were happening during programming.
ATTINY85 had no ground on pin 4.
I could program the ATTINY85 with out the Pluggable dev board just fine using a breadboard.
So use the diagram ( USBasp to Pluggable Dev Board ), but ensure the green wire is going to pin 8 or 10 on the USBasp 10 pin connector.

bitanalyst made it! (author)2017-12-09

Lot's of neat bits in this box! I enjoyed the soldering kits and the ATtiny stuff is fun to tinker with.

It took me a bit to figure out how to program the CJMCU on Windows 10. For anyone wondering it is normal behavior for Digispark devices to connect via USB then disconnect about 5 seconds later. This makes the driver installation a bit tricky.

Make sure you run DPinst64.exe to install the drivers. If you load the 32 bit drivers by mistake you'll have to completely remove them. See reply #8 at the link below.

https://digistump.com/board/index.php?topic=2479.0

qvander (author)2017-12-06

Had issues as well with the ATtiny. Used Zadig and set the driver to winusb(vb6.1.7600) and installed the driver. Boom uploaded fine.

win10 machine

Racer1TN (author)qvander2017-12-07

I've tried all of the different drivers on a Win 10 with Arduino 1.8.3 and everything registers ok up to the device manager. I never see a com port to select that works in the IDE. Blink will compile, but times out after a few minutes. I get red leds lit on both sides (USBasp and Atmel AVR). All is get is "An error occurred while uploading the sketch".

HackerBoxes (author)2017-12-07

HackerBox 0025 includes the pluggable ATtiny85 DevBoard (the one with the 8pin socket) which is electrically the same thing as a USB digispark (see Step 7). The USB digispark is only discussed in the instructions for context on the pluggable board that is being used here.

RustinR (author)2017-12-03

I tried every shown way to program the AtTiny85 and got errors every time I tried to upload. Finally found a link on YouTube showing how to use Arduino Uno as a programmer for AtTiny85. Super easy.

https://www.youtube.com/watch?v=VlUq2COFjj4

RobotFarmer (author)RustinR2017-12-03

RustinR. I used your video link. He is a fast talker but I've got mine running. Much easier and a lot less hassle. Thanks so much for sharing.

RustinR (author)RobotFarmer2017-12-04

Hahaha...... I had to pause the video at every step because I couldn't keep up with him.

grtyvr (author)2017-12-03

And now I have done some playing around with programming the attiny85 to burn it as a digispark. Good fun!

https://youtu.be/0XMc6szWnSs

Hackerdaddy (author)2017-12-03

Awesome box this month! I especially liked the kickback to the early days as well as the challenge of new ideas and boards. All went flawless and was fun to assemble. Working on the neopixel to sync up the color shift. Very cool with the rubber ducky, going to have to play with that one!!

grtyvr (author)2017-12-02

Nice collection of bits. I have started into stuff and my progress so far is (mostly) in this video.

Right now I am working on burning the micronucleus onto an attiny85.

I did notice on my box that the CJMCU did not have blink loaded onto it. I think mine had the neopixel code, but now I will never know :-(.

djcc2012 (author)grtyvr2017-12-03

Great unboxing and explaining!

My CJMCU also did not have Blink. But it programmed fine, once I fixed the Linux permission issues.

DavidB1379 (author)2017-12-02

Great fun this month, but one thing was odd. When I assembled the star badge, the LEDs didn't blink. Instead, they started slowly cycling through various colors. Is this expected behavior for "self flashing" LEDs?

HackerBoxes (author)DavidB13792017-12-02

It is odd that they are called flashing when "fading" and/or "cycling" would be more appropriate. They are manufactured in China so it might be a translation issue. Also, we used the "slow" variant here, but the "fast" variant does seem a little more like what one might call "flashing." BTW, if anyone wants more, Adafruit carries them or you can get a big bag on Amazon or eBay.
https://www.adafruit.com/product/679

moldavia (author)DavidB13792017-12-02

They're probably just color changing LED's, rather than flashing. Mine faded between colors too.

djcc2012 made it! (author)2017-12-02

Loved this HackerBox! Must be just my speed. :-)

I enjoyed learning the different ways to use the LEDs and about a Rubber Duckie, which I may look into further later.....

Cool knit hat!

MatthewG210 (author)2017-12-01

The link in step 10 (https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/) does not seem to work on the Arduino IDE. is there another link I should use?

HackerBoxes (author)MatthewG2102017-12-02

Oops... The instructables editor bit the URL off when trying to turn it into a link.

It should be:

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

We also added a link to a High-LowTech tutorial on the process.

Th3rm (author)HackerBoxes2017-12-02

Missing the g at the end of http://digistump.com/wiki/digispark/tutorials/connectin

tamagotono (author)MatthewG2102017-12-02

MatthewG210, I haven't verified it but I am guessing that this is the correct link.

https://github.com/damellis/attiny/tree/ide-1.6.x-...

Please reply back and say if it works or not.

MatthewG210 (author)tamagotono2017-12-02

The link seemed to work but attiny does not show up under the board managers.

Th3rm (author)MatthewG2102017-12-02

This is the link
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

djcc2012 (author)2017-12-02

Using Linux I could not upload to the LilyTiny until I added a new rules file.

I would get an error: "micronucleus: library/micronucleus_lib.c:66: micronucleus_connect: Assertion `res >= 4' failed".

Using the fix from "http://digistump.com/wiki/digispark/tutorials/linuxtroubleshooting" I added the file "/etc/udev/rules.d/49-micronucleus.rules" as root.

Uploading to the LilyTiny works now.

About This Instructable

3,586views

10favorites

License:

More by HackerBoxes:HackerBox 0025: Flair WareHackerBox 0024: Vision QuestHackerBox 0023: Digital Airwaves
Add instructable to: