Tag Archives: microcontroller

Building a vibrating timepiece with an ATtiny85 MCU



A Maker by the name of “qquuiinn” has designed a vibrating timekeeper powered by Atmel’s ATtiny85 microcontroller (MCU). The device – which recently surfaced on Instructables – is described as a watch without a face.

Indeed, time is relayed every quarter hour via a series of pulses on a vibration motor in roughly the same format as an antique grandfather clock. Meaning, if it is 3:15, the motor will generate three long vibrations followed by a single short shake.

As noted above, the watch is built around Atmel’s ATtiny85.

“The ATtiny keeps the time, [while] driving the vibration motor. A transistor is used as a motor driver to current-protect the [MCU],” qquuiinn explained.

“Even though the vibration motor is small, it needs more current the the ATtiny can handle. Finally, there is a button to manually request the time. The entire setup is mounted on protoboard and powered by a coin cell.”

On the software side, qquuiinn programmed the ATtiny85 MCU with an Atmel-powered Arduino board.

Interested in learning more about the Atmel-powered vibrating timepiece? You can check out the project’s official Instructables page here.

Designing an ATtiny45-based business card



A Maker by the name of Simon Bach has created a slick circuit board business card powered by Atmel’s versatile ATtiny45 microcontroller (MCU).



”First I designed the circuit and layout with Eagle. The actual circuit is very simple: four LEDs with resistors of 330 ohm at 4 I/O pins,” Bach wrote in a recent blog post.

“Since only one input and the reset pin on the Attiny is left, I decided to attach the four buttons for input through multiple resistors to an A/D input. Depending on which push-button/resistor combination is pressed, a different value between 0 and 1023 can be read on the A/D input. This value is mapped to a button in the program.”

According to Bach, the photo and contact details were created using Photoshop, with the image framed by a honeycomb pattern. Once the finished layout in Eagle was exported to a PS file, the picture and layout were merged.

“To put layouts on copper board, I use the toner transfer method. The layout is printed by a laser printer and melted with a laminator onto the board,” he explained.

“In order to obtain useful results, the choice of paper on which the layout is printed is crucial. The toner should not be absorbed too much by the paper, but adhere enough to the paper so that nothing smears.”

Before the layout was laminated, Bach cleaned the board and degreased it with acetone. He then proceeded with the transfer, using a fuser salvaged from an old laser printer.

“The board is etched in a sodium persulfate solution, which is heated to about 40 degrees Celsius. The process takes about 20 minutes, swirling the solution supports the etching process,” he continued. “In order to avoid etching away the fine copper traces, I took the card out of the etching bath after the actual circuit was etched completely.”

In terms of programming, Bach connected the Atmel MCU to an Arduino Duemilanove (ATmega168) with matching ISP sketch.

“This little game was also created with the Arduino IDE. Appropriate board settings for ATtiny µC have to be loaded into Arduino IDE before they work with the IDE,” he concluded. 

”The required A/D values for the keys were recorded via an analog input of the Arduino and entered into the final program. Since the A / D values vary slightly by decreasing battery voltage, an upper and lower limit for the respective key has to be specified.”

Interested in learning more about the Atmel-powered ATtiny45-powered business card? You can check out the project’s official page here.

Video: ATmega16 powers this floppy disk jukebox




The earliest floppy disks – developed in the late 1960s – measured 8 inches (200 mm) in diameter and first became commercially available in 1971.

Image Credit: Wikipedia

However, it wasn’t long before the 5¼ inch format displaced its 8-inch one predecessor for most applications, before itself being supplanted by 31⁄2-inch disks. 


According to Wikipedia, the advantages of the ubiquitous 3 1⁄2-inch disk were its smaller size and plastic case which provided improved protection from dust and other environmental risks.

Granted, it’s been quite a while since most of us have seen a floppy disc, especially in an age when DVDs and CDs are already perceived as quite dated. Yet, one can’t help being overcome by a wave of nostalgia when coming across a project utilizing the retired medium. 

Kiu’s (Simon Schoar) RumbleRail is one such example. As HackADay’s Brian Benchoff notes, the engineering and design quality that went into the build puts the device in a class by itself.

“Instead of the usual assemblage of wires, power cords and circuits that accompany most musical floppy drive builds, Kiu‘s is an exercise in precision and modularity,” he explained. “Each of the eight floppy drives are connected to its own driver with Atmel’s ATmega16 microcontroller (MCU) on board.”

