A study in AVR power saving techniques

posted Jul 26th 2011 10:22am by
filed under: Microcontrollers, Software Development

amtel_avr

[Scott] found the iCufflinks from Adafruit Industries pretty interesting, but he thought that the stated run time of 24 hours was a bit short. He figured he could improve the product’s power consumption at least a little bit, to improve the overall battery life.

From their schematics, he placed an order for parts and built two identical iCufflink mock-ups side by side – one running their code and one running his. He took baseline current draw measurements, then got busy slimming down the cufflinks’ software. It had been 20 years since he touched assembly, and he has never written it for an AVR, but judging by his work he’s not rusty in the least.

He slowed the ATtiny’s clock down and tweaked a few other settings for a savings of 53μA, but the real improvements came via a fairly simple fix. The original code called for the processor to institute a counting loop to sleep, which he found to be very wasteful. Instead, he chose to put the processor in an idle state, using the chip’s watchdog timer to wake it when it was time to pulse the LED. The power savings from this change alone was a whopping 261μA!

When he was said and done, the changes save about 315μA of current draw, and should allow the cufflinks to run for up to 38 hours without swapping batteries. In [Scott’s] opinion, a nearly 60% improvement in battery life is pretty good for a day’s work, and we’re inclined to agree.

Digital cootie detector

posted Jul 25th 2011 1:03pm by
filed under: toy hacks

Kids love games of exclusion. This usually manifests itself in games of ‘keep away,’ having someone ‘catch cooties,’ or the ever-popular ‘No Brian club.’ [Rob] wrote in to tell us about the digital cootie detector he built. The cootie detector operates on galvanic skin response. It’s actually very similar to an E-Meter, although instead of Thetans this device measures something that actually exists.

Galvanic skin response is a measure of the skin’s conductivity. Skin conductivity changes because sweat glands will be activated when someone is nervous. This is a measure of psychological arousal, making it a great detector for games of exclusion – a kid who doesn’t want cooties will ‘psych themself out’ and give themselves cooties.

Read the rest of this entry »




Cheap voice-controlled lighting

posted Jul 15th 2011 1:11pm by
filed under: home hacks

voice_controlled_home_automation_board

Voice-controlled home automation doesn’t have to be wildly expensive if you have a little bit of time and some know-how to do the job yourself. [jjshortcut] wanted to control the lighting in his room without using physical switches. On his blog, he describes how he did it without spending a ton of money.

He picked up a VRBot speech recognition module on eBay, which is an easy way to get your feet wet with voice control. The device has a bunch of built-in speaker independent commands, as well as the ability to record up to 32 custom triggers. Rather than mess with mains voltage and build his own light relays, he purchased a simple set of wireless light switches and began hacking.

He spent some time sniffing the wireless communications protocol to figure out how the lights were triggered, then he replicated that functionality using an AVR and a cheap 433 MHz module.

The system seems to work quite well despite how cheaply he was able to put it together. Stick around to see a quick video of his voice recognition system in action.

Read the rest of this entry »

Using an AVR as an RFID tag

posted May 20th 2011 6:09am by
filed under: Microcontrollers

A few years ago, [Beth] came up with the idea of using an AVR as an RFID tag. She’s gotten sidetracked with a few other projects in the meantime but her idea has surfaced again, this time as a duct tape RFID tag. The build is just four components: 0.1 µF and 1 nF capacitors, an ATtiny85 microcontroller, and 100 turns of 40 AWG magnet wire, all soldered together and placed on a duct tape substrate.

Like most RFID tags, the power is drawn from the reader through the coil, but even in low power versions the ATtiny is only rated down to 1.8 Volts. Since the microcontroller is only getting about 1 Volt from the coil, the clock oscillator of the ATtiny won’t work. This isn’t a problem in this build, because the coil is connected to the the clock input – the 125 kHz coming off the reader provides the clock. Very clever.

Of course, the microcontroller is going to need some firmware to send some bits to the reader, so she used the AVRFID firmware (check out the comments in the source for a great walkthrough) to transmit under the HID protocol, itself a derivative of [Beth]‘s earlier work with the EM4102 protocol.

Not only are we impressed with this hack, we’re amazed [Beth] is still perfecting her work more than two years after her first post on the subject. That’s dedication and unbridled cleverness.

Via adafruit

USB Geiger counter hack

posted May 13th 2011 9:31am by
filed under: misc hacks

