Stereo Amplifier With Digital Volume Control

A regular Hack A Day reader sent in a tip about an LM386 stero amplifier with digital volume control. The resulting build is very professional and could easily be adapted into a slick iPod dock build.

We’ve seen a few LM386-based amplifiers over the years including one that fits inside a 9V battery, but this is the first implementation of digitally controlled volume we’ve seen. The volume control of this amp uses the DS1868 dual digital pot IC in place of the usual 10K pot providing 256 steps between zero and full volume. The DS1868 is controlled by a PIC μC with a 3-wire serial connection, although this could be implemented on any microcontroller.

Although the code provided with this build outputs volume as a linear function, it would be trivial to implement a logarithmic volume output. Because the ear perceives loudness on a logarithmic scale, this would be a great way to adjust audio volume and provide a more fine-grained control. Of course this could be implemented with a logarithmic pot, but where’s the fun in that?

Check out a video of the amp after the break.

Continue reading “Stereo Amplifier With Digital Volume Control” →

Building An Up-to-date MSPGCC Toolchain

[Sergio Campamá] wrote in to tell us he’s assembled a guide for compiling the latest release of MSPGCC. This is a cross-compiling tool chain for the popular MSP430 line of microncontrollers. We used a version available from the Ubuntu repositories when developing with the TI Launchpad and the eZ430-F2013.

Installing from repositories is easy, but you don’t get the newest features and often newer hardware isn’t supported. [Sergio] reports that the newest version, called Uniarch, pulls source code and header files from the middle of this month and supports over 300 devices. In fact, it specifically outlines the goal of making new hardware easier to incorporate than with previous versions. He’s tailored this guide specifically for Ubuntu but while we were wading through a Google search we also found a page that outlines compilation for OSX.

We didn’t really notice before, but GitHub sure does make those README.md files look nice when viewed on the web, doesn’t it?

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” →

Pulse Width Modulation With Microcontrollers

Those following the ProtoStack tutorials will be happy to hear that there is a new installment which explains Pulse Width Modulation. If you’ve never heard of PWM before, it’s a method of generating a signal that is logic 1 for a portion of the time and logic 0 for the remainder of the time. It is the most commonly used method for dimming an LED, and that’s [Daniel’s] example in this tutorial. But you’ll also find it used in many other applications such as servo motor control and piezo speaker control.

[Daniel] starts off with a brief explanation of duty cycle, then moves on to some examples of hardware and software PWM. Many of the AVR microcontrollers have a hardware PWM feature that allows you to configure a pin that toggles based on a target timer value. This is demonstrated using an ATmega168, but a method of using interrupts and your own code is also covered in case you don’t have a hardware PWM pin available.

Enhancing Simple Circuit Kits With Microcontrollers

picaxe_powered_circuit_learning_kits

[manuka], aka [Stan Swan] is a teacher in New Zealand who enjoys enlightening his students on the wonders of electrical circuits. He primarily uses “snap connector” circuit kits, sold under the BrainBox name in NZ, for his interactive labs as they can be easily manipulated by pupils of all ages.

While the kits are great, he says that the range of experiments they provide can be a bit limited, so he decided to swap out the kit’s sound module for something far more useful – a PICAXE-08M. The space left by removing the sound module was pretty small, but [Stan] got everything to fit without too much hassle. His modification allows his students to program the PICAXE, as well as utilize four of the uC’s output pins.

Needless to say, the addition of the PICAXE module was a huge hit with his students, allowing them to create far more exciting circuits. [Stan] has been revising his system over the years, adding extra output pins, enabling lamp and motor control, as well as tweaking his setup to respond to IR commands.

We think [Stan’s] work is pretty awesome, and we’re still wondering how this flew under our radar for so long. He says that his students vary from preschool kids to centenarians, so if you’ve got someone that you would like to introduce to the fun world of electronics, we suggest picking up one of these kits and getting to work.

[Thanks Haku]

Use FPGAs The Easy Way With Alien Cortex AV

alien_cortex_av_fpga_board

Hackaday reader [Louis] wrote in to call our attention to a neat project over at Kickstarter that he thought would interest his fellow readers. The AlienCortex AV is a pre-built FPGA board from [Bryan Pape] with gobs of ports and a ton of potential. At the heart of the board is an Xilinx PQ208 Spartan 3e 500k FPGA, which can be configured to perform any number of functions. The board sports a healthy dose of analog and digital I/O pins as you would expect, along with PS/2 inputs, VGA outputs, and even a pair of Atari-compatible joystick ports.

The AlienCortex software package allows users to easily load projects into the FPGA, which can run up to four different emulated microcontrollers at once. The software comes with half a dozen pre-configured cores out of the box, with others available for download as they are built. The default set of cores includes everything from a 32-channel logic analyzer, to a quad processor Arduino-sketch compatible machine.

Now, before you cry foul at the fact that he’s emulating Arduinos on a powerful and expensive FPGA, there’s nothing stopping you from creating an army of whatever microcontrollers you happen to prefer instead. We’re guessing that if you can run four Arduinos on this board at once, a good number of PICs could be emulated simultaneously alongside whatever other uC you might need in your next robotics project. A single board incorporating several different microcontrollers at once doesn’t sound half bad to us.

Tiny Morse Code Trainer

[Eric] wanted to teach his kids Morse code, so he built a tiny Morse code trainer.

[Eric] built the trainer around an ATtiny85, and the rest of the circuit follows this minimalist idea. After connecting a piezo beeper and 6-pin ISP header, the only thing left to do was write a little code and start teaching his kids Morse. The Morse trainer is programmed to repeat the message, “SOS the moon rover has broken down and I am stuck in the trash can in the garden shed,” [Eric] planted a Lego moon rover in his shed as a prize for learning Morse, making him one of the coolest dads ever.

Although learning Morse isn’t required for an amateur radio license anymore, it’s a requirement for continuous wave radio. We think this is a great way to learn Morse the right way – actually hearing the characters – instead of memorizing the Huffman tree of Morse characters.