Tag Archives: DIY projects

Make your houseplants smile with ATtiny85

This simple sensor can tell you exactly how your plants “feel.”

Faced with hectic schedules, it is often easy for us to forget to water our favorite plants. Typically the strong and silent type, plants likely won’t notify you when they are in need of a drink or some nutrients. However, that may all change after one Maker’s clever Atmel based design which now provides plant owners with a visual representation of just how their plant is feeling.


“Thanasisloi7” hooked an ATtiny85 to a soil hydrometer sensor that analyzes the current moisture within the plants soil. When the soil is properly watered, an LED matrix displays a happy face. Conversely, when the soil moisture falls below a specified level, the smiling face disappears. Thus, any plant owner with common sense can know when to replenish the pot’s water supply.


Though just a simple project, this quick design will make sure you never let your plants go thirsty again. As they say, a smile is worth a thousand words. Looking to build a better bond with your plants? Check out his official project page here.

This isn’t the first time once-ordinary objects have been transformed into “sentient beings.” Last summer, digital agency Soap Creative launched Cars That Feel, an interactive festival installation designed with Toyota. The project featured a number of cars, each of which boasted their own personality and connected with people via light projections, color and sound. The vehicles were equipped six internal BenQ projectors, Atmel powered controllers and high intensity LED light rigs. Meanwhile, a custom app was tasked with controlling internal projection mapping, lighting, sound and animation.

Tutorial: Building cool projects with MCUs (Part 5)

I finally received the circuit boards! And, in this fifth and final part of the microcontroller tutorial, we are going to solder the components to the circuit board and program the MCU using the USB port of a computer.

Just to refresh our memories, so far we have learned:

Microcontroller PCB

I recently ordered the PCBs from Seeed Studio. In order to expedite their delivery, I used a more expensive shipping option from UPS. I did get the boards pretty fast – but I also got an unexpected bill from them because they had to take it through customs.

So, even though the boards were only $10, I ended up with paying about $60 in shipping and customs… But luckily, there exists a much cheaper shipping option (about $3-4) – you just have to wait a little bit longer for the boards to arrive.

Let’s solder the board!

I wanted to make this circuit in such a way that it was possible to make it at home. To solder the circuit, I’m going to use my old Ersa soldering iron and some standard solder wire. The tip of the iron is a bit thick, so it’s really not ideal for this job. However, I know many people only have a simple soldering iron like this lying around the house – so it’s the perfect test to see if this is something that anyone can build from the comfort of your home.

Ersa30 Soldering Iron

The first thing we’re going to solder is the MCU chip. This is also the hardest part to solder. I have to admit – when I looked at my soldering iron, then looked at the chip – I was a bit worried that it was going to be hard. But the main trick here was to be patient!

To solder the surface mount components, we can use the techniques described in this smd soldering article.

First, we solder one corner pin of the chip. When we have managed to solder this one pin correctly – and all the pins are aligned over their pads – we move on to the corner on the other side. With two corners soldered properly, all we need to do is to add a tiny bit of solder to all the other pins and pads.

MCU chip soldered

Don’t rush it. Take your time. Inspect the pins closely to see if they are soldered and that they don’t have a “solder bridges” to their neighbors. And, don’t worry if it looks a bit like a war-zone with solder all over – just look at mine above – it still works!

Now, safe to say that the worst part is over. The other components are pretty straightforward to solder. Just make sure the LED and the polarized capacitor is placed in the correct direction.

Microcontroller circuit board

Programming the circuit

Once we are confident that the components are soldered properly, it’s time to test it! First, we need to check if the USB interface works. Otherwise, we won’t be able to program the circuit. To test the USB interface, all we need to do is to connect a USB cable and connect the circuit to our computer. From there, we can just check if it pops up as a USB device on the computer.

And… it does!

So, let’s program the MCU. A simple way of testing it is to make an LED-blink program. This is a simple program that, well, makes our LED blink. It looks like this:

#define F_CPU 1000000 // The chip runs at 1 MHz as default (even if you are using a 8MHz crystal)


int main(void)
DDRC = (1<<PC7); //Sets the direction of the PC7 to output
PORTC = (1<<PC7); //Sets PC7 high

