Tag Archives: Adafruit

Playing retro Tetris with Atmel and Adafruit

Eduardo Zola has created a retro Tetris game using Adafruit’s Neopixel Matrix (8×8, x2) paired with an Atmel-based Arduino Pro (ATmega328 MCU).

“The first thing I needed was an RGB display, push buttons or a small joystick and an enclosure. After some research, I found the Adafruit Neopixel Matrix 8×8, which is very easy to apply because it uses a just a single wire interface and simple handy library,” Zola explained in a recent YouTube post.

“So, I used two, which gave me a display of 16 rows and 8 columns of RGB LED (or pixels). For power, I used a LI battery of 3.7V 4400mAh. It was really necessary to put a capacitor (1000 µF, 6.3V or higher) across the positive and negative terminals of neopixel matrix.”

The next step? Determining how to control each Tetris “piece” in the game.

“Moves like left, right, down, fall and rotate – this could be done with five push-buttons – or just one small component [with a] 5-way navigation switch. For the enclosure I used an old plastic box, but any kind of box [will do],” Zola continued.

“After that, I added some sound effects [with] a small speaker 8 Ohm, [as well as] a vibrating motor, which is turned on for each completed line in the game. I also [included] a bar LED display to show the actual level of the game and another one to [display countdown info for the next level].”

On the software side, Zola employed a variation of Valentin Ivanov’s Tetris algorithm with a number of logic modifications to solve a specific memory allocation issue.

“You can create your own version, and add extras features like background music, or an alpha-numeric segment display to show the next coming piece in the game,” Zola concluded.

Interested in learning more? You can check out Zola’s lab page here.

Building a Yún-powered weather station

The Arduino Yún – designed in collaboration with Dog Hunter – is based on Atmel’s popular 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.

The Atmel-powered Yún – which hit the streets late last year – has been used in a wide variety of Maker projects that we’ve recently covered on Bits & Pieces, including an electricity monitor, mesh extender platform, Foursquare soap bubble machine, a Gmail (alert) lamp, water heater regulator and Evil Alarm System.

Today, we’re going to be taking a look at how Marc-Olivier Schwartz built a cloud-connected weather station with the Yún. Aside from the Atmel-based board, key hardware specs include:

  • DHT11 (or DHT22) sensor and 4.7K resistor (for humidity)
  • 
BMP085 sensor on a simple breakout board/Adafruit BMP180 sensor board (for pressure and temperature)
  • Photocell with a 10K Ohm resistor (light level)
  • Breadboard + assorted male-male jumper wires

On the software side, Schwartz used the Arduino IDE, Temboo, DHT library, the BMP085/BMP180 library, unified sensor library and a Google Docs account for the collected data to be analyzed and stored.

“The hardware connections for this project are actually quite simple: we have to connect the DHT11 sensor and then the part responsible for the light level measurement with the photocell. First, connect the Arduino Yun +5V pin to the red rail on the breadboard and the ground pin to the blue rail,” Schwartz explained in a detailed Adafruit tutorial.

“Then, connect pin number 1 of the DHT11 sensor to the red rail on the breadboard and pin number 4 the blue rail. Also connect pin number 2 to pin number 8 of the Arduino Yún. To finish up with the DHT11 sensor, connect the 4.7k Ohm between pin number 1 and 2 of the sensor.”

Next up is the photocell.

“First place the cell in series with the 10k Ohm resistor on the breadboard. Then, connect the other end of the photocell to the red rail on the breadboard and the other end of the resistor to the ground. Finally, connect the common pin to the Arduino Yún’s analog pin A0,” Schwartz continued.

“For the BMP085 or BMP180 sensor, connect the VIN pin to the +5V, GND to Ground, SCL to Arduino Yún pin number 3 and SDA pin to Arduino Yún pin number 2.”

According to Schwartz, multiple Yún boards can be used in various parts of a single residence.

