Full SHTTTRRR Control Lets You Take Your Time…

[Glitchmaker] loves photography and wrote in to tell us about his newest project. He has a Canon 1000D camera but, unfortunately, it does not have time lapse capability. So, instead of shelling out a chunk of change for a new camera [Glitchmaker] decided to make an external shutter control device that can continue to instruct the camera to take photos at predetermined intervals. He calls his project: SHTTTRRR. You didn’t think that meant something else, did you?

You can see the unassuming box above, there is just enough stuff packed in there to get the job done, nothing extra or fancy. Luckily, the Cannon camera has a remote shutter input jack that only requires connecting one pin to another in order to take a photo. Inside the box is an ATTINY45 microcontroller. It reads the button pushes from the single panel-mounted button and calculates the time between two button presses. That time between button presses determines the frequency of the photos taken. At the appropriate times, the ATTINY45 signals a transistor to connect the two appropriate pins on the camera’s remote shutter input jack. The device continues to tell the camera to take photos until it is shut off. The result is a series of time-lapse photos that was previously not possible on that camera!

This is a simple project that solves a problem and gets the job done. What’s better than that? [Glitchmaker] is proud of the SHTTTRRR he made and also learned a bunch about programming the ATTINY45 along the way. Check a video of it working after the break.

Continue reading “Full SHTTTRRR Control Lets You Take Your Time…”

Holiday Cheer From The ATtiny13

There are smaller microcontrollers than the ATtiny13. Some ARM chips will fit on the head of a large pin, and even in Atmel world, the ATtiny10 comes in a tiny SOT-23-6 package – a size normally reserved for surface mount transistors. The ‘tiny13, though, can be programmed with just about any ISP and comes in an 8-pin DIP. It’s the bare minimum if you’re looking to break out of the world of Arduino, and you can do some pretty cool things with it, like playing some holiday audio with an SPI Flash chip.

[Vinod] tried opening up a cheap camera pen, but in the course of disassembly a few traces broke. He was now left with a 4Mbit SPI Flash chip. This was obviously the time to investigate what could be done with a small microcontroller and a huge amount of Flash. and the Attiny13 audio player was born.

The circuit uses one PWM for audio out, and reads audio directly from the Flash chip. The UART on board the ‘tiny13 is used to update the Flash, and there’s also a switch to select between play and record. If you’re counting, that means there are 4 pins for the Flash, 2 pins for the UART, 1 for the switch, one for the audio output, and the power and ground rails, all in an 8-pin package. That’s a pretty cool way to use one pin for two different functions.

You can check out a video of the project in action below.

Continue reading “Holiday Cheer From The ATtiny13″

Class D Amp with an H-Bridge

Class D amps are simple – just take an input, and use that to modulate a square wave with PWM. Send this PWM signal to a MOSFET or something, and you have the simplest class D amp in existence. They’re so simple, you can buy a class D amp chip for $3, but [George] thought that would be too easy. Instead, he built his own with an ATTiny and an H-bridge motor driver. No surprise, it works, but what’s interesting is what effect the code on the ATtiny can have on the quality of the audio coming out of the speaker.

The microcontroller chosen for this project was the ATtiny 461, a part we don’t see much, but still exactly what you’d expect from an ATtiny. The heavy lifting part of this build is an L298 chip found on eBay for a few dollars. This dual H-bridge is usually used for driving motors, but [George] found a home for it in the power section of an amplifier.

The ATtiny is clocked at 16 MHz, making the ADC clock run at 1 MHz. A 10-bit precision conversion takes place, and this value sets the PWM duty cycle. Timer1 in the chip is set up to run at 32 MHz, and by counting this timer up to 1023 gives this amp its PWM cycle speed of 31.25 kHz. That’s right in the neighborhood of what a class D amp should run at, and the code is only about 30 lines. It can’t get simpler than that.

[George] put up a video of this amp in operation, and despite not following the standard design of a Class D amp, it sounds pretty good. You can see that video below.