More specifically, each floppy is driven by an ATmega16A-AU, while the “heavy lifting” of decoding MIDI files and driving the display is executed by an ATmega1284P-AU.

“The microcontrollers in these driver boards receive orders from the command board over an I2C bus,” Benchoff continued. “Since everything on the RumbleRail is modular, and the fact Kiu is using DIP switches to set the I2C address of each board, this build could theoretically be expanded to 127 voices, or 127 individual floppy drives each playing their part of a MIDI file.”

The RumbleRail is more than capable of operating in standalone mode without a PC. Indeed, MIDI files are loaded from an SD card and decoded by the main controller board.

Interested in learning more? You can check out the project’s official page here.

Storing passwords with the ATmega32U2

Earlier this month, the HackADay crew confirmed that it had chosen Atmel’s ATmega 32U4 microcontroller (MCU) to power an offline password keeper known as “Mooltipass.”

As it turns out, a Maker by the name of Josh is working on a similar offline password keeper, albeit with an ATmega32U2 instead of the 32U4.

Like the Mooltipass, the USBPass is connected to a computer via USB and read as an HID keyboard. Aside from the ATmega32U2, the platform is equipped with a minimal amount of components, including a USB connector, three buttons and a few passives chips.

“A total of 20 passwords can be stored in the microcontroller’s memory, which can be ‘typed’ by the platform using the push buttons,” explained HackADay’s Mathieu Stephan.

On the software side, the USBPass firmware is based around the LUFA USB stack, to which Josh added HID report functionality to facilitate data transfer from his desktop application.

“The latter uses the Linux/Windows/OS X HID API library so bringing his software to other operating systems can be done in no time,” Stephan added.

Although the current version of the USBPass is pretty sweet indeed, Josh says he is working on a second iteration of the platform which will likely boast an OLED screen.

Interested in learning more about the Atmel-powered USBPass? You can check out the project’s official page here and the relevant GitHub files here.

SAM D20 hits EDN’s Hot 100 list

Atmel’s SAM D20 microcontroller (MCU) was recently spotted on EDN’s 2013 Hot 100 Products list. Based on ARM’s powerful Cortex M0+ core, the SAM D20 builds on decades of innovation and experience in embedded Flash microcontroller (MCU) technology. Indeed, Atmel’s SAM D20 lineup sets a new benchmark for flexibility and ease-of-use, while combining the performance and energy efficiency of the ARM Cortex-M0+ core with an optimized architecture and peripheral set.

“We’ve learned a lot about microcontrollers (MCUs) since Atmel launched the first 8051 micro in 1995 and the first AVR in 1996,” Atmel Sr. Product Marketing Manager Andreas Eieland (@AndreasMCUguy) told ARM’s Andrew Frame in July.

“A lot of this know-how is included in the new SAM D20 family: from simple things that make the devices easy to develop with like making the devices pin and code compatible, to more advanced system integration technologies.”

According to Eieland, there are a number of reasons why Atmel decided to move forward and bring a Cortex-M0+ based family to the market.

“First of all, we are a dedicated ARM partner and already have Cortex-M3, Cortex-M4 and Cortex-A5 products available, as well as products based on the ARM9 and ARM7 cores, so ensuring a complete ARM portfolio for our customers by extending the product offering downwards with a Cortex-M0+ was a natural thing to do,” he said.

“Secondly, the Cortex-M0+  market space is growing and we want to make sure that those developers who need more computational power than what you find in an 8 or 16-bit solution can find a product fit with Atmel. And last, but certainly not least, we are confident that mixing our AVR knowledge with an industry standard core allows us to bring a really good, unique and easy to use product to the market.”

As we’ve previously discussed on Bits & Pieces, Atmel’s SAM D20 family is ideal for a wide range of low-power, cost-sensitive industrial and consumer applications including board management controllers, GPS trackers, optical transceivers, appliance UI control units and intelligent remotes.

According to Atmel engineering manager Bob Martin, the SAM D20′s power-saving techniques include an event system that allows peripherals to communicate directly with each other without involving the CPU – with SleepWalking peripherals waking the CPU only upon a pre-qualified event.

“In terms of peripheral flexibility, a serial communication module (SERCOM) is fully software configurable to handle I2C, USART/UART and SPI communications,” he explained. “Meaning, with multiple SERCOM modules on a device, designers can precisely tailor the peripheral mix to their applications.”

