The AVR is a Modified Harvard architecture 8-bit RISC single chip microcontroller (µC) which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to One-Time Programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

Control Speed Of Motor And 11 LED Effect

August 16th, 2009

Another Way Of Controlling DC Motor With AVR:

Here is a video of me controlling a 3V hobby motor by sending a pulse of current. It is the same setup & code as the 11 LED CHASER (a hack), except 1 LED has been removed (at PC5) and replaced with a N2700 (row 2-4, row 2 to GND, row 3 to MCU, row 4 to positive on motor, row 5 to positive rail plus to negative on motor) MOSFET setup to switch on a normal 3 volt hobby motor that requires more amperage (higher than the 40mA maximum that the ATmega168 can handle) than the MCU provides (also added a 5V voltage regulator as power supply is 6 volts). To avoid using a MOSFET, I could have used a pager motor (used for vibrator) that will run on 40mA) directly connected to the MCU and rail just like I do with the LEDs in my demos.

11 LED Chaser Effect (before hack above):

I noticed that the whole right side of the NerdKit has 11 accessible ports that 11 LEDs will fit in just comfortably. I was told I could only get up to 6 or 8 LEDs using math to do it, but my old stubburn way of programming step by step in C easily allowed by to do these 11. Here's a video (barebones microcontroller on breadboard). I do not use any fancy math with my code because my video shows it running off 3volts (2 AA batteries), complicated programming would have caused the MCU to "brown out" (not function right and glitch) with only a 3 volt power supply.

Below is my commented and refined 11 LED light chaser basic demo source code (if not using makefile from nerdKit, then put underscore in front of delay_ms to _delay_ms):

Simply a 3 volt power supply (2 AA batteries), why there is no voltage regulator.Basically this could be a a smaller and cheaper MCU (code runs on Atmega48 Atmega88 Atmega168 Atmega328, maybe others), just a sample of a generic LED effect kit that could be makerted (too basic to sell).


Comments:

No comments yet. You could be the first person to comment!

Make A Comment:

Name:

Your message/comment:

characters left.
For AVR codes, use my PasteBin & post link.

Prove you are human (enter the text seen in image):


Make your own email signatures like this @ www.text2logo.com


Free image widgets HERE.