Continue reading “Class D Amp with an H-Bridge”

Transferring Audio to an AVR at 12kbps

Back in the bad ‘ol days of computing, hard drives cost as much as a car, and floppy drives were incredibly expensive. The solution to this data storage problem offered by all the manufacturers was simple – an audio cassette. It’s an elegant solution to a storage problem, and something that has applications today.

[Jari] was working on a wearable message badge with an 8-pin ATTiny. To get data onto this device, he looked at his options and couldn’t find anything good; USB needs two pins and the firmware takes up 1/4 of the Flash, UART isn’t available on every computer, and Bluetooth and WiFi are expensive and complicated. This left using audio to send digital data as the simplest solution.

[Jari] went through a ton of Wikipedia articles to figure out the best modulation scheme for transferring data with audio. What he came up with is very simple: just a square wave that’s changed by turning a pin off and on. When the audio is three samples long without crossing zero, the data is 0. When it’s five samples long without crossing zero, the data is 1. There’s a 17-sample long sync pulse, and with a small circuit that acts as a zero crossing detector, [Jari] had a simple circuit that would transfer data easily and cheaply.

All the code for this extremely cheap modem is available on GitHub.

Adding a Battery Gauge to a Project With Zero Parts

The typical way of doing a low battery detector is throwing a comparator in the circuit, setting it to measure a certain threshold voltage, and sending that signal off to a microcontroller or other circuit to notify someone the battery is going dead. [Josh] has a simpler way using an 8-bit AVR and zero other parts.

The chip [Josh] is using is the ATtiny84. The ADC in this chip is usually used to measure an unknown voltage against a reference voltage. The trick [Josh] is using is to do this in reverse: The internal 1.1 Volt reference voltage is measured against an unknown scale, namely the input voltage.

The value provided by the ADC on the chip will always be Vin times 1024 over the reference voltage. Since Vin will be 1.1 V in this case, the ADC value is known, it’s only a matter of doing some 6th grade algebra to determine the value of the input voltage.

[Josh] put together a small demonstration where the chip blinks out the number of volts its receiving from a bench power supply. By blinking a LED, it can blink out the current value of VCC as integers, but by using this technique you should be able to get a fairly fine-grained reading of what VCC actually is. Video below.

Continue reading “Adding a Battery Gauge to a Project With Zero Parts”

Redesigned Bike Light Controller

[JP] was looking for a bicycle light to do some night biking around his home. He found a reasonably priced light that suited his needs, but when he started using it he found that the controller was a little lackluster. To solve some of its problems, he ended up building his own lighting controller from scratch.

The original controller’s main problem was that the it didn’t debounce the input from the single pushbutton. This meant that a single press of the button might cause it to cycle through two or three different modes, which was inconvenient and annoying. The new controller took care of this along with implementing several new brightness modes and a “strobe” mode for commuting to work to help alert other drivers of [JP]’s presence on his bicycle.

While [JP] notes that an Arduino would have been very easy to use in this situation, it wouldn’t have fit in the original enclosure. He went with an 8-pin ATtiny45, which was perfectly sized for what he needed. Everything fit together perfectly and is much more useful than the original. Maybe next he could pair it with a light that is even brighter than the one he’s currently using.

Inexpensive AVR Programmer Made From Five Components

If you want to program an AVR chip as inexpensively as possible, then [Ian’s] solution might just be for you. He built an AVR programmer using only four components. This design is based on the vusbtiny AVR programmer design, with a few components left out.

[Ian’s] design leaves out two of the resistors and two diodes, leaving just four components. These include a 1.5k resistor, a small capacitor, a USB connector, a six pin header, and an ATtiny45. He admits that this may not be exactly up to USB spec, but it does work.

This is one of those projects that is really an exercise in “will it work?” more than anything else. The fact that you need to first program an AVR chip means that this wouldn’t be useful in a pinch, because you would already have to have a working programmer. Nonetheless, it’s always fun to see what can be done with as little as possible.