_delay_ms(500); //Wait 500 milliseconds
PORTC &= ~(1<<PC7); //Turn LED off

_delay_ms(500); //Wait 500 milliseconds
PORTC |= (1<<PC7); //Turn LED on

return 0;

We save this code in a file called led-blink.c

Compiling our code

The first thing we need to do is to compile our code into machine code that the MCU can read. One way of doing this is through Atmel Studio. But, since I am a big fan of using the Linux terminal, I’ll show you how to compile and upload a program using Ubuntu.

First, install avr-gcc with the command:

sudo apt-get install avr-gcc

Then, compile the code and make it into the right format with the following commands:

avr-gcc -mmcu=atmega32u2 -Os blink-led.c -o blink-led.out
avr-objcopy -j .text -j .data -O ihex blink-led.out blink-led.hex

The resulting file – blink-led.hex – can now be uploaded to the microcontroller. You can find more information on the commands here.

Uploading the code to the MCU

Time to upload the program and see if it works. One way to do this is by using Atmel’s FLIP software. But, once again, let’s see how we can do it with the Linux terminal.

Install dfu-programmer with the command:

sudo apt-get install dfu-programmer

Then, erase the old flash memory on the MCU and upload the compiled .hex file:

sudo dfu-programmer atmega32u2 erase
sudo dfu-programmer atmega32u2 flash blink-led.hex

Unplug the circuit from your computer, then plug it in again. And what do you know, the LED starts to blink!

Blink LED microcontroller circuit

Making something cool

Now that we’ve got it working, we’re ready to make something cool. There are so many cool things you can make with a microcontroller. For example, you can connect it to this Wi-Fi module and make the LED blink every time @AtmelMakes posts a new tweet.

Or, how about connecting it to this sound module and this motion sensor, and make it play a Christmas song every time someone goes near your Christmas tree? As Atmel always says, the possibilities are truly endless.

If you missed any of the previous parts of this tutorial – you can find them here:

3D print your very own working Stargate

While it may not be able to create an actual wormhole just yet, one Maker recently devised her own 3D-printed, Arduino-powered Stargate that actually dials.


Cara McNab brought the project to brought to life using an AT90USB1286 powered Printrbot Simple Metal 3D printer extruding gray (and some transparent ) PLA materials, before adding a stepper motor to drive the inner ring and 5mm NeoPixels to light up the chevrons. To round out the build, the DIY Stargate is controlled by an Arduino Uno (ATmega328) along with an Adafruit Motor Shield that uses a customized Arduino sketch.


“The gear was modified to snugly fit onto the stepper motor, and added a hole through which the stepper motor could be tightened to its mount,” McNab notes. “I combined some parts that were 2 pieces into one piece so that the build required less gluing and was structurally stronger.”


The entire creation measures just over 16 inches wide, making it a suitable decoration for any diehard Stargate fan — or for those with some serious intergalactic travel aspirations.

Intrigued? Well, travel on over to the project’s official page on Thingiverse here. You may also get a kick out of this ATmega2560 based DIY wormhole actualization machine as well.

Play games on 3DS using a GameCube controller

A common problem among video gamers playing Nintendo 3DS is using the circle pad for prolonged periods of time. In response to frequent hand cramps and broken pads, a Maker by the name of “dekuNukem” decided to mod his 3DS enabling the use of a GameCube controller to play Super Smash Bros. on the handheld console.


In his open-source project, the Maker used an Arduino Nano (ATmega328) to read input from the GameCube controller, then replicate the actions to the Nintendo 3DS with a maximum delay of less than a millisecond.


According to dekuNukem, users can also customize and adjust button mappings between the controller and 3DS with a LCD screen, which for his build, he utilized an old phone display.

“When you’re done, simply remove the microcontroller and GameCube cable to make it just as portable as before,” he notes.

Interested in learning more? You can check out dekuNukem’s project page here, and get ready to say ‘so long’ to thumb cramps!

Tutorial: Building cool projects with MCUs (Part 3)

As we proceed onto the third portion of this microcontroller tutorial, let’s first revisit what we have accomplished thus far.

In Part 1, we defined what a microcontroller actually was. I wanted to get everybody on-board (no pun intended) for this, so I started from scratch. Feel free to jump back there if you need a refresher.

