Tag Archives: microcontroller

Customizing a Pomodoro timer with the ATtiny85 MCU

Robin Scheibler says he has always been interested in Atmel’s popular ATtiny85 microcontroller. Indeed, Scheibler describes the MCU as “minimalist, yet powerful,” making the silicon a very attractive platform for both gadgets and hacks.

Unsurprisingly, Scheibler is also interested various charlieplexing techniques, or the art of controlling multiple LEDs with as few pins as possible. 

Recently, he decided to combine both interests by building a custom timer for the Pomodoro technique – which aims to increase productivity by splitting time into slices of 25 minutes of work followed by a 5 minutes rest period.

“The technique proposes using a tomato shaped kitchen timer to keep track of time, but I designed and built my own,” he explained in a blog post. 

”The ATtiny85, with its 5 GPIO pins available by default (sacrificing ISP yields an extra pin, but I didn’t want to go down that road), seemed like the perfect candidate.”

Aside from the ATtiny85 MCU (as TIMER1), key specs for Scheibler’s Pomodoro timer include a basic user interface (a single tactile switch), buzzer (driven by TIMER0 in PWM mode at 4 kHz, 50% duty cycle) and power (CR2032 lithium coin cell).

In addition, Scheibler assigned the three remaining GPIO pins to LEDs using charlieplexing – driving 6 LEDs using on three pins. On the software side, Scheibler says the code is completely interrupt driven.

“TIMER1 and its overflow interrupt are used to keep track of time during each state, [while] the tactile switch triggers an interrupt to wake up the AVR, or switch between states,” he added.

“Blue arrows are state switching triggered by a push on the button. Red arrows switching are caused by the timer expiration. The main states are black circles [and] the grey circles the transition states. It was important to add the BACKOFF state to debounce the tactile button because it triggered multiple interrupts.”

Interested in learning more Scheibler’s Atmel-powered Pomodoro timer? You can check out the project’s official page here.

LCD flight control board has AVR under the hood



The HobbyKing crew recently released the KK2.1, a multi-rotor LCD flight control board equipped with Atmel’s ATmega644PA microcontroller (MCU).

Essentially, a control board is used to stabilize multi-rotor aircraft (tricopters, quadcopters and hexcopters) during flight. To achieve this, the KK2.1 takes the signal from the 6050MPU gyro/acc (roll, pitch and yaw) and relays it to the ATmega644PA IC.

The AVR MCU processes the signals based on the selected firmware and passes control signals to the installed Electronic Speed Controllers (ESCs). These signals instruct the ESCs to make fine adjustments to the motor’s rotational speed, which in turn stabilizes the multi-rotor craft.

The KK2.1 also uses signals from the radio systems receiver (Rx), passing data to the ATmega644PA via the aileron, elevator, throttle and rudder inputs. Once this information has been processed, the IC sends varying signals to the ESCs, which in turn adjusts the rotational speed of each motor to induce controlled flight (up, down, backwards, forwards, left, right and yaw).

“KK2.1 is the evolution of the first generation KK flight control boards – engineered from the ground up to bring multi-rotor flight to everyone, not just the experts,” a HobbyKing rep explained.

“At the heart of the KK2.1 is an Atmel Mega644PA 8-bit AVR RISC-based microcontroller with 64k of memory. A host of multi-rotor craft types are pre-installed – simply select your craft type, check motor layout/propeller direction, calibrate your ESCs and radio and you’re ready to go.”

According to the HobbyKing rep, the original KK gyro system has been updated to the 6050 MPU InvenSense platform – making it one of the most stable KK boards ever designed and facilitating support for an auto-level function.

An additional header has been added for voltage detection, while a handy piezo buzzer is also included with the board for audio warning when activating and deactivating the board. On the software side, a 6-pin USBasp AVR programming interface helps smooth the way for painless updates.

The KK2.1 is available for $35 on HobbyKing’s official website here.

Making music with the ATmega328 synth kit



Acrobotic Industries is currently selling an ATmega328-powered sound synthesizer kit for a cool $35.

