3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Using a Quadrature Encoder with an ATtiny 2313 and an OLED Display

Using a Quadrature Encoder with an ATtiny 2313 and an OLED Display
In this instructable you'll learn how to use a rotary encoder (see http://en.wikipedia.org/wiki/Rotary_encoder ) with a microcontroller and how to display the numeric value as a bar and a numeric value on an OLED display. See the video below for the project in action. The right upper corner of the OLED display shows a small clock, too.

In the image you can see the ATiny2313 in a SMD package, which I've soldered on a PCB with headers, but the microcontroller is available in easier to use DIP packages, too.
 

 
Remove these adsRemove these ads by Signing Up
 

Step 1Hardware

Hardware
You'll need the following hardware:

* ATiny 2313
 * 18.432 MHz oscillator (this frequency is required for a perfect 115,200 baud signal for the OLED display, but the display has auto baud detection, so you can use other oscillators as well, or just the internal oscillator)
* 7805 voltage regulator
* 10 µF electrolytic capacitor
* 1 µF ceramic capacitor
* 2 x 100 nF ceramic capacitor
* 3 x 10 k resistors
*  µOLED-128-G1 (from http://www.4dsystems.com.au , but you can use a LCD display, too, or something different, e.g. use the encoder for controlling the pitch of some sound output) 
* quadrature rotary encoder (I've used Alps, type EC12E2420404, but you can use other encoders)
* ATiny programmer (I've used the AVR Dragon: http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3891 )
* a breadboard like you can see in the video, or veroboard and some wires, if you want to solder it
* some tools, like solder iron, if you use a veroboard, side cutter etc.
* power supply (anything from 7 V to 12 V works, even a 9 V battery)
* a PC with Windows for WinAVR and AVR Studio

The schematic is very easy to build this on a breadboard:

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
8
Followers
3
Author:Frank Buss