Monthly Archives: November 2011


00 to 99 minute timer using PIC16F628A microcontroller

Last week I was browsing my old backup hard drive and I found a source code for a very simple PIC based digital timer that I made a couple of years ago. The actual hardware of the project isn’t with me anymore. I might have lost it when I moved from my old apartment into my new home. However, I thought this might be a good practice project for beginners and so I am sharing it here. I am not going to build it from scratch again; I will rather demonstrate it using my DIY PIC16F628A breadboard module and I/O board.

Read more

Connecting multiple tact switches on a single input pin of a microcontroller

Normally one tact switch requires one digital input pin of a microcontroller. Some designs implement keypad style multiplexing to get multiple switches on fewer inputs. However, there exist other techniques that allow you to connect many switches on a single input pin of a microcontroller. This tutorial demonstrates one such technique as applied to PIC12F683 microcontroller. In this example, there are four LEDs and four tact switches connected to the PIC12F683 microcontroller. While each LED is controlled through an individual I/O pin, the four switches are connected to one ADC input pin of the PIC12F683 microcontroller.

Read more

Revised version of LM35 based digital temperature meter

This is a revised version of my LM35 based digital thermometer project that I posted last year. Although it is one of the simplest projects, it is very popular among newbies who are just starting to learn microcontrollers. There was a little flaw in the original project as pointed by some readers. I was using a 1.2 V reference for A/D conversion with PIC16F688 microcontroller. However, the PIC16F688 datasheet says Vref should be equal to or higher than 2.2 V to ensure 1 LSB accuracy of A/D conversion. Here, I am rewriting the same project but this time I am using

Read more

Lab 19: Play musical notes

We have discussed in the past experiments how to use a PIC microcontroller to do a variety of things from flashing an LED to driving a motor, etc. Today, we will see how to play notes of a song with a PIC microcontroller. Musical notes are simply sound waves of particular frequencies. If the frequency of a note is known correctly, a microcontroller can be programmed to play the note by generating a square wave (of the same frequency) signal at one of its I/O pins. The signal must be fed to a speaker to listen to the sound. Here,

Read more