Tag Archives: ATMega32u4 microcontroller

ATmega32u4 + Bluetooth = Blend Micro

RedBearLab has launched the Blend Micro, a mini development board targeted at the Internet of Things (IoT). Powered by Atmel’s popular ATmega32u4 microcontroller (MCU), the board is also equipped with a Bluetooth 4.0 Smart Energy chip.

Blend Micro is compatible with Nordic’s Bluetooth Smart SDK for Arduino, making software development easy via the official Arduino IDE.

So, how does the board work? 

According to the RedBearLab crew, the nRF8001 chip communicates with Atmel’s Atmega32u4 MCU via the ACI (Application Controller Interface). Although the ACI is similar to SPI, it does not actually function as SPI. Indeed, SPI consists of MOSI, MISO, SCK and SS, whereas ACI includes MOSI, MISO, SCK, REQN and RDYN.

“Since the nRF8001 chip may receive data anytime (even when not selected by SPI master) the SS line is not needed. For the ACI, data exchange [is routed] through MOSI and MISO, [while] SCK provides the clock generated by master,” a RedBearLab rep explained.

“When the master wants to request data from BLE Shield, it [shifts] the REQN to low until RDYN line is put to low by BLE Shield. The master then generates the clock to read out the data. After reading out the data, master will release the REQN and BLE Shield release the RDYN, putting them to high.”

The Blend Micro runs at 3.3V to reduce level shifting, since the nRF8001 chip only accepts 3.3V. As such, the onboard LDO converts 5V from the USB power source into 3.3V for the board.

“Normally, you should set Blend Micro to run at 8 MHz/3.3V. However, if you want to run faster and not concern about the reliability (we do not see any issue so far), you can run it as 16 MHz [for a] so-called ‘overclock,’ the rep added.

Interested in learning more? You can check out Blend Micro’s official page here.

ATmega32U4 drives open source LEO ‘bot

The Creative Robotics crew has debuted LEO, an open source robotic kit powered by Atmel’s versatile ATMega32U4 microcontroller (MCU).

Additional key specs include an Arduino bootloader, 12 digital I/O pins via an I2C port expander, configurable pull up/down and interrupt capable, 6 digital I/O directly connected to the ATMega32U4 MCU, two PWM capable pins, four external interrupt capable pins, USART and I2C Serial ports, 12 analog inputs, user programmable button, as well as a ‘COMM Hood’ and ‘IO Hood’ comms expansion system.

Leo also features (dual) four wheel and tracked configurations, front and rear tactile bumpers, dual HUB-ee motor plus slave motor connections, dual wheel quadrature encoder reading (128 counts per revolution), dual motor current feedback, automatic motor disable when powered by USB, Arduino robot compatible connector/mounting holes, as well as comprehensive firmware supporting encoders, external IO, PID Speed control and a serial command set.

“LEO is the product of over a decade of design experience in building autonomous robots, experience that also inspired the creation of our HUB-ee wheels,” a Creative Robots rep explained in a recent Kickstarter post.

“Unlike most small robotic platforms on the market LEO can be reconfigured from simple symmetrical two wheel drive to four wheel drive in a matter of minutes – and [is packaged] with a pair of modular tactile bumpers at each end for basic obstacle detection.”

LEO is also quite moddable, as Makers can easily add expansion boards using a dual ‘Hood’ stacking system.

“Hoods are a bit like shields, you can use them to add functionality like extra processors, manual controls, sensors and wireless radios. We call them hoods because LEO is a vehicle (and cars have hoods) and also to differentiate them from the shield system,” said the rep.

“LEO can have two different types of hood at the same time, one for general analog and digital I/O and a second just for serial and I2C communications. This allows you to fit LEO with a Bluetooth, ZigBee or Wifi module without interfering with the general purpose I/O.”

As noted above, Leo is an open source robot project, with all the PCB schematic design files, CAD files for the bumper and caster wheel available for download under the creative commons attribution sharealike license. Software libraries will also be accessible on GitHub.

