Project Files: Tachtastic – AVR Tachometer

Tachtastic – an Image from the old days

On demand of a site-visitor (Mohsen) I have uploaded all the relevant files that I had for the project Tachtastic: AVR Tachometer, you can download and view them. The files are more than a year old and show how I coded back then and were not meant for uploading – but now that I have seen it myself, seems to be well-documented not well coded though.

Download the below provided rar file, it contains all of the files that I have, including 2 versions of AVR Code, schematic files made in Circuit Wizard, PCB files [pdf] and images of the circuit.

There have already been 2 posts about this Tachtastic project and this being the third one will probably be the last one unless I make another AVR Tachometer, Tachtastic v2.0.

  1. Tachtastic Project Details
  2. Tachtastic Image Gallery

Without any further delay, here is the download link:

[Download not found]

Now that you have downloaded the rar file, this is what you will find inside, 4 folders:


  • Circuit-files
    • This folder contains Circuit Wizard files of the circuit, which has both the schematic and the PCB layout, plus schematic and PCB layout in PDF files if you don’t have circuit wizard, multiple views of the circuit as circuit wizard had a number of views to choose from.
  • MISC
    • The MISC folder, contains things like datasheets, mechanical drawing of LCD that I used and a couple other things used and downloaded during the course of making the project.
  • Tachtastic
    • This is the main folder which contains the AVR Studio v4 solution, all source files and related files etc included. I tested it that it was compiling before uploading, so it should compile without any problem. I myself have gone through the code, it seems I had commented it when I was making the first time, so looks good enough and I am leaving the understanding of the code to you.
  • tachometer-01
    • Another AVR Studio v4 project, haven’t even seen the code, but seems relevant as it was in the same folder, maybe it is some older version of the code I was writing.

Phase and Integral Cycle AC Power Control with Arduino

Phase and Integral Cycle AC Power Control with Arduino
Phase and Integral Cycle AC Power Control with Arduino

What you see above is a project made for my Power Electronics Course, last term, finally completed and submitted. It is an AVR based board having 2 optically-isolated TRIACs for AC Power Control and implements both Phase Control and Burst Fire Control on each of the TRIACs. Controllable by an NEC IR Remote, shows status on Text LCD and the complete code was written in Arduino IDE [though there is some non-arduino/AVR code too].

The circuit above can be distributed into 3 parts, Power Supply, Controller and TRIACs.

Power Supply

The Power Supply for this board comes in the form of 220V AC from the wall outlet into the green terminal at the top-centre, which gets stepped-down by the transformer to 20V AC. The 20V AC is half-rectified by the 1N4007 diode [above the blue terminal] and is fed into the 15v regulator 7815 which feeds the next regulator 7805 to get a stable 5V DC supply for the controller circuitry.

The small white IC that you see is H11AA1 which detects the zero-crossings in the AC Line, I fed it stepped down AC supply [after the transformer]. It gives a pulse at every zero crossing and the whole AC Control relies on the signals coming from this IC. the Zero detect pulse goes to the INT0 pin of AVR, D2 pin on Arduino.

And what project would be complete without a Red LED to indicate Power.

Power Supply Portion - AC Supply to 5V DC with Zero Crossing Detection
Power Supply Portion: AC Supply to 5V DC with Zero Crossing Detection


Controller – AtMega8 / Arduino

I used an AtMega8 as the controller in this project running at 16MHz (hidden beneath the LCD) and programmed it via the Arduino IDE, using a USBasp programmer, the connector to the right is the ISP connector.

I used the Arduino environment as I wanted to use the IR Remote Library from AdaFruit and the LCD Library along with wanting to keep it simple and clean. The pinout of the LCD and the IR sensor (Black Component at the bottom) etc is provided in the arduino code, so I will not dwell in the schematic details here. It is to note that the IR remote I had was not working properly with the library so I had to do a few hacks in the original library. [code details in a later post]

Controller Portion - AtMega8 + LCD + IR = Arduino at 16MHz
Controller Portion: AtMega8 + LCD + IR = Arduino at 16MHz
[Download not found]


AC Power Control – TRIACs

This is the portion of the circuit which controls AC Power, the TRIACs used are BTA41 which are coupled to the controller by optical isolators MOC3011 (the white ICs). I am a bit paranoid when working with high voltage so I put up a plastic sheet over the 2 TRIACs and the bottom side is hidden with a card-sheet so no joints are exposed from below as well. Both TRIACs share teh same heat sink, an aluminum piece I found lying around, drilled it to use with the TRIACs. As labelled, one TRIAC controls the power by INtegral Cycle control method and the other uses Phase Control.

AC power Control Portion: TRIAC circuit + optical isolator + with plastic sheet and heatsink
AC power Control Portion: TRIAC circuit + optical isolator + with plastic sheet and heatsink

Code and other details on how the circuit is working will come in another post.

Pakistan’s Independence Day 2012 – LED Matrix Display

I finally completed writing code for a Marquee Display and since I used the morning of 14th August to write this code, the least I could do was to celebrate Pakistan’s Independence Day as the first message and test for my code.

The code has DEFINE(s) for Display Length, Message Length, Speed Control and a Full-Size-AlphaNumeric-Font. Putting in a new message or updating via UART is also supported as the message array is built at run-time.

Complete code was written by me and this time, I didn’t Google once to see how others have done similar work. Now I think I will do some searching and compare my code with others.

Using AVR Atmega8, with an empty MAIN LOOP as everytihng is handles by a TIMER. The AVR sends commands via SPI to 2 Shift Registers (74HC595) which are connected in a way to overflow the data to the last register.

Here’s the Schematic; the resistors etc are not shown; I will probably put up a more detailed version sometime soon.

74HC595 Shift Registers driving an 8x8 Led Matrix Display

The 3 wires going up and out of the schematic are the SPI wires goign to AVR.

I have not uploaded the Project Files yet, as I am still tinkering with the code, but if you want to get the AVR Studio Project Files and the Circuit/Simulation, just say so in the comments…

UART Library [Quick Tutorial]

avr-uart-library-post-imageHaving easy UART Functionality can be of great use in AVR Projects, even if they don’t need the UART fucntionality, the UART can be used as a great debugging tool (sending program status to the UART as a console). Peter Fleury has a AVR UART Library as well along with his AVR LCD Library which I explained here some time ago.

The Library handles all the UART related tasks and works on Interrupts so, it can receive data coming in even when the AVR is not explicitly polling the UART Lines. I had made this serial-test project so that I have a working UART snippet for use whenever I need. I have tried to clean up the uart-test file which is provided along with the library and made the IF condition a little more compact.

I am attaching all the project files with this post so you may easily download them and use.

Software Used:

Download “AVR UART Tutorial - Serial Test” – Downloaded 2305 times – 69 KB

L297-L298 Stepper Driver V2 – Vero-Board [Gallery]

Some might say I am getting obsessed with stepper motor drivers…

Just finished making 3 Stepper Motor Drivers on Vero-Board using the all too common stepper driver duo the L297 and L298 ICs, stepper motor wires connect to these boards via an RJ45 connector  as the wires need to go through a good length, I am utilizing the 8 wires in the CAT-5e cable as 2 in parallel for each motor connection to maximize current capacity and minimize the resistance etc which comes with long wires, but as I read and have checked experimentally the length which I am going is still much less to worry about these things. Continue reading L297-L298 Stepper Driver V2 – Vero-Board [Gallery]