The kit includes all components needed for assembling a monophonic synthesizer. Aside from Atmel’s ATmega328 microcontroller (MCU), key specs and features include:

  • Dual oscillators
  • 6 wave forms (Sin, Triangle, Left Saw, Right Saw, Square, and Flat)
  • Noise setting on the main oscillator
  • Adjustable (weighed) mixing of the two oscillators
  • Adjustable cents, semitone, and octave for the second oscillator
  • Low Frequency Oscillation (LFO) from 0 to 100Hz
  • Routing the LFO to semitone, cents and octave control of the second oscillator
  • 20 note arpeggio feature with adjustable speed from 0 to 50Hz
  • 5 banks for saving presets
  • 3.5mm aux output with volume control
  • LCD screen with backlight control (Nokia 5110)
  • MIDI input for connecting a keyboard
  • UART input for serial communication (e.g., using an FTDI breakout board)

Originally designed by Human Hard Drive (Sam Stratter), the synthesizer was inspired by the DDS signal generator detailed by Martin Nawrath  of the Cologne Academy of Media Arts.

Essentially, 
a stable clock drives a programmable-read-only-memory (PROM) which stores one or more integral number of cycles of a sinewave (or other arbitrary waveform, for that matter).

As the address counter steps through each memory location, the corresponding digital amplitude of the signal at each location drives a DAC which in turn generates the analog output signal.

ddssynth

The spectral purity of the final analog output signal is determined primarily by the DAC, while the phase noise is basically that of the reference clock.

You can pick up the ATmega328-powered sound synthesizer kit for $35 here, while additional information about the Direct Digital Synthesis method is available here.

IoT sensor fusion with ARM and Atmel on Google+



Sensors convert physical world characteristics into raw data that is subsequently processed by various hardware and software platforms. As the name implies, sensor fusion combines sensory data from multiple sources to improve the overall state of the system being observed.

As we’ve previously discussed on Bits & Pieces, ensuring an extended battery life is perhaps the most important criterion for any device with integrated sensors.

On Tuesday, February 18, ARM will be hosting a live Google+ Hangout panel with executives from Atmel, Freescale and Sensor Platforms. 

The panelists are slated to discuss various software and hardware design techniques that can help IoT developers achieve a precise balance between low power sipping and high software complexity.

You can follow the panel discussion and access the live video feed from the following links:

Panelists include:

  • 

Diya Soubra – CPU Product Marketing Manager for Cortex-M ARM Processors at ARM
  • Adrian Woolley – Director of Strategy and Business Development at Atmel’s Microcontroller Business Unit
  • 

Mike Stanley – Manager of Freescale’s Sensor Solutions Division
  • 
Kevin A. Shaw – CTO of Sensor Platforms
  • Will Tu – Director of Embedded Segment Marketing at ARM

We’ll see you on Tuesday, February 18!!!

Building a robot army with the ATmega328 MCU



The Robot Army crew has debuted a DIY Delta Robot kit powered by Atmel’s versatile ATmega328 microcontroller (MCU) for the rapidly growing Maker community.

The kit includes all mechanical pieces in grey and neon yellow plastic (the yellow fluoresces under black light), spacers, brackets, ball bearings and hardware required for assembly. In addition, the kit is packed with electronic components, PCB and wire harnesses.

A more specific hardware breakdown is as follows:

  • 1 brain board PCB
  • 
6 arms
  • 3 servo paddles
  • 
3 servo brackets
  • 1 end effector
  • 
6 base spacers
  • 
4 PCB spacers
  • 
12 steel balls
  • 
3 Power HD servo motors
  • 2 acrylic mounting plates
  • 
1 RGB LED with wire harness
  • 
1 dome light defuser
  • Hardware required for assembly (M3 socket head cap screws)
  • 
1 AA battery holder with switch

The ‘Hex Brain’ PCB, which drives all the servo motors and the colored LED, is powered by Atmel’s ATmega328 MCU, with all pins accessible for use. The brain also includes programming headers so Makers can easily reflash the chip’s memory.

robotstarterkit

On the software side, the PCB is loaded with example code to implement the inverse kinematic math needed to drive a delta robot. Although there are several available routines, the basic skeleton code can be used as an outline for more advanced projects.

Interested in learning more about building a robot army with Atmel’s ATmega328 MCU? You can check out the project’s official Kickstarter page here.

ATmega328p MCU powers µ-nex dev board




The $9 µ-nex dev board – which recently surfaced on Indiegogo – is powered by Atmel’s ATmega328p microcontroller (MCU).

In addition to functioning as a standard development board, the µ-nex can also be used as FTDI breakout board and even as an AVR programmer.

Indeed, µ-nex is currently available in two variants: one targeted at development and the other as a “lite” version for actual deployment.

