All posts by Windell Oskay

About Windell Oskay

Co-founder of Evil Mad Scientist Laboratories.

Basics: Serial communication with AVR microcontrollers

Serial Port Added

One of the distinguishing characteristics of beginner-friendly microcontroller platforms– Arduino, PICAXE, and a few dozen others– is that they neatly wrap up and hide the nuts-and-bolts details of interfacing with the hardware.

Like everything else, it’s a blessing and a curse. The benefits are clear: A new user who has just acquired an Arduino can plug it in, blink an LED, and have a working demonstration of two-way serial communication in just a few minutes.

The drawbacks are a little harder to see. When you just use one line of initialization that calls a “library,” it’s easy to overlook exactly what’s involved: how many lines of code have invisibly been added to your program? What memory structures have been allocated? What interrupts are now going to disrupt program flow and timing? There’s also a portability issue. We often hear from people who got started with Arduino but now want to explore other AVR microcontroller systems, and don’t know how or where to start the migration process.

In what follows we discuss a minimal setup for serial communication with AVR microcontrollers, and give two example implementations, on an ATmega168 and on an ATtiny2313. While this fundamental “AVR 101” stuff, we’re approaching the problem (this time) from the migration standpoint. Suppose that you had an Arduino based project, where you relied on serial communication– using the library functions–between that hardware and your computer. From there, how would you migrate to a stand-alone AVR microcontroller with similar functionality, or even to a different microcontroller?
Continue reading Basics: Serial communication with AVR microcontrollers

Tiny portable AVR projects: ATtiny2313 breakout boards

2313Card - 6
We use a lot of our ATmegaXX8 “business card” breakout boards for the ATmega168 microcontroller. We also still wire up a lot of minimal target boards to use the ATtiny2313 microcontroller, so here’s the missing piece: A simple breakout board for the ATtiny2313.

Continue reading Tiny portable AVR projects: ATtiny2313 breakout boards

The CandyFab 6000

CandyFabLogo-color

Today we are relaunching the CandyFab Project with a new logo and a new wiki site, wiki.candyfab.org.

But more importantly, we are unveiling this new machine, the CandyFab 6000:

CF6k

It’s a brand new CandyFab– still in beta. A clean break, designed from the ground up with almost no parts in common with the original, the CandyFab 4000. All new mechanics. All new electronics. All new software. Smaller but still big: the build volume is more than 10 liters, but it’s now small enough to fit on a desk top.

second

Here’s one of the first objects that we fabbed on the CandyFab 6000: a drilled sphere, about two inches in diameter and layer thickness of 1/15 inch. There’s plenty of room for improvement, and finally we have a machine that can be improved.

Window-2

The machine is designed so that it can be made from scratch– i.e., without dumpster diving for old HP pen plotters. Three axes of quadrature-encoded DC servo motor control. Timing belts and acme lead screws. Food-safe sugar containment. The body is made from laser-cut plywood with acrylic highlights and stainless steel hardware. (Steampunk-compliant brass thumbscrews where appropriate, too.)

Zuccherino

The new modular electronics control platform is called Zuccherino— that’s italian for “Sugar cube.” One Arduino-compatible circuit board per axis. (Our prototype above shows X,Y,Z, Heat, and Air axes, plus a master board.)

It’s an expandable system for all kinds of motion control projects, and we’ll be making kit versions of all of the Zuccherino boards later this summer.

We’ve also got new cross platform control software — called CandyFabulous underway, and it’s looking sweet.

Printing

And… oh can it fab sugar. In the photo here we’re partway through printing an hollow torus eight inches in diameter.

Where from here? Check out more details at CandyFab Project.

Finally, you can see the CandyFab 6000 first hand– this weekend at Maker Faire! We’ll be showing it off at booth #293, in the Expo Hall.

Linkdump: May 2009

Peggy 2 RGB

Peggy 2 RGB
We filled up a Peggy 2 with 2×2 super-pixels consisting of red, green, blue, and white 10 mm LEDs. This makes an easy and big programmable full-color LED matrix.

Peggy 2 RGB
Peggy fits 25×25 LEDs, so if you fill every hole this way, you wind up with a 12.5 x 12.5 pixel RGBW matrix.

And like whoa— you can animate it.

Peggy 2 RGB   Peggy 2 RGBPeggy 2 RGB   Peggy 2 RGB

Yup, there’s video. The video is embedded below, and you can also view it directly at YouTube. (In either case, please excuse the scanline artifacts produced by our camera.)

One thing worth noting (and that we demo in the video) is that you can diffuse the big RGBW pixels into one continuous full-color display by placing a thin diffusing plastic layer above the LEDs– it really works well.

The demo code is an Arduino sketch, based on Jay Clegg’s timer-interrupt style grayscale driver for Peggy (demonstrated here), you can download it here (12 kB Arduino .pde sketch file). Besides the colorful flow shown in the pictures, this code also has a mode to light just the red, green, blue or white LEDs at a time.

17 cool magnet tricks

Here are seventeen of our favorite magnet tricks, projects and demos.

Magnet tricks

Extract batteries from stubborn holders
We’ve all got things that take batteries. Some of them are well designed, and some of them are not. The worst offenders are electronic toys that take (say) half a dozen AA batteries, all of which must be inserted with the correct orientation– spring side first– and pried out, well, somehow. Rather than risk puncturing your batteries by prying them out with something pointy, just use a magnet to lift them out.
Continue reading 17 cool magnet tricks

Linkdump: April 2009

A Bulbdial Clock

bulbdial_1

Last year David Friedman published on his blog Ironic Sans an interesting design concept for something that he called The Bulbdial Clock.

That’s like a sundial, but with better resolution– not just an hour hand, but a minute and second hand as well, each given as a shadow from moving artificial light sources (bulbs).
We’ve recently put together a working bulbdial clock, with an implementation somewhat different from that of the original concept.

Bulbdial - 12
Rather than using three physically moving light sources at different heights, we use three rings of LEDs at different heights. Within each ring, we only turn on one LED at a time, so that we only have a single effective light source– it can light up at different places from within the ring. The three rings are located above one another so that they each project light onto the rod in the middle, making shadows of different lengths.

Additionally, for fun and clarity, we used red, green, and blue LEDs for the three rings, making each shadow hand of the clock a different color. Each ring has 12 LEDs, and the 36 LEDs are efficiently multiplexed by an AVR microcontroller that also handles the timekeeping part of the project. Continue reading A Bulbdial Clock