I need someone to explain this to me.

A Vibrating Timepiece

vibratingWatch

It may not look like much, but the above pictured device is [qquuiinn's] handy little watch that indicates time through pulsed vibrations. Perhaps we should refrain from labeling it as a “watch,” however, considering it’s [qquuiinn's] intention to remove the need to actually look at the thing. Vibrations occur in grandfather clock format, with one long vibration for each hour, accompanied by one, two, or three short pulses for the quarter-hour increments.

The design is straightforward, using an ATTiny85 for the brains along with a few analog components. The vibration motor sticks to the protoboard with some glue, joining the microcontroller, a coin cell battery, and a pushbutton on a small protoboard. The button allows for manual time requests; one press responds with the current time (approximated, probably) in vibrations. The build is a work in progress, and [qquuiinn] acknowledges the lack of an RTC (real-time clock) causes some drift in the timepiece’s accuracy. We suspect, however, that you’d address that problem—twice daily—when you replace the battery: it only lasts ten hours.

Trimming The Fat From AVR GCC

avr

[Ralph] has been working on an extraordinarily tiny bootloader for the ATtiny85, and although coding in assembly does have some merits in this regard, writing in C and using AVR Libc is so much more convenient. Through his trials of slimming down pieces of code to the bare minimum, he’s found a few ways to easily trim a few bytes off code compiled with AVR-GCC.

To test his ideas out, [Ralph] first coded up a short program that reads the ATtiny85′s internal temperature sensor. Dissassembling the code, he found the a jump to a function called __ctors_end: before the jump to main. According to the ATtiny85 datasheet, this call sets the IO registers to their initial values. These initial values are 0, so that’s 16 bytes that can be saved. This function also sets the stack pointer to its initial value, so another 16 bytes can be optimized out.

If you’re not using interrupts on an ATtiny, you can get rid of 30 bytes of code by getting rid of the interrupt vector table. In the end, [Ralph] was able to take a 274 byte program and trim it down to 190 bytes. Compared to the 8k of Flash on the ‘tiny85, it’s a small amount saved, but if you’re banging your head against the limitations of this micro’s storage, this might be a good place to start.

Now if you want to hear some stories about optimizing code you’ve got to check out the Once Upon Atari documentary. They spent months hand optimizing code to make it fit on the cartridges.

Hackaday Links: November 24, 2013

hackaday-links-chain

We love home theater hacks and this one especially since it is also part of a larger home automation project. [Falldeaf] use Z-Wave wireless home automation and includes mains switching for his television. The only problem being that when power is switch back on the TV remains in the standby state. His solution was to use an ATtiny85 to detect power, then push the IR code to turn the TV on after a short delay.

[Pjkim] wanted to prototype using the Tiva Launchpad on his Mac. He managed to get a toolchain up and running that includes the TivaWare libraries. He put together a guide that shows how to set up Eclipse and Energia for the Tiva family. If you haven’t heard of Energia check out the Github Readme.

Most folks have a smartphone and you can bet that the handsets are Bluetooth enabled. But we think there is still a low percentage who are connecting their smartphone audio to wireless speakers. [Anton Veretenenko] shows how you can use some cheap KRC-86B modules from Ali Express to make your own wireless speakers. He’s even powering his hack with a single 18650 Li-Ion cell.