“You can also customize the email alert part: you can build more complex alerts based on the measured data, or set the project to email you the sensor data at a regular time interval,” he added.

Interested in learning more? You can check out Schwartz’s full Adafruit tutorial here.

Soft electronics with Atmel MCUs

In a recent ReadWrite article, Lauren Orsini notes that soft electronics rocked the spotlight during Tech In Motion’s Wearable Technology Fashion Show, with models showing off accessories and clothing that lit up, matched moods and collected or displayed personal data.

As Orsini points out, a lot of wearable activity is centered around companies like Arduino and Adafruit. Both offer wearable electronic platforms powered by versatile Atmel microcontrollers (MCUs).

“Building electronics with your hands is certainly a fun brain exercise, but adding crafting into the mix really stretches your creativity,” says Becky Stern, Adafruit’s director of wearable electronics.

“Sewing is fun and relaxing, and adorning a plush toy, prom dress, or hat with a circuit of tiny parts can make you feel like you’re some kind of futuristic fashion designer. Playing with sensors and conductive textiles breaks electronics out of their hard shells and makes them more relatable.”

Indeed, just like their IoT DIY Maker counterparts, the soft electronics community has adapted various Atmel-powered platforms specifically for wearables, including the Arduino Lilypad (ATmega328V) (developed by MIT Media Lab professor Leah Buechley) and Adafruit’s very own Flora (ATmega32u4), which can be easily daisy chained with various sensors for GPS, motion and light.

“There aren’t any hard numbers on the DIY wearables community, but it’s clear from browsing members’ projects on Instructables that this group is far broader than your typical collection of electrical engineers,” concludes Orsini. 

”Stern also noted that there are 10,000 copies of Flora in the wild, [with] the company shipping them worldwide. According to Stern, it’s simple. Make electronics touchable and watch them take off.”

Video: Building a smart cocktail shaker

Adafruit’s Tony DiCola has created a smart cocktail shaker capable of dispensing classy drinks with nothing less than accurate precision.

“The smart cocktail shaker is a project to help you easily mix drinks using an Arduino, a load cell from a cheap kitchen scale and an Android application,” DiCola explained in a detailed Adafruit tutorial.

“By measuring the weight of a cocktail shaker, an Arduino can send the amount of poured liquid to an Android application over a USB or bluetooth connection in real time. Making a drink is as easy as following the steps on screen – no more guessing or fumbling with measurements.”

As HackADay’s Brian Benchoff notes, DiCola connected a INA125 instrument amplifier to the load cell, instead of trying to interface with the electronics in the scale.

“[Meanwhile] an [Atmel-based] Arduino Micro (ATmega32u4) measures the weight on the load cell… With the known densities of gin, vermouth and Kahlua, Tony can get a very good idea of how much liquid is in the cocktail shaker.”

On the software side, Tony wrote an Android app for his tablet that communicates with the Arduino via Adafruit’s Bluefruit adapter.

“The app receives the current weight on the load cell, displays the current amount of liquor in the cocktail shaker and provides step-by-step instructions for making any cocktail,” Benchoff added.

Interested in learning more? You can check out Adafruit’s detailed build tutorial here.

A delayed echo of human activity



Writing for Fast Company, Carey Dunne describes Space Replay as a giant ball that constantly records and replays the sounds of public spaces, creating a delayed echo of human activity.

“It’s sort of like a scary sculptural interpretation of the playback in your head of that stupid thing you said, only on a grander, more public scale,” writes Dunne.

Space Replay is the brainchild of designers Francesco Tacchini, a Royal College of Art grad student, as well as Julinka Ebhardt and Will Yates-Johnson of Design Products. 

The trio designed the orb using a latex balloon filled with enough helium to be able to lift a battery-powered, Atmel-based Arduino board, an Adafruit Wave Shield and a small speaker.

The components were neatly packed into a plastic cone, the shape of which helps project sound and protect the balloon from being popped by wires. 