Interested in learning more? You can check out LEO’s official Kickstarter page here.

Arduino Yún powers this Foursquare soap bubble machine

Earlier this month, Bits & Pieces took a closer look at Stefano Guglielmetti’s Yún-powered Gmail (alert) lamp that is programmed to ping him in real-time about incoming emails labelled “important.”

And today we’re going to get up close and personal with a Foursquare soap bubble machine built around the versatile Atmel-based Yún.

“When you check in to our balcony with foursquare, a soap bubble machine starts filling the air with bursting bubbles. The first prototype uses Arduino connected to an XBee Wifly to control the soap bubble machine and a Rat Pack server that handles the Foursquare API,” Sven Kräuter explained in a guest post published on the official Arduino blog.

“Quite complex and actually and as you might have guessed the Yún helped reducing both the software and the hardware complexity drastically. Adding it to the project made it possible to cut off a lot of fat. Actually it now only consists of the Yun connected to the soap bubble machine.”

According to Kräuter, what’s true for the hardware is also true for the software.

“Reduced complexity is achieved by processing the response of the Foursquare API on Linino as opposed to letting the Ruby server take care of it,” he continued.

“And although there’s much debate when it comes to JSON processing with regular expressions in general, I just used grep and a matching regexp to extract the information from Foursquare’s JSON response. The parts marked green are the only ones necessary after adding the Yun to the setup.”

Kräuter also noted that he sees the Yún as a major milestone in making the rapidly evolving Internet of Things (IoT) available to a broader audience.

“The Yún will empower fellow makers and tinkerers, [allowing them] to spend less time debugging and more time inventing,” he added.

As previously discussed on Bits & Pieces, the Yún – designed in collaboration with Dog Hunter – is based on Atmel’s ATMega32u4 microcontroller (MCU) and also features the Atheros AR9331, an SoC running Linino, a customized version of OpenWRT. The Yún is somewhat unique in the Arduino lineup, as it boasts a lightweight Linux distribution to complement the traditional microcontroller (MCU) interface.

Understanding the Arduino Yún’s Bridge

The Arduino Yún is based on Atmel’s ATMega32u4 microcontroller (MCU) and also features the Atheros AR9331, an SoC running Linino.

Earlier this week, Bits & Pieces took a closer look at the board’s hardware and today we’ll be getting up close and personal with the Arduino Yún’s Bridge, describing how it helps facilitate communication between the two processors.

According to Arduino’s Federico Vanzati, the Bridge comprises two distinct parts. The first, written in Python, runs on the GNU/Linux processor and is tasked with three primary functions: Executing programs on the GNU/Linux side, providing a shared storage space for data and receiving/relaying commands from the Internet – passing them directly to the Arduino.

Meanwhile, the other part of Bridge is the library that runs on the 32U4, allowing users to access the Linino parts of Bridge through their sketches.

“With the Bridge you can do some awesome things by communicating between the 32U4 and the AR9331 processors,” Federico explained. “Some examples could be commanding and controlling your sketch over the Internet from a remote location, accessing remote APIs to get data for your sketch to process, or executing programs or scripts too complex to write in an Arduino sketch.”

For example, says Federico, if someone at home wanted to know if their office or workspace was comfortable enough to work in, they can simply connect a LDR sensor and thermistor to the Yún on a wireless network.

“Your sketch can access the board’s shared storage to publish the readings every second to a webpage running on the AR9331. By accessing the URL http://arduino.local/data/get you can call up those readings, letting you know if it’s bright enough but not too hot to get to work on your next project. Your sketch could also store the sensor readings on a Google Drive spreadsheet or publish them on Facebook,” he added.

In addition, the Bridge eliminates the need to upload a new version of a sketch to change text on an LCD screen, as sketches can use the shared storage to read the text to display, changing it remotely from a browser using REST based calls. Meaning, if the text to be displayed is identified by the label “lcd_text,” accessing the URL http://arduino.local/data/put/lcd_text/Hello%20World will show “Hello World” on the LCD.