Taking a turn away from electronics we got a chuckle out of [CADFood's] plan to make pearls with his bicycle. He used DesignSpark Mechanical to model what amounts to a bicycle powered ball mill. It attaches to his spokes and after taking a hammer to some oyster shells he loads them up and goes for a ride. Well actually he needs to go for a bunch of rides. The idea is that about six months of bicycling will yield a cache of pearls. [Thanks Holger]

We enjoyed this article on how designing powered scooters is changing engineering education. We’re happy to see that hacking is starting to be widely accepted as a functional and effective way to gain and pass on knowledge.

If you have access to a 3D printer you can own some of the relics from the Smithsonian. They’ve been 3D scanning some pieces in their collection and you can download the models.

And finally, [GravityRoad] is working on building a delta-bot arm to use as part of a performance art project. Check out one of the most recent development videos and if that gets you interested there’s much more on the website. [Thanks Charles]

 

Cloning the Trinket for a USB Volume Knob

LEDs

A while back, [Rupert] wrote a blog post on using V-USB with the very small, 8-pin ATtiny85. Since then, the space of dev boards for 8-pin micros with USB has exploded, the most recent being Adafruit’s Trinket. [Rupert] liked what he saw with the Trinket bootloader and decided to clone the circuit into a useful package. Thus was born an awesome looking USB volume knob complete with a heavy aluminum knob, rotary encoder, and RGB LED strip.

[Rupert] got his V-USB/ATtiny85/rotary encoder circuit working, and at the expense of a ‘mute’ control, also added an awesome looking RGB LED ring powered by Adafruit’s Neopixels. The PCB [Rupert] fabbed is pretty well suited for being manufactured one-sided. If you’ve ever wanted an awesome volume knob for your computer, all the files are available form [Rupert]‘s blog.

Just as an aside, [Rupert] has been working on getting the Trinket bootloader working on the ATtiny84, a very similar microcontroller to the ’85, but with eight analog pins. It’s a neat device that I’ve made a small V-USB breakout board for, but like [Rupert], I’m stuck on porting the bootloader. If anyone has the Trinket/Gemma firmware running on an ATtiny84, send that in. We’ll put it up.

Haunted Dollhouse Microcontroller Networking for World Maker Faire

master-slave-networks

It’s pretty awesome to get see the number of projects presented at World Maker Faire. But we still love digging into the gritty details that only an in-depth build post can deliver. Here we get both. You can see the circuits pictured above in the Circuit Castle exhibit at WMF this weekend, and you can read about how the microcontroller network was built in [Jim's] article.

As the title states, this is a network built for a dollhouse. Each slave device performs a different task; adding color, sound, motion, and interactivity using some sensors.  The post discusses the i2c (or TWI to get around licensing issues as [Jim] mentions) communications used to talk to the ATtiny85 chips on the slave boards. Because the eight-pin package leaves few I/O pins to work with an ATtiny84 was also added. It brings 14-pins to the party, including multiple ADC inputs for reading sensors.

If this ends up being too much of a read for you jog to the “Update 9/17/13″ to get the general overview of progress. Like any project on a timeline, not everything works quite as well as they would have liked it to. But it’s the journey that makes something like this so fun — a fully working project would signal an end to the enjoyment, right?

[via Workshop 88]

A really, really tiny microcontroller board

trinket

Here’s something very cool from the wonderful world of Adafruit: The Trinket, an Arduino compatible microcontroller platform that’s not only small enough to fit in your pocket, it’s small enough to lose in your pocket.

Like the similarly specced Digispark, the Trinket features an ATTiny85 microcontroller with 5 IO pins. Unlike the Digispark, the Trinket is a bit more substantial, featuring 3.3 and 5 Volt regulators along with a real USB port and mounting holes. As this is based on the ‘tiny85, it’s possible to connect this up to I2C and SPI sensors and peripherals

One thing to note about the Trinket is the fact that it’s so cheap. Either version of the Trinket goes for about $8, inexpensive enough to simply leave in a project when you’re done with it. Given the cool stuff we’ve already seen created with the Digispark, including a homebrew stepper motor and an Internet meme and lame pun assessment tool, we can’t wait to see what’s made with the Trinket,

Bluetooth stepper motor driver

bluetooth-stepper-motor-driver

[Dan] salvaged some parts from an old printer a while back and finally found some time to play with them. One of the things he was most interested in is the geared stepper motor seen above. He was able to get it running with an Arduino in no time so he decided to take the project a little bit further. What he ended up with is a stepper motor driver which can be controlled over Bluetooth.

The motor can’t be driven directly, but with a simple motor driver like the L293 chip [Dan] used it’s not hard to interface them with your control hardware of choice. From there he added an ATtiny85 which will take care of the stepping protocol necessary to move the motor. The Bluetooth module he’s using functions as a serial device, making it really simple to interface with the uC. [Dan] uses a pin header to connect the module, so switching to a different type of serial device in the future will be quick and painless.

After the break you can see him sending step commands to the driver board.

[Read more...]