Meanwhile, the SAM D20′s QTouch Peripheral Touch Controller offers integrated hardware support for buttons, sliders, wheels and proximity – as well as supporting both mutual and self-capacitive touch (without the need for external components), along with noise tolerance and self-calibration.

Additional key hardware specs include high-precision, 12-bit analog and internal oscillators; 8 16-bit timer/counters; 32-bit real time clock and calendar; real-time performance; peripheral event system, as well as flexible clocking options and sleep modes.

As noted above, the SAM D20 lineup boasts 6 serial communication modules (SERCOM) that can be configured to act as an USART, UART, SPI or I2C. On the scalability side, Flash memory densities range from 16KB to 256KB, with devices available in 32-, 48- and 64-pin QFP and QFN package options.

“In a nutshell, the SAM D20 family extends the lower end Atmel Cortex portfolio, closing the gap between the AVR XMEGA and the Cortex-M3 and Cortex-M4 products,” Martin continued. “The SAM D20 – the first series in this new family – offers 48MHz operation (1.77 CoreMark/MHz), single-cycle IO access and supports a pin-toggling frequency up to 24MHz along with an 8-channel event system. In terms of low-power sipping, we’re looking at <150µA/MHz, ~2µA RAM retention and RTC as well as options between internal and external oscillators and on-the-fly clock switching.”

Interested in learning more? Additional information about Atmels’ s SAMD20 MCU series can be found here.

Building an anti-texting device with the ATmega328

Yesterday we took a closer look at a rather impressive AVR-powered hot glue gun designed by master modder Ben Heck which one tech journalist characterized as “more like an extruder from a 3D printer” than your typical dispenser. Today we’re going to check out an “anti-teen-texting device” created by Heck for concerned parents to install in their kid’s car.

“Of course in my day this problem would have been solved by 1) cell phones barely existing 2) my parents would never have bought me one if they had 3) they also didn’t buy me a car,” said Heck.

As you can see in the video above, the master modder’s anti-texting device is built around Atmel’s versatile ATmega328 microcontroller (MCU), a hand-wired MicroSD card for datalogging and a really loud siren.

Essentially, the device is tasked with detecting the amount of current being drawn by the MicroUSB charge jack: Current being drawn = phone in dock = no alarm.

“If the car is started without the phone in the jack your teen has about 10 seconds to stick it in, else there’s an alarm and the infraction is logged to the SD card,” Heck added.

Interested in learning more about Ben Heck’s Atmel-powered anti-texting device? You can watch the video above or check out additional pictures here.

ATmega328 MCU powers White Bread prototyping shield

Mark Davidson has designed an Atmel-powered (ATmega328) Arduino prototyping shield that can also be used as a stand-alone board for various DIY Maker projects. Dubbed the “White Bread Shield,” the platform is compatible with Arduino UNO boards.

“The left end of the White Bread Shield includes the shield connections and component locations for building a stand-alone board, [while] the right end of the White Bread Shield includes a breadboard-like, prototyping area,” Davidson explained in a recent Kickstarter post.

“The left end of the board allows you to mount everything you need to make the board completely stand-alone. The White Bread Shield uses all through-hole components and connections to allow for easy construction and modification.”

As we’ve previously discussed on Bits & Pieces, Atmel’s 8-bit AVR ATmega328 microcontroller combines 32KB ISP flash memory with read-while-write capabilities, 1KB EEPROM, 2KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers and three flexible timer/counters with compare modes.

The MCU also features internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator and five software selectable power saving modes.

The ATmega328 MCU operates between 1.8-5.5 volts. By executing powerful instructions in a single clock cycle, the device achieves throughputs approaching 1 MIPS per MHz – neatly balancing power consumption and processing speed.

TweakTown reviews Protostack’s ATmega32A dev kit

Protostack’s ATmega32A Development Kit is the first 40-pin AVR dev board from the company, with all other boards based on a 28-pin AVR design. The tricked-out kit was recently reviewed by TweakTown’s Charles Gantt, who described the board as a “winner” for both engineers and DIY Makers.

“The microcontroller (Atmel’s ATmega32A MCU) featured in this kit has ample program memory for even the most code-heavy DIY projects. With all of the extra prototyping space and stackability, only the sky is the limit to what you can put together with this board,” Gantt wrote in detailed TweakTown review.

“The extra I/O that you gain from the 40-pin chip will definitely come in handy in some of my upcoming projects as well. The fact that Protostack includes a power supply on this board is a major plus for me as I have yet to dive in and purchase a proper bench-top power supply.”

