Notes

Assignement

add an output device to a microcontroller board you’ve designed and program it to do something

What i am going to do

I want to make a speedometer using LED Arrays using a Optical Encoders.

Output Devices

The output is what results from an electrical circuit.

Output

Any of the following components may be used as outputs:

LED

Piezo buzzer

Servo motor

Stepper motor

LCD Display

LED

Light Emiting Diode (LED) it is the basic example of output device in electronics projects Blinking LED is called “Hello World” it is a Diode it works only in forward biase and it availble in diffrent colors and sizes.

Piezo Buzzer

Piezo

Piezo buzzer is an electronic device commonly used to produce sound ,Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre Curie ,It is the phenomena of generating electricity when mechanical pressure is applied to certain materials and the vice versa is also true. Such materials are called piezo electric materials

Servo Motor

A servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration. It consists of a suitable motor coupled to a sensor for position feedback

Servo

Stepper Motor

A stepper motor is a brushless, synchronous electric motor that converts digital pulses into mechanical shaft rotations. Each rotation of a stepper motor is divided into a set number of steps, sometimes as many as 200 steps. The stepper motor must be sent a separate pulse for each step.

Stepper

LCD display

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits.

LCD

Charlieplexing

I want to display Motor RPM using a LED array for that iam using Charlieplexing Technique. a Charlieplexing is a technique for driving Multiplexed LEDs in which relatively few I/O pins Microcontrollers. ATtiny45 have only 6 IO pins if we need to control 6 LEDS normally we want 6 PINS , But if you are using Charlieplexing you can control (n2 − n) LEDs. where ‘n’ is no of available pins .

Charlieplexing Chart: Charlieplexing Chart

LED Array Circuit Diagram

I designed a 6 LED using 3 Pins Circuit in Eagle , in Eagle Layout You can see the LED Array arrangements . Charlieplexing ATtiny45: Encoder Eagle Layout: Charlieplexing Eagle

Board

I arranged PCB Board in a circular shape for displaying LEDs in the form of a speedometer.

Eagle Board: Charlieplexing Eagle Board Stuffed PCB : Encoder CRO

Programming

I used Attiny45 + Arduino , Charlieplex Library available in arduino . That is very easy but you need to understand working of Charlieplexing Circuits .

First I Programmed a simple charlieplexing Running Light .

Code :

/*
Charlieplexing With ATtiny45
       By
Muhammed Jaseel P
FabAcademy 2016 Student
Fablab Trivandrum
*/
#include <Charlieplex.h>
const int ledpin1 = 2;   
const int ledpin2 = 1;
const int ledpin3 = 0;
#define NUMBER_OF_PINS 3

byte pins[] = {ledpin1, ledpin2, ledpin3};
Charlieplex charlieplex = Charlieplex(pins , NUMBER_OF_PINS);

charliePin led1 = { 0 , 1 };
charliePin led2 = { 1 , 2 };
charliePin led3 = { 2 , 0 };
charliePin led4 = { 0 , 2 };
charliePin led5 = { 2 , 1 };
charliePin led6 = { 1 , 0 };
void setup(){
}
void loop(){
charlieplex.charlieWrite(led6,HIGH);
delay(100);
charlieplex.clear();                   
charlieplex.charlieWrite(led1,HIGH);
delay(100);
charlieplex.clear();
charlieplex.charlieWrite(led5,HIGH);
delay(100);
charlieplex.clear();                               
charlieplex.charlieWrite(led2,HIGH);
delay(100);
charlieplex.clear();                             
charlieplex.charlieWrite(led3,HIGH);
delay(100);
charlieplex.clear();                                            
charlieplex.charlieWrite(led4,HIGH);
delay(100);
charlieplex.clear();
charlieplex.charlieWrite(led3,HIGH);
delay(100);
charlieplex.clear();                           
charlieplex.charlieWrite(led2,HIGH);
delay(100);
charlieplex.clear();
charlieplex.charlieWrite(led5,HIGH);
delay(100);
charlieplex.clear();
charlieplex.charlieWrite(led1,HIGH);
delay(100);
charlieplex.clear();
charlieplex.charlieWrite(led6,HIGH);
delay(100);
charlieplex.clear();
}

Final Video

ATtiny45 Charlieplexing -Output Devices Fab Academy 2016 from Jaseel on Vimeo.