Though the specs are virtually identical, µ-nex lite excludes on-board USB and offers a lower price tag.

Aside from the ATmega328p MCU, key specs include:

  • Industry standard USB to serial converter with drivers for Windows/Mac/Linux
  • 
16MHz clock speed
  • Hardware SPI & I2C
External power or USB power
  • Input voltage range 7-12V
  • 
Breadboard compatible
  • On board 5V,1A regulator, with supply to breadboard
  • 14 Digital I/O Pins (of which 6 provide PWM output)
  • 8 Analog Input Pins
  • 
External ADC reference pin
Power LED, serial LEDs, user configurable LED
  • Compatible with Arduino IDE for Windows/Mac/Linux
  • 32KB of programmable flash memory (30KB program code space if using Arduino boot-loader)

  • SRAM 2KB
EEPROM 1KB
  • Works with Arduino IDE
  • Measures 17.78mm x 35.00mm

The µ-nex crew has also designed a number of shields, including motor, ICSP, relay and even one that ensure functionality with existing Arduino shields.

In addition, the shields have all pins from the µ-nex available as headers so Makers and engineers can more easily interface with other peripherals and connect multiple shields to increase functionality.

Interested in learning more about the Atmel-powered µ-nex dev board? You can check out the project’s official Indiegogo page here.

Tippmann paintball guns reload with Atmel MCUs

Written by Brian Marts

The game of paintball continues to be a popular activity enjoyed by players of all levels and walks of life. Tippmann Sports has been active in the paintball world since its inception and is one of the premier paintball companies in the industry today.

The sport continues to evolve as players seek to enhance their game with new looks for paintball markers and additional fire power to shoot more balls per second. Indeed, paintball takes on an entirely new level of excitement when a player can shoot 15 balls per second vs. the standard semi-auto mode.

Powered by Atmel’s versatile ATtiny44A microcontroller (MCU), Tippmann’s new HEAT Red E-boards offer significant improvements in functionality and durability. Traditionally, E-board paintball performance has been perceived as somewhat lacking. Although this perception continues to linger in the marketplace, it is clear that older electronic components will ultimately be replaced by boards capable of living up to the Tippmann’s expectations.

What has enabled the dramatic improvement in quality and robustness? Well, prior Tippmann models featured unique E-boards designed for specific products. This approach tapped various suppliers for each design, leading to a cacophony of multiple programming languages, design tools and hardware – all essentially performing the same function.

Atmel was proactive in helping plot a new course that allows Tippmann to utilize a single set of design tools, compile software into core building block functions and enable development of future boards in one common language. This method effectively standardizes the hardware design process, while facilitating reuse of common hardware building blocks.

What does this mean for Tippmann? Previously, it took an average of 18 months to create a new E-board product before the components and software were standardized. Now, Tippmann is able to turn a new design around in approximately 6 months.

Software tweaks were also made to ensure integrity, with hardware optimization increasing the robustness of the solenoid drive circuit. In practical terms, this means we now have the same set of firing modes scaling across our product lines with the ability to dynamically change marker firing characteristics on the fly, all while retaining recently altered parameters. Clearly, the ability to create new firing modes with Atmel’s help has been a major game changer for Tippman.

tippman3

Tippmann’s new HEAT red E-boards have been subjected to the most stringent validation test sequence in the industry. All product designs are subjected to and pass a rigorous validation plan covering life testing, temperature cycling, vibration testing, EMI susceptibility, ESD, water submersion, shock and drop testing.

tippman1

All future board designs will incorporate plug-in battery harnesses and capacitor harnesses. We will also continue to use a single set of Atmel software development tools paired with a common programming language.

Interested in learning more about Tippmann? You can check out the company’s official website here.

Driving alphanumeric LCDs with three wires

Writing for HackADay, Brian Benchoff notes that the HD44780 LCD controller is currently the de-facto method of choice for adding a small text display to Maker projects.

“If you need a way to display a few variables, a few lines of text, or adding a small user interface to a project, odds are you’ll be using one of these parallel LCDs,” says Benchoff.

“These displays require at least six control lines, and if you’re using a small microcontroller (MCU) or are down to your last pins, you might want to think about controlling an LCD with a shift register.”

Indeed, a Maker by the name of Matteo recently chose the ubiquitous ’595 shift register configured as a serial to parallel converter to drive his LCD, a method which requires only three pins on an Atmel-based Arduino board. 