Then in Part 2, we looked at the various types of MCUs. And, it turns out that there were a lot! However, by using Atmel’s selection tool, we managed to narrow it down to a few different ones, before choosing a winner — an ATmega32U2. Why? Mainly because it can be programmed through the USB interface without any extra components or tools, and since it did not have too many pins – so we should be able to solder it at home.

Now, the time has come for us to design the circuit diagram. We’ll start with outlining what we need, then we’ll dive into the datasheet to figure out exactly how we can do this.

Microcontroller in a circuit

What Components Do We Need?

If you’ve never done it before, putting all the necessary components onto the circuit diagram is not a super easy task. Well, the process is not that hard; but until you know how to do it, it will seem a bit difficult. So, let me take you through my thought process:

We need to power the chip somehow. There are some pins on the microcontroller that need power. We have to figure out which pins that need power, and what voltage they need.

We also want to program the chip trough USB, so we need a USB connector and learn how to connect it to the chip.

Then, there is extra stuff. Like maybe an LED to play around with, and definitely some connection pins that we can connect other stuff to later when we want to experiment.

So, we need to figure out:

  • How to power the circuit
  • How to connect the USB part
  • How to connect pins to the chip

Using the Datasheet to Find the Details of Our Circuit

The datasheet for the ATmega32U2 is a must when we are designing our circuit. Here, we can find all the necessary technical details.

We don’t have to read it from beginning to end; instead, we simply look up the parts we are curious about, and study them in more depth. We can find a table of contents at the end of the document.

For instance, if we wanted to use the timer of the MCU, we’d look up the part about timers. If we wanted to use the SPI communication part, we would look that up.

Connecting Power and USB

As you probably know, USB devices can be powered through, well, USB. By doing this, we simplify our circuit and require less components. So, let’s do this.

To figure out exactly HOW we can do this, we’re going to read the datasheet. By going to the table of contents, we find that the section that describes the USB part of the microcontroller is on page 186.

Here, there are different images showing how to connect the USB connector to the microcontroller to make it a USB powered device. For our circuit, we’ll use the bus-powered 5V version:

How to setup the MCU as a USB-powered device

Under Design Guidelines on page 189, we find the exact values we need for the resistors. It’s also there that we learn it’s highly recommended to use a 10µF capacitor on the VBUS, so let’s add that too.

Adding a Crystal

Another interesting thing to note from the image of how to connect the USB, is that there is also a crystal and a couple of capacitors connected to the XTAL1 and XTAL2 pins. This gives us the idea that we probably need a crystal too. But why?

Microcontrollers rely on clock signals to work. Every time the clock signal gives a pulse, something will happen in the processor. Most MCUs come with an internal RC-oscillator that can create this clock signal; however, the USB part of the microcontroller cannot operate from this internal clock — it needs a crystal oscillator to work.

To create a crystal oscillator, we need to connect a crystal and two capacitors to XTAL1 and XTAL2. By looking up “Crystal Oscillator” in the datasheet on page 36, we can also identify exactly what crystal and which capacitors are required.

Connecting an LED And Some Pins

By now, we have everything we need for the microcontroller circuit to work. But, we won’t be able to have much fun with it if we don’t add some connections to the input and output pins. And, it’s also good to add an LED. Everything gets better with an LED!

The LED needs to be connected through a resistor. We call this a current limiting resistor — this is to control the amount of current going through it.

From there, we will need a few physical pins that we can use to connect other stuff to our circuit. There are 22 I/O pins on the ATmega32U2, yet some of the pins are used for other purposes (like XTAL2), so we can’t use them all. For this circuit, we’ll add 16 I/O pins, as it’s a nice and round number.

What Else Do We Need?

On MCU circuits, it’s very common to include a RESET button. This makes it possible to reset the MCU without removing the power connection. This will add a couple of more components to our circuit and isn’t necessary to make it work, but it’s very handy, so let’s add it.

In the datasheet, we can see that pin 24 on the chip is the reset signal. It has a line over itself, which means that it’s activated when pulled low.

To make the reset signal stay in a high-state when the button is not pushed, we’ll add a pull-up resistor. This is a resistor up to VCC. And, we connect the button so that it will pull the reset-pin to ground when pushed.