Interested in learning more about the Yún’s Bridge? You can check out Arduino’s official “hands-on” guide to the Bridge here.

A closer look at the Atmel-powered Arduino Yún

The Arduino Yún – designed in collaboration with Dog Hunter – is based on Atmel’s ATMega32u4 microcontroller (MCU) and also features the Atheros AR9331, an SoC running Linino, a customized version of OpenWRT.

The new Atmel-powered board will be available on September 10, so today we’ll be taking a closer look at the Yún’s hardware. As previously discussed on Bits & Pieces, the Yún is somewhat unique in the Arduino lineup, as it boasts a lightweight Linux distribution to complement the traditional microcontroller (MCU) interface.

The Yún also features WiFi and Ethernet connections, enabling the board to communicate with networks out of the box. In addition, the Yún’s Linux and Arduino processors link through the Bridge library, allowing Arduino sketches to send commands to the command line interface of Linux.

“The Arduino Yún has the same footprint as an Arduino Uno but combines an ATmega32U4 microcontroller (the same as the Leonardo) and a Linux system based on the Atheros AR9331 chipset,” Arduino’s Federico Vanzati explained. “Additionally, there are built-in Ethernet and WiFi capabilities. The combination of the classic Arduino programming experience and advanced internet capabilities afforded by a Linux system make the Yún a powerful tool for communicating with the internet of things (IoT).”

According to Vanzati, the Yún’s layout keeps the I/O pins the same as the Leonardo and is therefore compatible with the most shields designed for Arduino.

“With the Yún’s auto-discovery system, your computer can recognize boards connected to the same network. This enables you to upload sketches wirelessly to the Yún,” he continued. “You can still upload sketches to the Yún through the micro-USB connector just as you would with the Leonardo.”

On the connectivity side, the Yún is equipped with two separate network interfaces, a 10/100 Mbit/s Fast Ethernet port and a IEEE 802.11 b/g/n standard compliant 2.4GHz WiFi interface, supporting WEP, WPA and WPA2 encryption. As expected, the WiFi interface can also operate as an access point (AP). In AP mode any WiFi enabled device can connect directly to the network created on the Yún. While a Yún in this mode can’t connect to the internet, it could act as a hub for a group of WiFi enabled sensors.

As Vanzati notes, interfacing Arduino with web services has historically been rather challenging due to memory restrictions.

“[However], the Yun’s Linux environment simplifies the means to access internet services by using many of the same tools you would use on your computer,” he said. “You can run several applications as complex as you need, without stressing the ATmega microcontroller.”

To help engineers and Makers develop applications that can connect to popular web services, Arduini has partnered with Temboo, a service that simplifies accessing hundreds of the web’s most popular APIs. In fact, a Temboo library is packaged with the Yún, making it easy to connect to a large variety of online tools.

Facilitating a seamless connection between the two processors is achieved via the Yún’s Bridge library, which connects the hardware serial port of the AR9331 to Serial1 on the 32U4 (digital pins 0 & 1).

“The serial port of the AR9331 exposes the Linux console (aka, the command line interface, or CLI) for communication with the 32U4,” Vanzati confirmed. “The console is a means for the Linux kernel and other processes to output messages to the user and receive input from the user. File and system management tools are installed by default. It’s also possible to install and run your own applications using Bridge.”

Of course, the ATmega32U4 can also be programmed from the AR9331 by uploading a sketch through the Yún’s WiFi interface. When connected to the same WiFi network as your computer, the board will appear under the “Port” menu of the Arduino IDE. The sketch will be transferred to the AR9331 and the Linux distribution will program the ATmega32U4 through the SPI bus, emulating an AVR ISP programmer.

Last, but certainly not least, the Yún can be powered through the micro-USB connector, the Vin pin, or the optional Power Over Ethernet (POE) module. When powering the board though the Vin pin, users must supply a regulated 5VDC, as there is no on-board regulator for higher voltages.

Additional information about the Atmel-powered Arduino Yún can be found on the board’s official page here.