ATtiny Hacks: Look Ma, No Batteries!

ATtiny Hacks Theme Banner

[Gadre] built his own ATtiny project without using any batteries. It’s an electronic Dice (or die if you’re being critical) which uses induction to charge a storage capacitor to act as the power source. The voltage generator is made from a tube of Perspex which houses a set of rare-earth magnets. At the enter of the tube [Gadre] machined a channel wich accepts about 1500 windings of 30 AWG magnet wire. When someone shakes the tube back and forth the magnet passes the wire, inducing a current.  The product is stored in a 4700 uF capacitor, which feeds a boost converter to power the rest of the circuit.

The ATtiny13V that controls the circuit is running its internal RC oscillator at 128 kHz, the lowest setting possible in order to minimize power consumption. After a good shake the user can press a button to roll the die, which is then displayed for several seconds on a group of seven LEDs. See for yourself in the video after the break.

Continue reading “ATtiny Hacks: Look Ma, No Batteries!”

Hardware XOR For Output Pins On AVR Microcontrollers

Did you know that most AVR chips have a type of hardware exclusive OR (XOR) option when it comes to the logic levels of the output pins? If you look in the datasheet (the image above is a screenshot from an ATtiny13 datasheet) you’ll find a section on Toggling the Pin. It turns out that if you set a PORT as an output, writing logic one to the corresponding PIN register will toggle the logic levels of that out. This is really easy to overlook if you’re writing in C, but I’ve been working on learning a bit of assembler language and found this to be very useful. Keep reading after the break and I’ll tell you how I happened upon this info and what it’s good for.

Continue reading “Hardware XOR For Output Pins On AVR Microcontrollers”

ATtiny13 Powered Handheld Helicopter Game

[Owen] just finished putting together a portable helicopter game. It’s pretty impressive, especially since he used an ATtiny13 microcontroller. That chip uses an 8-pin dip package, offering only five I/O pins (six if you use the reset pin) and 1k of programming space.

The game runs on a small cellphone-type LCD screen. The helicopter remains somewhere in the center column of the screen as the maze that makes up the game board approaches one step at a time. The single button that controls the helicopter will raise it with each step of the maze when held down, or allow it to fall when released. The player’s progress is shown as a hex value in the upper left corner of the screen. When you hit a wall, your score will be shown next to the high score for the game and will be saved in EEPROM if it’s a new record. As the game progresses, the maze gets harder based on the score. Check it out in a video clip after the break.

Continue reading “ATtiny13 Powered Handheld Helicopter Game”

Dimming Control For An Ikea Solar Desk Lamp

[Frank] decided to augment his desk lamp’s features by adding dimming controls (translated). Since the light source is a triad of LEDs the best method of dimming their intensity is to use Pulse Width Modulation. That’s the method that he went with, and luckily the SUNNAN lamp from Ikea which he’s using as the donor for the project has just enough room to squeeze in the parts necessary for this hack.

You need two main bits to use PWM with a lamp like this; a microcontroller (or possibly a timer chip like the 555) and a transistor to protect that chip from the current necessary to run the LEDs at full brightness. [Frank] went with an ATtiny13 and a 2N2222 transistor, both quite common and very inexpensive (you can even pull the microcontroller from a light bulb if you know where to look). Two buttons were added to the top of the lamp base which allow for up and down controls. There’s even an SOS function which is triggered by pressing both buttons at the same time. [Frank’s] happy to show off the completed project in the clip after the break.

Continue reading “Dimming Control For An Ikea Solar Desk Lamp”

AVR HVSP On A Tiny Breadboard

AVR chips are convenient because you can program them in circuit at their operating voltage. That is, unless you screw up the fuse settings and they’ll no longer listen to an In System Programmer. If you find yourself facing this problem, just build this circuit on a breadboard and ‘unbrick’ by holding down the button.

The circuit seen above is a High Voltage Serial Programmer. This is one of two high voltage protocols used by AVR chips; HVSP is for chips that don’t have enough pins to use High Voltage Parallel Programming. This rendition uses a 12V power source, which is the level necessary for the high voltage method. A 7805 linear regulator joins the mix to provide operational voltage, along with one transistor, an ATtiny2313 to control the circuit, a four-digit 7-segment display for feedback, and one button for control.

Watch the video after the break to see an ATtiny13 programmed to disable the reset pin using a breadboarded programmer. That chip is then easily rescued, having been automatically recognized by using its device signature.

Continue reading “AVR HVSP On A Tiny Breadboard”

Add A Shutoff Timer To Your Bathroom Fan

Adding this board (translated) to your bathroom fan will turn it into a smart device. It’s designed to automatically shut off the fan after it’s had some time to clear humidity from the room. It replaces the wall switch which normally controls these fans by converting the fan connection to always be connected to mains.  The board draws constant power to keep the ATtiny13 running via a half-wave rectification circuit. A single LED that rises from the center of the PCB lights up to signal that the fan is in operation, but it is also used as a light sensor, similar to the LED communications hack from a couple of days ago. When the lights go on in the bathroom the microcontroller will turn on the exhaust fan via a Triac. It will remain on until the light level in the bathroom drops.

There’s an interesting timing algorithm that delays the fan startup, and varies the amount of time it will stay on in the dark depending on how long the bathroom lights were on. This way, a longer shower (which will build up more humidity) will cause the fan to remain on for the base of five minutes, plus one minute longer for every two minutes the bathroom was in use. Pretty smart, and quite useful if your bathroom sees high traffic from several family members.

Part 2: Help Me Reverse Engineer An LED Light Bulb

Almost a month ago I started trying to reverse engineer an inexpensive LED color changing light bulb. With your help I’ve mapped out the circuit, and taken control of the bulb. But there’s still a few mysteries in this little blinker. Join me after the break to see what I’ve done so far, peruse the schematic and source code, and to help solve the two remaining mysteries.

Continue reading “Part 2: Help Me Reverse Engineer An LED Light Bulb”