The pull-up resistor should have a value of around 10k Ohm. For reference, SparkFun has a good article on how to choose a pull-up value.

Our Microcontroller Circuit Diagram

Now that we have figured out the different pieces of the circuit, it’s time to put them all into one circuit diagram. By adding everything into one circuit diagram, we end up with this:

Complete microcontroller circuit

Next, we need to create a circuit board out of this. Creating a circuit board does not have to be very complicated. In the subsequent part of the microcontroller tutorial series, we’ll design and make the circuit board.

Stay tuned for Parts 4-5 in the coming days…

Tutorial: Building cool projects with MCUs (Part 1)

I don’t remember exactly when I learned programming, but I played around with computers from an early age. I remember that it was such an amazing thing to be able to make my own programs. I made games and I made websites. And, it was so fun. When I was around 14 years old, I also started playing with electronic circuits. I made simple circuits of blinking lights and such. Also, a lot of fun.

Then at one point, I discovered microcontrollers. Oh, my God. I realized that by using microcontrollers I could combine programming and electronics to build robots, music players and what-not. It was a shockingly cool discovery. Wow!


But understanding how to use a microcontroller wasn’t straightforward. There were programmers, EEPROM’s, debuggers, integrated development environments and a lot of different types of microcontrollers. It took me a few years before I started building projects using microcontrollers. Not because it took that long to learn it – but because the whole thing felt so overwhelming. And, I didn’t know where to start. But once I committed to just figure it out, it was actually quite fast to get up and running.

In this five-part microcontroller tutorial series, I will take you from knowing nothing – to being able to build and program a microcontroller circuit from home. To make sure we have everybody on board – let’s start from scratch by taking a look at what a microcontroller is.

Like a Tiny Computer

A microcontroller is somewhat like a tiny little computer. And, simiar to a computer, you can hook up things like a display, a motor, buttons and much more to it. Then, you put programs onto it and run them to make it do something.


The things you can use a microcontroller for are endless! Among the countless possibilities include building robots, flying quadcopters, music players, or even smartphones.

Learning how to use microcontrollers opens so many opportunities for building new cool projects. Throughout this microcontroller tutorial, you will learn all you need to know, step-by-step, in order to get started with MCUs.

Getting Started With Microcontrollers

Let’s start by taking a closer look at the microcontroller chip. The chip has several pins, most of them input and output pins. The microcontroller uses these pins to interact with the outside world.


However, a microcontroller doesn’t really do anything without getting any instructions. So to make it do something, you need to write a program and load the program onto the chip. This process is often called programming the microcontroller.

In the program, you use code to read from input pins, and to control output pins. By connecting something, such as a light-emitting diode (LED) to an output pin, you will be able to switch the light on and off from your program. If you connect a push-button to an input pin, you can use code to read the pin and see if the button is pushed or not.

Then, you can create code that turns the light on when the button is pushed, and turns the light off when it is not pushed. Not a very exciting example, I agree, but a very good place to get started. Think of it as the “Hello World” of microcontrollers.

We could easily turn this into a much more interesting application.

Connect a temperature sensor to an input pin instead of the button. And keep the LED on the output. Create a program that reads the temperature and if the temperature is above a certain level, start blinking the light.

Now, attach this to your beer, and a light will start flashing to warn you that your beer is getting warm. Now that’s useful!

Programming a Microcontroller

Okay, so how do we get from having this idea of what to make, into actually creating it? First of all, we have to create a circuit, then we need to program the microcontroller.

Creating the circuit is a matter of creating a schematic with the components we need, then turning this into a circuit board. I’ll show you how to do this later in this tutorial.

When you have your circuit ready, you need to program your microcontroller. I found this a bit confusing in the beginning. There are many ways of doing this, and not all methods work on all microcontrollers.

The steps you need to go through in order to get your program onto the microcontroller can be divided into the following:

1. Create program code
2. Compile the code into machine code
3. Upload the machine code onto your microcontroller

These steps will be different for different types of microcontrollers. When we get to the programming part of this tutorial, I will show you exactly how to do it for the microcontroller we choose.

But choosing a microcontroller can be a very overwhelming task, especially if you are just starting out. In the next part, I’ll show you what is going through my head when I choose a microcontroller – so that you’ll know how to choose one for your next project.

