AVR Programming & DesignThe source code is provided for each project. The code is for EDUCATIONAL purposes ONLY. There is no warranty and no support. All these projects are a result of my hobby, so I don't necessarily know what I'm doing! Also note that all code available here carries the MIT License. |
|||
VE3LNY's AVR Microcontroller projectsIt doesn't take long after being introduced to PICs before you hear about AVR microcontrollers and how wonderful they are. AVRs are 8 bit risc microcontrollers, from Atmel Corporation. (Atmel was bought up by Microchip.) There are a number of models, from tiny to large, so you can always find a processor to suit your requirements.When starting off with a new line of microprocessors, you need two things: a development language and a programmer. Microchip provides the Microchip Studio for free, which provides assembler language. Not being a fan of assembler programming, I was excited to discover that there is a free C language compiler available, called WinAVR. WinAVR includes the GCC compiler and LIBC, a library with lots of useful functions, and numerous of other goodies. NOTE: Atmel was acquired by Microchip in 2016. As a result may of the Atmel links no longer work and take you to Microchip home page. I apologize for this, and will try to fix them as time permits. |
|||
AVR ProgrammersIn the programmer department, I found a really simple one from Sparkfun here (unfortunately now discontinued, but the schematic is here) which I built. It connects to a PC's serial port and may be driven with a program called AVRDUDE, included in WinAVR. (This programmer is known to AVRDUDE as ponyser). One test showed that that the ponyser took 10 seconds to program an ATmega48 with 3467 bytes of flash data.Atmel had an inexpensive USB-attached programmer called the AVRISP MK2, which cost about $C36 from DigiKey (P/N ATAVRISP2-ND). (Discontinued!) It programs very fast if you set the ISP clock frequency properly. (If the AVRISP's clock frequency is incorrectly set, which it may be by out of the box, it may be really slow or not work at all. I learned this the hard way. Its easy to check/set the clock speed in the Main tab of the programmer software.) A possible replacement
is ATATMEL-ICE, at Digikey ATATMEL-ICE-BASIC-ND
or ATATMEL-ICE-ND.
Unfortunately these are more expensive. Another interesting approach may be found in Peter Fleury's AVR Starter Kit. |
|||
AVR released another inexpensive programmer called the AVR Dragon. Unfortunately it too is no longer available. My notes on the AVR Dragon here. |
|||
In the following projects, I used AVR Studio (versions 4 and 6/7) and WinAVR GCC. After installing both programs, you can create a project with AVRStudio and select GCC as the compiler. I provide all source code but no project files, so you must create your own. Don't forget to specify the processor type in the project properties. Then add the source and header files to the project and build. I also include my hex file which ought to work if your hardware is sufficiently identical. |
|||
Arduino |
All my projects have been roll-your-own. Over the years Arduino boards have become very popular, and one like the Uno can save a lot of design/construction/programming effort. I would encourage anyone who finds my own approach to micro projects tedious to look at Arduino. Many various inexpensive boards and shields are available from numerous sources. |
||
Thermostat Version 2Here's a thermostat for your furnace with an LCD display and humidity readout using an ATMega88. Uses only a rotary encoder. |
|||
ThermometerA thermometer with an LED display using an ATMega8. |
|||
Electric Blanket ControllerA versitile Electric Blanket Controller using an ATtiny461. |
|||
Simple Low-Resistance meterHere's a low-resistance meter using an ATmega168. |
|||
Temperature and Humidity MeterA Temperature and Humidity meter using an ATmega164. |
|||
KTM-S1201 Serial LCD DriverA C-code driver for this display. |
|||
Appliance TimerAn Adapting Appliance Timer using an ATMega88 and a KTM-S1201 LCD display. (Updated 2012-11-01) |
|||
Chiming ClockA clock that sings like a bird using an ATMega88 and a KTM-S1201 LCD display. |
|||
Garage Door MonitorMakes sure my garage door does not stay open too long. |
|||
USB Clock Version 2Here is an ATmega48 beeping clock that shows the date and time, driven from the PC. (Updated to add day of week to display.) |
|||
ESR Meter with LED DisplayManfred Mornhinweg's ESR meter with an ATtiny861 and an LED display |
|||
Bench Power SupplyWith ATtiny861
LED Voltmeter and Ammeter |
|||
Nokia 5110 Display ClockA clock using the Nokia 5110 display
and no dedicated RTC chip. |
|||
SLA Charger with MonitorA UC3906 SLA 2.5Amp charger with an
ATtiny461 monitor. |
|||
Travel Alarm ClockA travel alarm clock using ATmega88
and DS1302. |
|||
Outdoor Reading ThermometerRead the temperature outdoors. |
|||
Timer with Nokia DisplayAn Adapting Appliance Timer using an ATMega88 and a Nokia 5110 LCD display. |
|||
Temperature and Humidity MeterVersion 2, uses HDC1080 sensorA Temperature and Humidity meter using an ATmega164. |
|||
Space Heater ThermostatATtiny84P processor, uses I2C sensor and LED display driver
|
|||
LED Alarm ClockATmega164 processor, using 4 digit LED display and adaptive brightness
|
|||
ICOM CommanderHandy device for use with ICOM radio
to set power level and choose key type. |
|||
Frequency CounterAn addition to a function generator
that has no digital frequecy readout. |
|||
Temperature and Humidity MeterVersion 3, uses SHT30 sensorA Temperature and Humidity meter using an ATmega164. |
|||
Heating Pad Controller
|