Professional Documents
Culture Documents
What is a Microcontroller ?
A microcontroller (or MCU) is a computer-on-achip. It is a type of microprocessor emphasizing self-sufficiency and cost-effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC). The only difference between a microcontroller and a microprocessor is that a microprocessor has three parts - ALU, Control Unit and registers (like memory), while the microcontroller has additional elements like ROM, RAM etc.
http://electronicsbasedprojects4u.blogspot.i n
ATMEGA32/ATMEGA32L
High-performance, Low-power AVR 8-bit Microcontroller Up to 16 MIPS Throughput at 16 MHz 32K Bytes of In-System Self-Programmable Flash 1024 Bytes EEPROM 2K Byte Internal SRAM Two 8-bit Timer/Counters, One 16-bit Timer/Counter In-System Programming by On-chip Boot Program Four PWM Channels 8-channel, 10-bit ADC Programmable Serial USART Internal Calibrated RC Oscillator External and Internal Interrupt Sources Power-on Reset 32 Programmable I/O Lines
http://electronicsbasedprojects4u.blogspot.i n
ATMEGA32/32L
ATMEGA16/16L
32K Bytes of Flash memory 1024 Bytes EEPROM 2K Byte Internal SRAM
http://electronicsbasedprojects4u.blogspot.i n
ATMEGA32/16
ATMEGA32L/16L
http://electronicsbasedprojects4u.blogspot.i n
Pin Diagram
http://electronicsbasedprojects4u.blogspot.i n
COMPUTER
C - CODE
COMPILER c
HEX CODE
MICRO CONTROLLER
http://electronicsbasedprojects4u.blogspot.i n
STK200 Cable
http://electronicsbasedprojects4u.blogspot.i n
DDRX
The DDXn bit in the DDRx Register selects the direction of pin n. If DDXn is written logic one, PXn is configured as an output pin. If DDXn is written logic zero, PXn is configured as an input pin. Where n = 0,1,2 - - - ,7 For Example If DDRA = 0x0F ( 0000 1111)
http://electronicsbasedprojects4u.blogspot.i The Lower bytes of PORTA are configured as output pins The Higher bytes of PORTA are configured as input pins n
PORTX
When PORTXn is configured as Input Pin Writing logic ONE to this pin, activates pull-up resistor. Writing logic ZERO to this pin, deactivates pull-up resistor When PORTXn is configured as Output Pin Writing logic ONE to this pin, drives the port pin HIGH Writing logic ZERO to this pin, drives the port pin LOW
http://electronicsbasedprojects4u.blogspot.i n
PINX
PINXn is used to read the value of particular port pin Independent of the setting of Data Direction bit DDRXn, the port pin can be read through the PINXn Register bit
http://electronicsbasedprojects4u.blogspot.i n
ICCAVR
ICCAVR, the ImageCrafts C Development Environment is a program for developing AVR microcontroller applications using the ANSI standard C language Full featured 30-day demo program can be downloaded from the ImageCraft web site
www.image-craft.com
http://electronicsbasedprojects4u.blogspot.i n
http://electronicsbasedprojects4u.blogspot.i n
http://electronicsbasedprojects4u.blogspot.i n
LED
Switches
DC Motor
Sensors
Stepper Motor
http://electronicsbasedprojects4u.blogspot.i n
Maximum potential drop across LED will be approximately 2V. Maximum current tat can be allowed through am LED is approximately 30ma.
Resistor should be added in series with LED to limit the current through it.
http://electronicsbasedprojects4u.blogspot.i n
R = (Vs VL )/I
Vs = supply voltage VL = Voltage drop across LED ( around 2V) I = 15 to 30 ma
http://electronicsbasedprojects4u.blogspot.i n
http://electronicsbasedprojects4u.blogspot.i n
DC Motor
DC
Motors are small, inexpensive and powerful motors used widely. These are widely used in robotics for their small size and high energy out.
A typical DC motor operates at speeds that are far too high speed to be useful, and torque that are far too low.
Gear reduction is the standard method by which a motor is made useful . Gears reduce the speed of motor and increases the torque
http://electronicsbasedprojects4u.blogspot.i n
Choosing a DC Motor
DC Motor with Gear head Operating voltage 12V Speed Depends on our application Some available speeds in market 30 RPM 60 RPM 100 RPM 150 RPM 350 RPM 1000 RPM
http://electronicsbasedprojects4u.blogspot.i n
Positive
Negative
Negative
Positive
Clock wise
Anti clock wise
Logic 1 0
Logic 0 1
http://electronicsbasedprojects4u.blogspot.i n
http://electronicsbasedprojects4u.blogspot.i n
DRIVING OF DC MOTOR
http://electronicsbasedprojects4u.blogspot.i n
Switches
Active Low When pressed shorts the corresponding pin to ground Active high
When pressed shorts the corresponding pin to Vcc
http://electronicsbasedprojects4u.blogspot.i n
Active low
Active high
INTERFACING SWITCHES
http://electronicsbasedprojects4u.blogspot.i n
Sensors
Commonly used sensors in the field of robotics are IR Digital sensors IR analog sensors
http://electronicsbasedprojects4u.blogspot.i n
IR Digital sensors
Transmitter
IR led connected to 38KHz oscillator
Receiver
TSOP1738
Receiver
IR Photodiode
http://electronicsbasedprojects4u.blogspot.i n
IR Analog sensor
http://electronicsbasedprojects4u.blogspot.i n
STEPPER MOTOR
STEPPER MOTOR is a brushless DC motor whose rotor rotates in discrete angular increments when its stator windings are energized in a programmed manner. Rotation occurs because of magnetic interaction between rotor poles and poles of sequentially energized stator windings. The rotor has no electrical windings, but has salient and/or magnetized poles.
http://electronicsbasedprojects4u.blogspot.i n
4 Lead stepper
5 Lead stepper
6 Lead stepper
8 Lead stepper
http://electronicsbasedprojects4u.blogspot.i n
4 1 0 0 0
3 0 1 0 0
2 0 0 1 0
1 0 0 0 1
http://electronicsbasedprojects4u.blogspot.i n
4 1 0 0 1
3 1 1 0 0
2 0 1 1 0
1 0 0 1 1
http://electronicsbasedprojects4u.blogspot.i n
4 1 1 0 0 0 0 0 1
3 0 1 1 1 0 0 0 0
2 0 0 0 1 1 1 0 0
1 0 0 0 0 0 1 1 1
http://electronicsbasedprojects4u.blogspot.i n
http://electronicsbasedprojects4u.blogspot.i n
http://electronicsbasedprojects4u.blogspot.i n
ULN2803
http://electronicsbasedprojects4u.blogspot.i n
A 1 0 0 1
B 1 1 0 0
C 0 1 1 0
D 0 0 1 1
http://electronicsbasedprojects4u.blogspot.i n
http://electronicsbasedprojects4u.blogspot.i n
Line Follower
sensor 1 sensor 2 sensor 3 Microcontroll er L 2 9 3 D Left moto r Right Moto r
http://electronicsbasedprojects4u.blogspot.i n