Accurate Timers With An AVR

timer

An awful lot of microcontroller projects use timers to repeat an action every few minutes, hours, or days. While these timers can be as accurate as a cheap digital wrist watch, there are times when you need a microcontroller’s timer to measure exactly, losing no more than a few milliseconds a day. It’s not very hard to get a timer to this level as accuracy, as [Karl] shows us in a tutorial.

The problem with keeping time with a microcontroller has to do with the crystal, clock frequency, and hardware prescalers of your chip of choice. [Karl] started his project with an ATMega168 and a 20 MHz crystal and the prescaler set at 256. This made the 78.125 interrupts per second, but the lack of floating point arithmetic means one second for the microcontroller will be 0.9984 seconds to you and me.

[Karl]’s solution to this problem was to have the ATMega count out 78 interrupts per second for seven seconds, then count out 79 interrupts for one second. It’s not terribly complicated, and now [Karl]’s timers are as accurate as the crystal used for the ‘168’s clock.

Tentacles And Phalanges Made From Drinking Straws

arnie

He human hand is one of the most impressive pieces of machinery – biological, mechanical, or otherwise – that you’ll ever lay eyes on.  With two dozen degrees of freedom, the hand can gently caress the most fragile flower petal without bruising it, or beat a hammer into an anvil with tremendous force. Simulating the human hand, however, is quite a challenge that requires dozens of servos and complex mechanical linkages. [Tomdf] over on Instructables is able to create hands, tentacles, and other weird biological contraptions using spring-loaded drinking straws and custom-made 3d printed joints.

[Tomdf] got the idea for drinking straw phalanges after seeing a few 3D printed drinking straw connectors meant to be used for creating 3D objects out of disposable plastic tubes. After designing a new spring-loaded joint for drinking straws, [Tomdf] is able to add a few lengths of thread to serve as ligaments to control the segments of drinking straws. It’s a similar setup to the horrible demon spawn we saw at Maker Faire last year, but far more extendable for any project that might pop into your head.

You can check out the drinking straw tentacles in action after the break.

Continue reading “Tentacles And Phalanges Made From Drinking Straws”

Battery Teardown To Get At The Cells Inside

Most of what people call batteries are actually cells. All of the common disposable alkaline batteries from AAA to D are single cells. The exception is the 9v battery which actually has six smaller cells inside of it. [Tom] took a look inside three different batteries to see what cells they’re hiding. Since he no longer uses the batteries for their intended purposes the individual cells may find a new life inside of one of his upcoming projects.

The six volt lantern battery on the left has four cells inside of it. This is no surprise since each zinc-carbon cell is rated for 1.5V. There’s not much that can be done with the internals since each cell is made of a carbon rod and zinc electrolyte ooze (rather than being sealed in their own packages).

Moving on to the rechargeable PP3 battery in the middle he finds the 8.4V unit is made up of seven 1.2V nickel-metal hydride cells. Many of them were shot, but we’d love to see one of the intact cells powering something small like a bristlebot.

The final component is an old laptop battery. Inside are an octet of Lithium Ion cells. The majority register 0V, but a few have 0.4V left on them. This is not surprising. We’ve seen power tool packs that have a few bad cells spoil the battery. It’s possible to resurrect a battery by combining good cells from two or more dead units.

Morse Code Flower Is Trying To Tell You Something

morse-code-flower

To the casual observer this flower looks nice as its illuminated center fades in and out. But there’s hidden meaning to that light. Some of the blinks are longer than others; this flower is using Morse Code.

[Renaud Schleck] wanted to try a few different things with his MSP430 microcontroller. He decided on an LED that looks like a flower as it will be a nice piece of decor to set around the home. To add the Morse Code message he wanted something a bit more eloquent (and less distracting) than purely digital flashing. So he took the dots and dashes of the hard-coded message and turned them into fading signals by using Pulse-Width Modulation.

He free-formed the circuit so that it, and the coin cell that powers it, would fit in the flower pot. A reed switch is responsible for turning the juice on and off. When placed near a magnet the flower begins its gentle playback.

Continue reading “Morse Code Flower Is Trying To Tell You Something”

Color Changing Bag Matches Clothing Color, Tells You What’s Inside

color-changing-shoulder-bag

Adding some lights to your everyday items will certainly give you a style leaning toward the world of Blade Runner. But if you can add functionality to control the blinky components you’ve actually got something. A great example of this is [Kathryn McElroy’s] Chameleon Bag. It’s a shoulder bag with a light-up flap. It can color match your clothing, but she also built some features that will let you know what is inside of the bag.

The project started by using a cardboard template in the size and shape of the bag’s flap. After adding an Arduino to control the LEDs and an RFID reader for an interactive element she sewed a replacement flap that also acts as a diffuser. In the video after the break she demonstrates matching the color of her scarf by reading a tag sewn in the end of it. She then starts loading up all the stuff needed for a day away from home. As the keys, phone, and computer are placed in the bag their tags are read, resulting in different combinations of color. Once everything she needs is inside, the flap turns green and she heads out the door.

This will go great with your illuminated umbrella.

Continue reading “Color Changing Bag Matches Clothing Color, Tells You What’s Inside”

An Amplifier Circuit Good Enough To Eat

Gingerbread-Amplifier-009

[Dino’s] kitchen skills match his hardware hacking prowess. Look really close at the image above and you’ll realize this collection of transistors and passive components is edible. Rather than decorating cookies for the holidays he built this audio amplifier from gingerbread, icing, and candy.

The thing is, [Dino] almost always has that extra touch to his presentations. If you watch the video after the break you’ll notice that the sound is not the crystal clear quality we’re used to hearing in his video. That’s because he used the hardware from which the edible offering was modeled to do the audio for the presentation clip.

After laying out the design using Express PCB he gets down to business. The base, which is gingerbread, looks just like a square of Radio Shack protoboard. To make the diodes he rolled up some tin foil around a screw driver to use as a mold for sugar and water which had been boiled long enough to give a dark color. A similar technique was used to cast the other parts. Everything was tied together using frosting and pieces of red and black licorice.

Continue reading “An Amplifier Circuit Good Enough To Eat”

Three Conceptual Approaches To Driving A WS2811 LED Pixel

driving-a-ws2811

[Cunning_Fellow] published a post with three proof-of-concept approaches to driving a WS2811 LED pixel. We looked at a project early in December that used an AVR microcontroller to drive the RGB package. [Cunning_Fellow] saw this, and even though he doesn’t have any of these parts on hand he still spent the time hammering out ways to overcome the timing issues involved with address the device. His motto is “put up or shut up” when it comes to criticizing projects featured on Hackaday. We love seeing someone pick up an idea and run with it.

The approach in all three cases aims to conserve clock cycles when timing the communications. This leaves the developer as many cycles as possible to perform other tasks than simply telling the lights what to do. One approach is an assembly routine that is just a shade slower but groups all 14 free cycles into one block. The next looks at using external 7400 series hardware. The final technique is good old-fashioned bit banging.

[Photo Credit]