The final and lightest prototype – which weighs 120g – includes the above-mentioned electronics, packaging and the balloon itself.

“The designers unleashed this hovering black ball in public spaces,” Dunne explained. “They filmed it lurking in elevators and awkwardly freaking out passengers, floating down the stairs like a terrible omen, replaying people’s conversations and making industrial clanking noises like the soundtrack to one of David Lynch’s student films.”

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

Teaching Arduino in paradise (Maui)



Bill Levien recently packed his bags and flew to Hawaii with a syllabus and a hefty stack of Atmel-powered Arduino boards. His mission? To teach open source computing at “Winterim,” a four-day workshop organized by Jaqueline Peterka and Roberta Hodara at Seabury Hall in Maui.

“With the books and videos that I had in Flow and a few rather large orders from Maker Media and Adafruit, I was able to gather enough course material to ensure that we eased into programming and electronics while laying a strong foundation for tinkering, setting up the students for continued learning beyond the four-day workshop,” Levien wrote in a blog post describing the course.

“On the morning of the first day, we built some basic circuits without a microcontroller to get a feel for prototyping circuits using tactile buttons, potentiometers, force sensitive resistors and ambient light sensors. In the afternoon we went over to the lab to demonstrate how a microcontroller can do many things with the same basic circuits, using code to modify blink patterns, blink durations and multiple LEDs. After some more light coding, we were able to play a melody using a piezo-buzzer via pulse-width modulation.”

By day two, course participants had graduated to using a third-party library, switching statements to decode signals via an infrared receiver which listened for commands from universal remotes to control various outputs.

“We were able to switch on LEDs, control servos and change colors of an RGB LED. We learned to read and sketch schematics and dug into basic programming concepts like switch and if/else statements and for loops,” Levien explained.

“We also got a lot of practice mashing up code samples from books with our own code and modifying them to achieve our desired functionality.”

On the fourth and final day of the course, each student proudly showcased an Arduino-based project including:

  • Temperature probe that activates an LED at 23° Celsius.
  • A game, counted on a 7-segment display and monitored by a PIR motion sensor, which challenges users to press a button as many times as they can.
  • 
Fortune-telling “magic” 8-ball.
  • Motion-activated intruder alarm, armed/disarmed via remote control.
  • 
Motion-activated intruder alarm programmed to play a threatening melody with a buzzer.

Interested in learning more? You can check out Bill Levien’s full post on the Safari Blog here.

Arduboy is an uber-mini game console



A Maker by the name of Kevin has created an uber-mini handheld game console using Atmel’s ATmega328p microcontroller (MCU).

As HackADay’s Brian Benchoff notes, the Arduboy build utilizes a number of unique design techniques.

“The inspiration for this project began when [Kevin] dropped an SMD resistor into a drill hole on a PCB. This resistor fell right through the hole, giving him the idea creating a PCB with milled cutouts made to fit SMD components,” Benchoff explained.

“With a little experimentation, [Kevin] found he could fit a TQFP32 ATmega328p MCU in the Arduino – in a custom square cutout. [Additional] components – including a CR2016 battery and OLED display- use the same trick. The rest of the design involved taking Adafruit and Sparkfun breakout boards, modifying the individual circuits until something broke.”

Kevin’s unconventional PCB design approach ultimately resulted in a handheld game console that measures only 1.6 millimeters thick – and boasts capacitive touch sensors for controls.

So what’s next for the Arduboy? Well, Kevin says he wants to release the design files and source code under a fully open source license and launch a crowd sourcing campaign.

“I also would like to sell [Arduboy] kits on my site and on Tindie,” Kevin wrote on the project’s page.

“[Plus], I would like to design the board with four layers and place the circuit traces entirely on the board interior. This would allow for test points to be placed in standard ISCP and FTDI configuration, eliminating the need for an otherwise custom bed-of-nails programming interface.”

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

Xronos Clock keeps time with the ATmega644p