On the software side, Matteo modded the stock Arduino LiquidCrystal library and posted it on Gitbub.

“Most of the functions are left untouched, but for this build the LCD can only be used in its four bit mode,” Benchoff adds.

“That’s not a problem for 99% of the time, but if you need custom characters on your LCD you can always connect another shift register.”

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

Myra: The intelligent robotic lighting system

Hitachi researcher Kawamoto Ken recently debuted Myra, a robotic platform capable of autonomously optimizing lighting conditions. According to Ken, the motivation behind Myra is simple – freeing people’s lives from the constraints of a conventional “fixed” lighting system.

“By sensing what you’re doing (e.g reading, sleeping, eating, etc) using depth sensors, it changes the orientations of the lights to ensure you always have the perfect lighting, no fumbling around with switches needed,” he explained in a recent blog post.

“Conventional room lighting is static (or only mildly flexible). For example, many rooms (especially in Europe) are designed with a dark ambient, with some spots of light. This is aesthetically fine, but what if you decide that you want to read a book in the middle of the room?”

In contrast to traditional lighting arrays, Myra automatically configures itself by recognizing various activities within a residence or office space.

The platform currently consists of three primary components:

  • The Myra Light – Robotic arms with an LED placed strategically around a room, controlled by a central PC.
  • 

An RGBD sensor – Microsoft Kinect or Asus Xtion.
  • 

PC – Responsible for analyzing sensor readings and regulating individual Myra lights.

The Myra light is controlled by a stand-alone Atmel ATMega microcontroller (MCU on a breadboard).

Meanwhile, the LED is fitted with a lens, which provides a fairly strong light beam on a 15° arc.

 On the software side, Myra uses NiTE to “extract people” from the point cloud, tagging individuals and their features.

“This is where much of the hard work happens,” Ken continued.

“Myra first classifies the state of each person into 5 different activities: reading, watching TV, standing, walking, sleeping. Then, ‘lighting targets’ are set according to [individual] activity and postures.”

Although Myra is still very much in development, Ken says he ultimately plans on making the project open source by releasing all schematics and code.

Interested in learning more? You can check out Ken’s full blog post here.

Gauging ambient temps with Atmel’s ATmega32u4

Connor of the Narkidae blog recently put together an easy to read tutorial about using the integrated temperature sensor found on Atmel’s ATmega32u4 microcontroller (MCU) in the TQFP package to measure the ambient temperature.

“I was interested [in] seeing what temperature the microcontroller idled at and if this sensor could be used to detect the temperature of the room. By using a known temperature differential between the ambient air and core, it should be possible to calculate the ambient temperature,” Connor wrote in a recent blog post.

tempcodeatmelmcu

“The Arduino Leonardo and Arduino Micro use the ATmega32u4 so all the code should work without modification. For other AVR boards that use a different chipset, minor modifications to the registers will be necessary.”

On the software side, Connor configured the ADC to read the internal temperature sensor by setting it to 2.56V (internal reference), setting the multiplexer to the temperature sensor and enabling the ADC.

“To calibrate the temperature, I held an ice cube against the ATmega32u4 (in a plastic bag so the board doesn’t get wet) until the temperature reading stabilized around 7C,” Connor explained. 

”Because water has an enthalpy of fusion of 0C (by definition of Celcius), the ice should be exactly 0C. Assuming there is sufficient thermal conduction, the core should be very close to 0C too. From this we know that the core temperature sensor reads 7C too high so I added an offset variable to the calculation.”

Starting at 20C (room temperature), the microcontroller immediately starts heating rapidly until it reaches thermal equilibrium at approximately 24C within one minute. Meaning, the ATmega32u4 idles around 4C above ambient temperature.

“With this information we can measure ambient temperature by subtracting 4 from the temperature measurement after the chip has come to thermal equilibrium,” he added.

It should be noted that a number of Atmel micro controllers feature integrated temperature sensors, including:

  • AT90PWM161
  • AT90PWM81
  • ATmega168A
  • ATmega168P
  • ATmega168PA
  • ATmega16M1
  • ATmega16U4
  • ATmega328
  • ATmega328P
  • ATmega32M1
  • ATmega32U4
  • ATmega48A
  • ATmega48P
  • ATmega48PA
  • ATmega64M1
  • ATmega88A
  • ATmega88P
  • ATmega88PA

Interested in learning more? You can check out Connor’s blog post here and Atmel’s extensive megaAVR portfolio here.