Stay tuned for Parts 2-5 in the coming days…

Creating an automatic cat laser with Arduino

When it comes to cats, one thing is for certain: They love countless hours of laser chasing. Unfortunately, as a pet owner, there is only so much time in the day to spend twirling around a pointer catering to its innate prey drive. That is why a Maker by the name of Joe recently devised the CatBot, an automated cat laser.


Equipped with a pair of servos, an inexpensive laser and an Arduino Uno (ATmega328), the DIY toy will be an immediate hit with your feline friend.


Cat lovers with not enough time on your hands, feel free to thank Joe. Now, watch the device Laser Zeppelin glory below!

Interested in creating one of your own? Head on over to Joe’s official Instructables page in laser-like speed!


ATmega328 controls this hot plate’s temperature in the lab

In a laboratory setting, precision is essential. When heating up liquids, being even a degree off could spell ruin for an experiment. Therefore, Maker BrittLiv developed a DIY programmable heating pad that can run intricate temperature ramps – for only $100!


As a chemical and biological engineering student, BrittLiv was priced out of the market for most laboratory quality heating devices; though, when making her own she did not want to sacrifice quality or functionality. “When you try to develop catalysts for chemical processes, the temperature program and exact temperature control is crucial. You probably do not want to stay in the lab for 16 hours to manually adapt your temperature,” she notes.

With a hot plate and a series of electronic components including a LCD screen, a few solid-state relays, and an Atmel ATmega328 gathered, BrittLiv was ready to assemble her contraption. She began by linking the hot plate and the input device. “It is very advisable to use a ground fault circuit interrupter adapter or a safety socket when working on and with the device,” the Maker advises. The embedded AVR microcontroller monitors the heating process, with temperatures up to 338°F, via an MAX6675 thermocouple interface board.


From there, she programmed her electronics to read temperature scales from an SD card. BrittLiv stressed the importance of scales by saying, “It is not enough to simply hold something at a certain temperature, but the rate at which something is heated and for how long is just as important.”

Once her entire unit was soldered and linked, she placed a heat safe wooden case around the input device and sprayed it with heat-resistant paint.

For a full tutorial on how to build your own programmable heating pad, check out BrittLiv’s original Instructables post here.

11 ways Makers are turning trash into treasure with Arduino

  1. reuse (discarded objects or material) in such a way as to create a product of a higher quality or value than the original.

What remains truly fascinating around the Maker Movement is do-it-yourselfers’ abilities to upcycle items that might otherwise be seen as trash, and transform them into fully-functional treasures — a majority of which rely upon an Atmel-based Arduino board for its second lease on life.

Making music with outdated computer parts

A group of Illinois-based Makers hailing from Makerspace Urbana have unveiled a way to take outdated technology and turn them into pieces of musical instruments. The Electric Waste Orchestra project strives to “manipulate the voltage flowing through circuit boards and use those signals to make music” out of components that would’ve otherwise ended up at the dump. As seen below, the Makers recently transformed an old keyboard number pad, six hard-drives, an Arduino and some software into a fully-functioning guitar jamming along with a modular synthesizer.


Turning trash into treasure with 3D printer built from e-waste 

Afate Gnikou led a team of West African Makers who developed a fully-functional 3D printer, the W. Afate. The printer removes spare electronic parts from dumps and transforms them into something useable. Gnikou uses the scraps from scanners, computers and printers and assembles them into the frame of a Prusa style RepRap printer that can then be hooked up to an Arduino board.


Transforming a broken umbrella into a stylish bag

Maker Agy had a broken umbrella that she was looking to repurpose. She used the waterproof material from the umbrella and an Arduino LilyPad (ATmega328V) to create a fashionable yet functional tote bag. With some smart sewing techniques, she was able to install a sensor on the outside of the bag that would power a bright LED in dark situations.


Making poetry from e-mail spam

This project steers away from the environmental world and takes the digital realm into account. The SpamPoetry machine was created by Varvara Guljajva and Mar Canet Sola to transform SPAM e-mail messages into snarky poetry. They used an Arduino aided sewing machine to run an algorithm that would turn unwanted e-mail waste into amusing poetry.