usb_geiger

[Vic] bought a Kvarts DRSB-01 Geiger counter a few years ago, and recently dug it out of his electronics stash. The counter is a run of the mil no-frills unit. It lacks any kind of LCD display and it cannot be calibrated, so Sievert exposure ratings are out of the question. The unit essentially monitors background radiation and alerts the user to the presence of gamma and high-energy beta rays via audible clicks.

[Vic] wanted to make it a bit more useful, so he decided to interface it with his computer in order to take long-term radiation measurements. He dug up a schematic online and deadbugged a small circuit using an ATtiny44. The circuit allows him to enumerate the electrical pulses generated by ionizing particles striking the Geiger tube, passing them along to his PC over USB.

The counter seems to interface with the PC just fine, but [Vic] does say that he’s getting some odd readings. He thinks that he might have damaged the tube while messing around, but he’s all ears if you have any insight on the matter.




Doorbell hack makes coworkers less annoying

posted Apr 14th 2011 4:01am by
filed under: digital audio hacks, misc hacks

doorbell_wav_player

Hackaday reader [Sprite_tm] works in an office building that used to house several businesses, and as a remnant of the previous configuration, a doorbell sits in the hallway just outside his office. Several of his coworkers get a kick out of ringing the doorbell each time they enter the office. While not annoyed at the practice, he was getting tired of the same old “ding-dong” and decided to shake things up a bit.

He wanted to modify the doorbell to play random sounds when triggered, but he was pressed for time as it was March 31st, and he wanted to get it installed for April Fools’ Day. Without any real plan or bill of materials in mind, he pieced things together with whatever he happened to have sitting around.

He used a design borrowed from Elm-chan in order to play wav files from an SD card with an ATTiny85, and used an L293 H-Driver as an improvised sound amplifier. After sorting out some power-related problems, and configuring the circuit to be as stingy with its battery as he could, he declared the project complete. He originally aimed to deadbug everything on the metal sleeve of the SD card socket (which is awesome), but considering the size of the speaker and the battery he selected for the project, he ended up stuffing everything into a cardboard box.

We don’t care too much about how he packaged it, we just wanted to know what his co-workers thought of his doorbell augmentation. In the end, they loved it, but we imagine this doesn’t do anything to discourage any of them from hitting the doorbell multiple times a day.

Stick around to see a quick video of his doorbell hack in action.

Read the rest of this entry »

Hackaday reader throwdown: Electronic dice

posted Apr 10th 2011 9:29am by
filed under: Microcontrollers, misc hacks

electronic_dice

Hackaday reader [Daid] posted in our forums showing off a set of electronic dice he recently constructed. Back in January, we featured a similar set of electronic dice built with an Arduino that was way overpowered as far as [Daid] was concerned. Not satisfied with simply saying it could be done better, he put his money where his mouth is – something we would love to see more of.

He used an ATTiny2313 to provide the device’s logic, outputting the dice values on a set of four 7 segment displays. The whole setup is controlled by a single push button that serves triple duty rolling the dice, configuring how many sides the dice have, as well as selecting how many dice are being thrown.

He admits that the wiring job is a bit of a mess, but he was going for function over form, and it works just fine. He also says that he would have finished it far sooner if it hadn’t been for those meddling kids some broken 7 segment displays.

We think he did quite a nice job, though we’re all ears if you think you can do it better.

Make your own minimalist AVR ISP

posted Dec 14th 2010 11:46am by
filed under: Microcontrollers, tool hacks

Giving a programmer is a great way to get people started in microcontrollers so If you want a cheap simple AVR programmer this might just be what you’re looking for. It combines the V-USB firmware, USBtiny software, a few resistors, and some zener diodes. An interesting trick using this programmer is if your trying to program another 8 pin ATtiny you can use some tape to isolate the USB data pins and then piggyback the target ATtiny on the programmer.

Unfortunately in order to flash the ATtiny for your programmer you need a working programmer so it’s somewhat of a catch-22.  Make sure your careful when setting the fuse bits because it will use the reset pin making it hard to reprogram without additional programming hardware. AVRs in general are a great way to start using microcontrollers so if your interested give out tutorials a go. You’ll find some tips to get started in addition to information about using an Arduino, or a DAPA cable to flash the firmware to this chip.




Hack a Day serves up fresh hacks each day, every day from around the web as well as hacking related news.

Send us your hacks






     




Hacks

Resources