Learning To Use The V-USB (AVR USB Firmware) Library

The V-USB library is a pretty handy piece of code that lets you add USB connectivity to ATtiny microcontrollers (it was previously named tinyUSB). But if you’ve ever looked into adding the library to your own projects you may have been stymied by the complexity of the code. There are many examples, but there’s a lack of a concise quick-start for the uninitiated. [Joonas Pihlajamaa] has been working to correct that shortfall with his four-part V-USB tutorial series. It’s not for the absolute newbie; you should already be comfortable working with AVR chips but that’s the only real prerequisite we can see.

He starts the series with a look into the hardware considerations. USB provides a 5V power rail but the data lines expect 3.3V logic so this must be accounted for. With the test rig built on a breadboard he moves on to pick apart the code, covering various user-defined variables that you’ll need to set based on your project’s needs. We’re going to keep this on the back burner and hopefully the Troll Sniffing Rat will get a makeover (although we must say comments have been a lot nicer as of late… keep it up!).

We’ve embedded links to all four tutorial parts after the break.

Continue reading “Learning To Use The V-USB (AVR USB Firmware) Library”

WiFi Experiments With ATtiny Microcontrollers

[Quinn Dunki] got some free stuff from Element14 to evaluate, including this Mircrochip WiFi module. It’s been used as the centerpiece of an Arduino shield in the past, and she grabbed a copy of that library to see if it would play nicely with an ATtiny chip. What follows is a struggle to de-Arduino the code so that it’s portable for all AVR controllers.

This module is one of the least expensive ways to add WiFi to a project, coming in at around $23. But it’s not really an all-in-one solution as there’s still a huge software hurdle to cross. The hardware provides access to to radio functions needed to communicate with the network, but you need to supply the TCP/IP stack and everything that supports it. Hence the re-use of the Arduino library.

Battling adversity [Quinn] fought the good fight with this one. Switching from an ATtiny to the ATmega168, compiling more code, and troubleshooting the process. She used a single LED as feedback, and can get some connectivity with her hotspot. But to this point she hasn’t gotten everything up and running.

We’re hot for an AVR WiFi solution that is cheap and easy to use. But as we see here, the software is complex and perhaps best left up to beefier hardware like the ARM controllers. What do you think?

Automatic Flashlight Tag Damage Sensor

You’re out at night and playing a boisterous game of flashlight tag. But how can you tell if you’ve been mortally wounded by your opponents light beam? [Kenyer] solved this problem by building a flashlight tag damage sensor which is worn by each participant. It adds a bit of the high-tech equipment used with laser tag while keeping a low-tech price tag.

The sensor relies on a light dependent resistor to register hits when a flashlight beam passes through the round window. It will only register one hit in a three-second time period. At the end of the game, the total number of hits recorded can be flashed back using an on-board LED to see who is the victor. You can see a demo of this functionality in the clip after the break.

[Kenyer] started with a breadboard prototype using an Arduino as the driver. Obviously the cost of an Arduino for every player is a bit ridiculous. He scaled down the project, running the Arduino code on an ATtiny microcontroller. Continue reading “Automatic Flashlight Tag Damage Sensor”

Musical [Blinky] Candy Tin

Since it’s the holidays and pine trees are being cut down and installed in living rooms all around the world, [Jarv] though it would be a good idea to make a musical Christmas ornament. He needed to keep some of his geek cred, so [Jarv] decided to build a musical [Blinky] ghost from Pacman.

A few weeks ago, [Jarv] sent in his musical greeting card that uses a minimal amount of parts to play a short 8-bit tune. His project was based around an ATtiny85 and sounded pretty good. For his [Blinky] ornament, [Jarv] used a similar circuit along with some old-school Pacman songs that sound great.

[Jarv] found a [Blinky] candy tin and after dispensing with all that pressed sugar began work on his build. In keeping with his greeting card, everything is very minimal. Just a speaker, ATtiny85, and button make up the build. Pressing the button cycles through three songs from Ms. Pacman. The result sounds uncannily like a vintage arcade game, so be sure to check out the video after the break.

Continue reading “Musical [Blinky] Candy Tin”

DIY Thermostat Keeps The Harsh Winter Cold At Bay

diy_attiny_thermostat

[Phil’s] parents grow their own organic food, but the harsh Ukraine winters make storing it a difficult proposition. Since it can drop to -30°C on occasion, they asked him to find a way to keep their storeroom at around 5-7°C above zero. He decided to construct his own programmable thermostat to keep things in check, and has been documenting the process as he goes along.

The thermostat uses a DS18B20 temperature sensor to monitor the room, and the logic is handled by an ATtiny2313. When the temperature dips low enough, the ATtiny triggers the room’s heater via a standard 240v relay. He can check the current temperature via a small 7-segment display mounted on the control board, which also contains three microswitches for controlling the heater.

It looks like a pretty solid build so far, and while he hasn’t finished coding the thermostat just yet, [Phil] says that those details are forthcoming. He has published a schematic however, so you can get a jump start on building your own if you’re looking to warm things up this winter.

Continue reading to see a video overview of the thermostat’s design.

Continue reading “DIY Thermostat Keeps The Harsh Winter Cold At Bay”

Bread Head Makes AVR Programming A Snap

bread_head_quick_avr_programming_header

[Quinn] over at Blondihacks has been working with AVR microcontrollers a lot recently, and wanted a quick way to program the ATtiny13a (her current AVR of choice) while the chip is still seated in a breadboard.

To speed up code revision and testing, she built a small programming header that she calls the Bread Head. The device is wonderfully simplistic, consisting of little more than snappable header pins and a bit of upside-down protoboard.

She soldered six headers to the top (formerly the bottom) side of the board, while a set of eight oversized headers were soldered to the opposite side of the programmer. Small bits of wire were soldered in to connect all of the appropriate pins together before [Quinn] slipped the header snugly over the top of the ATtiny and gave it a quick test. Everything worked perfectly, so she slathered in in epoxy for sturdiness and called it a day.

She says that the programmer works so well that she’s likely to make a similar header for other common AVRs too.

ATtiny Hacks: Robot Halloween Costume

When it comes to Halloween costumes, [Michael] doesn’t like buying expensive and poorly made bits of cloth and fabric that resembles [random Disney character]. Last year, his son decided to be a robot for Halloween and although gray spray paint and dryer vent hose make a very good costume, that only goes so far. The robot needed lights, so [Michael] spent a little time on this build that blinks a few LEDs in a random pattern.

The build is very simple; an ATtiny13 drives two 74HC595 shift registers. The code – all 30-odd lines of it – uses the random() function to shift high or low values to the shift registers. After pausing for a little bit, the cycle continues and a new patterns of LEDs light up.

The electronics of the robot costume could be easily transferred to another theme – astronauts need LEDs on their backpack, and of course aliens communicate with blinking lights. In any event, it would avoid last year’s fiasco with a dozen [Heath Ledger] Jokers. Check out the video of [Michael]’s intergalactic robot son after the break.

Continue reading “ATtiny Hacks: Robot Halloween Costume”