Upcycling broken wheelchairs into a $40 robot


A Maker by the name of Dark Light used three broken down wheelchairs to develop one fully-functional, remote-controlled robot. With an Arduino Mega 2560 (ATmega2560) hacking the chair’s controls, the robot unit can be manipulated at will and the forward facing camera provides location details. Along with Wi-Fi connectivity, the creation features six ultrasonic sensors that allow for basic obstacle avoidance. This is one smart robot!

Converting an old hard drive into a binary desk clock 


Maker named x2Jiggy had an extra hard drive enclosure taking up space on his desk and he decided to turn it into something of value! He took a few ATmega328 chips and mocked up a clock design to match his brand new binary watch. The microcontrollers receive the time from a RTC module, which supposedly has a battery that will last ten years. Talk about sustainability!

Bringing that old ride into the modern day


Take a drive through any neighborhood; you will probably see a few yards littered with sedentary cars that the owner plans to “fix up one day.” A DIYer by the name of MiDri has found the motivation to bring his beat up Nissan 280z back to life. Using an Arduino Duemilanove (ATmega168) board to control the sports car’s brain, MiDri has adapted much of the old-school analog controls to be governed by an Android tablet.

Cutting vinyl with an obsolete printer

Vinyl cutters are typically used to make stickers, signs and graphics. In short, they are quite handy for Makers to have around, which is why a Maker by the name of LiquidHandWash decided to upcycle an old printer by transforming it into a DIY vinyl cutter using an Arduino Uno (ATmega328).


Designing a coffee roaster from an old popcorn machine


Brenn10 modified an ordinary air popcorn popper by transforming the device into a slick Arduino-based controllable coffee roaster.

Turning an IBM Selectric into a printer


One Maker wanted his own typewriter terminal, so he took apart an IBM Selectric II and got to work. Instead of an electronic keyboard, the IBM Selectric II uses and electromechanical keyboard to tilt and rotate the Selectric’s typeball. In normal operation, a series of shafts underneath the keyboard are engaged. As Hackaday explains, the Maker added parts of an erector set to those levers and tied each one to one of 16 solenoids. With a set of solenoids able to print any key with the help of an Arduino, he had a fully automated typewriter from the early 1970s.

Making a robotic arm from recycled bike parts

Recently published on MAKE MagazineArt-Bot is a robotic arm controlled by arcade machine-like buttons whose components were all salvaged from old bicycle parts. For the controlling part of the arm, Maker Morgan Rauscher used an Atmel-based Arduino, servos and actuators so that Art-Bot could maneuver without any trouble.


If you know of any other useful projects that apply Arduino to the art of upcycling, share with us below. We’ll be happy to blog about it!

3D printing a working DC motor

A Maker by the name of Pitrak recently created a fully-functional DC motor using an Atmel-powered MakerBot Replicator 2 desktop 3D printer.

To develop the working brushless direct current (DLDC) motor, the Maker 3D printed each of its parts, excluding the magnets, solenoid wrapping wire and hall effect sensors, and used an Arduino Uno (ATmega328) to control the motor itself.


According to Pitrak’s Instructables page, the design features four distinct parts: the bottom enclosure, the top enclosure, the rotor, and the solenoids. All of the parts can be printed at once on most 3D printers; however, during the print, it must be paused in order to add in certain components.


“The magnets and hall effect sensors were inserted into assembly by designing a correctly sized internal void in the appropriate place, printing to just below the top of the void, pausing the print and inserting the device, and then continuing the print,” Pitrack explained.


The final product was printed in clear PLA plastic at 20% infill with a 0.20 mm layer height. “It was found through trial and error that pieces meant to join together without sliding such as the top and bottom enclosures should be printed at 0.25 mm added on all sides, while pieces meant to slide freely such as the rotor should be printed at 0.4 mm space on all sides,” the Maker notes.

Once printing is complete, each of the components can be removed from the MakerBot and pieced together after removing excess plastic from the raft. The pieces should fit together smoothly without much effort.

The Maker says future improvements to the motor can be broken down into four main categories: mechanical optimization, efficiency improvements, control improvements and applications, which he explains in more detail here.

Interested in learning more about this project? You can find the steps in more detail on Instructables, and access the program written for Arduino on github.