The Xronos Clock Kit (v2.1) – which recently hit the virtual store shelves at Adafruit – is an open source, hackable and customizable device powered by Atmel’s ATmega644p microcontroller (MCU).

Aside from Atmel’s ATmega644p MCU, key hardware specs include:

  • 

256MB microSD card
  • 22Khz 16-bit Mono uncompressed WAV (audio support)
  • 32×16 Red/Green LED matrix (capable of producing 3 colors: red green and orange)
  • 3x 24mm arcade buttons
  • DS1307 based RTC w/ LIR2032 battery
Digital DS18B20 temperature sensor (-55°C to +125°C)
  • RFM12B (915 Mhz or 434 Mhz) only available in V2 as option
  • USB programming w/ optional FTDI adapter/cable (not included)
  • 6-12 VDC (positive tip) Power Supply
  • 1-3 Watt draw (aprox., depends on Color and Brightness)
  • 7.5″ x 4.75″ x 3.75″ (aprox), 1 lb 8 1/4 oz (687g) w/o external Power supply

The talking clock is equipped with an internal backup battery, while all settings are saved to flash memory (EEPROM). Meaning, alarm setting and preferences will be preserved during a power outage. 

Since all audio files are kept on SD card inside, users can change alarm tones, or replace voice prompts with their own.

Additional features include:

  • Dual custom alarms
  • 10 alarm tones, such as melodies or special effects like trains, thunder or police sirens
  • Change display color to green, red or orange
  • 12 or 24 hour mode
  • Celsius or Fahrenheit selection for temperature sensor
  • Ambient light sensor automatically adjusts display brightness
  • Easy access to micro SD card, backup batter and FTDI

The Atmel-powered Xronos Clock Kit (v2.1) is currently available on the official Adafruit store for $215.

Gabriella Levine talks OSHW, Arduino and China



Simone Cicero of Open Electronics recently sat down with Gabrielle Levine, the newly appointed president of the Open Source Hardware Association (OSHWA) to discuss a wide range of topics, including the rapid evolution of the open source movement, Arduino boards and China’s key role in the hardware space.

“I believe it is becoming commercially strategic for companies to release open source hardware tools and platforms. Because tech innovation is happening so rapidly, companies have to innovate quickly,” Levine told the publication.

“As the trend of open toolkits and information becomes more mainstream, no longer will patent ownership be the driving force behind success, but success will come from the best technology that is fastest to make it to market. Releasing open source hardware is certainly commercially beneficial in some ways for companies and for consumers.”

According to Levine, OSHW allows consumers to control, modify and personalize various platforms or tools. In turn, this facilitates healthy competition within the market, while accelerating product proliferation via derivatives.

“For example, Arduino has created a market share based upon both Arduinos as well as derivatives. Additionally, open source hardware can contribute to commercial success because it puts so much emphasis on ‘the Brand.’ [Remember], Arduino became known globally due to attribution,” she explained.

“Another example is Sparkfun and Adafruit. These companies seem to survey what sensors the community is using, see what people have made and then decide to produce their own products or sensors based on what they see is popular, or even based upon the designs of some of the community.”

Levine also commented on China’s role in hardware innovation, noting that it boasts fast-paced manufacturing, along with inexpensive tools and materials.

“I believe China is going to be a huge driving force in the open source hardware landscape. There are many similarities between [the local concept of] Shanzhai and the open source hardware community,” she said.

“Both Shanzhai and open source hardware projects borrow information, tools, source code, CAD files and techniques; both improve upon other’s work to accelerate development. What differentiates Shanzhai from open source hardware projects is that it doesn’t build upon the work of others for increased innovation, but it exactly copies and prices it lower.”

Last, but certainly not least, Levine said Germany, Netherlands and Japan are at the forefront of design and innovation. As such, the trio will play a “big role” in making the open source hardware movement more mainstream.

Interested in reading more? 

The full text of the Open Electronics interview with Gabrielle Levine can be accessed here.