I love circuitry and programming. Therefore, microcontrollers are literally heavenly to me. Though, the long time industry standard of microcontrollers has been the 8051, I really took to Atmel’s AVR microcontrollers. Especially, the combination of Proteus (for simulation), WinAVR(for programming) and most definitely the microcontroller itself – ATmega16 was sublime to work with. I worked out almost all of its major features from simple I/O to UART communication. In this article I will post the photos of simulation while the videos will be of the actual hardware implementation.
This is as simple as a microcontroller circuit can get. For output, all it does is make an LED blink. To add a little input to the circuit, I added the push button switch. So the LED blinks normally but when the button is pressed (input) the LED is held ON.
The LED matrix display actually contains 7×5 LED’s. Each of these 35 LED’s can be individually switched on or off. This circuit is also all about outputs but here I selected particular LED’s to be switched on in every column. Then, it is programming the microcontroller to display all columns but one column at a time rapidly creating the letters.
One of the best features of the AVR is its in-built analog to digital converter. This circuit converts the anolog value of voltage applied through the variable resistor (10k pot) and displays it using a 16×2 Character LCD Display. The video shows the entire range of values from 0 to 5V as the pot is turned from one end to the other.
AVR has some pretty neat internal counters and timers. Using them, Pulse Width Modulation of almost any duty cycle can be obtained. I used the PWM to reduce the brightness of an LED and also to control the speed of a DC motor. The motor was a 150 rpm motor and I even removed the motor shaft to see if the internal gears should appreciable change in speed. For the eyes they did, for the camera I am not sure. So the difference in speed isn’t obvious but careful observation will clearly show a change in speed if the LED’s brightness is used as a reference. When the LED is dim, the speed of the motor should be low and the opposite (bright and fast) is also true.
It is a protocol by which a microcontroller can communicate or transfer data to another device. In this case, the microcontroller transmits data to another microcontroller which displays it. This is what happens, everytime the lower button is pressed an interrupt is raised and a count value is incremented. This count value stores how many times the lower button is pressed. Each time the red light arises, a count has been registered. When the upper button is pressed, the green light is seen and the data is transmitted to the other microcontroller.
If you look closely, the only link between the two microcontrollers is the one single yellow wire. The data is received by other microcontroller and displayed. Everytime the data is sent, the count is made zero again and if the transmit button is pressed again the zero is transmitted and displayed.
Ofcourse, I haven’t explored everything there is especially I wanted to use the I2C protocol to show a small animation movie on an OLED display. Sadly Proteus doesn’t have a simulation model for the OLED display and the display is just too costly to blindly experiment with. But other than that, working (playing) with this microcontroller is one of the best things I have done in my life.