According to Gantt, the only drawback to the board is the lack of an on-board USB to UART, which can be solved by adding solder pads for a FTDI FT232RL USB -UART chip as well as pads and holes for the supporting circuitry.

“That said, I do fully understand why Protostack chose to leave these components out. The FTDI chip is only available in surface-mount packages, and for some customers that may be a tough soldering task,” he explained.

“Someone like me would have no issues soldering on one, and I feel that those who may feel that it is too tough of a task could continue to use the 10-pin ISP header as they normally would.”

Nevertheless, Gannt emphasized that he was quite pleased with the kit and plans to use it in an upcoming project that involves Halloween animatronics.

“Protostack has done an excellent job designing a development kit around the ATmega32U microcontroller, [going] above and beyond in extra features,” he concluded.

“With the kit retailing for just $22.85 there is no reason for any maker not to own at least one. The lack of on-board USB to UART conversion will set you back another $18 for a USBASP programmer, but I see that as an investment in which I will use over and over throughout the years.”

8-bit gaming with Atmel’s ATmega328P

A Maker by the name of Petri Häkkinen recently coded an 8-bit game titled Toorum’s Quest II (with visuals by Antti Tiihonen and Juho Salila) – along with an Atmel-powered 8-bit console (ATmega328P MCU) on which to play it.

According to the folks at IndieStatik, the aptly named “Box” console is equipped with 2 kilobytes of RAM, 32 kilobytes of program memory, a resolution of 104×80 and four audio channels. The platform – which is capable of displaying 256 colors along with three sprites per scan line – also supports chiptune music along with the use of NES controllers.

“I am in awe of the ingenuity and drive that it took to create Toorum’s Quest II, as well as the retro micro-console that was made to play it. [The game is a] platformer in which you collect treasures and avoid monsters. The name ‘Toorum’ may be a name familiar to players of Legend of Grimrock,” writes IndieStatik’s Paul Hack.

“You can find notes he left scattered about the dungeon in that game. If you find them all, you get an achievement and unlock the character of Toorum for a subsequent playthrough. Presumably, this is Toorum’s first quest and the reason why the new game is titled Toorum’s Quest II.”

Interested in learning more about the Atmel-powered 8-bit gaming Box? You can check out the project’s official page here.

Single wire communication, with power too

I don’t like the term “single-wire communication, since you always need a ground path. My buddy Joe Betts-Lacroix worked on a system at IBM Research where if you shook hands with someone, your PDA (personal digital assistants) would exchange information like your business cards. The “one wire” was your handshake, and the return path was your body’s capacitance to earth.

Most times when you see “one wire communication”, they really mean two wires, they just don’t count the ground return as a wire. No matter, I still think this is a great technology. So I was delighted to see that Dick Cappels had a great article in Circuit Cellar on implementing a one-wire system using an Atmel ATmega8515 microcontroller.

Single-wire-communication

You can tell Dick Cappels is the real deal since he actually builds the one-wire circuit he describes in the article.

This is Dick’s vamp off the Maxim one-wire products that send power and communicate to a device over a single wire (not counting that return path). This was dreamed up by Dallas Semiconductor, before Maxim bought them in 2001. What I like about Dick’s solution, besides his using an Atmel MCU, is that for a couple of cheap parts, you can do one-wire communications with any peripheral made by anyone, as long as you go slow enough. He calls it analog communication, which I also love.

This does not send a lot of power along with the bits; in fact, you don’t have to send any power if you don’t want to, but you should be able to scale things as needed. It is a subject near to my heart, since I dreamed up a system a few years ago to send power to a motorcycle headlight and communicate to the switches and gauges all over one wire. I will check out Cappel’s design, since we can all learn from each other.

Now a word about Circuit Cellar. You can read that blog post I linked to above, but the article itself is behind a paywall. I can attest, Circuit Cellar is worth every dime if you are a system engineer that is interest in hardware, firmware, and even mechanical hacks. It’s a little on the hobby side, but nobody will do your engineering job for you for 30 or 40 bucks a year.

I mentioned a Circuit Cellar article on a homebuilt DNA sequencer a while back—and I say it again, subscribe and pay the bucks for this great magazine. I thing they have a money-back deal, and best of all, for 230 bucks or so you can get all the old issues on a memory stick, and then add your pdf issues to that stick. Do be aware that it costs extra to get both print and pdf versions.