Monday, April 5, 2010

PIC 16F88 Microcontroller PIC based Tengu

Tengu derives its name from a mythical Japanese creature known for getting into mischief. Our Tengu, however is more earthly in nature.  It responds to voice and sounds and takes on different facial features depending on the intensity of the sound. If no sound is heard for some time, it changes from a happy face to a sad face and then goes to sleep. Gently blowing on his face wakes him back up to his usual happy self. 

The Technical Details:
The project is based on a Microchip PIC 16F88 which is part of their mid range of microcontrollers. The sound is amplified through a pre-amp circuit based on 2N3904 and fed to the RB7/AN6 (pin 13) of the pic microcontroller. The A/D converter on the microcontroller is used to convert the analog signal from the pre-amp. The LED Matrix is directly driven by the pic. In order to be able to display the entire smiley, the LED dot matrix is multiplexed in such a way that only one row out of the seven is active at any given time. However the rows are turned on and off so rapidly, the human eye sees it as a full picture. This effect is called the persistence of vision. In order to achieve multiplexing, timer 0 on the pic is running at approximately 1 ms timeouts to switch the row that is being displayed on the LED Matrix. Timer 1 is configured as a general purpose timer used to keep track of the time since any noise over the threshold was heard. This is used to change the smiley from a happy to a sad one. The code is written in C using MPLAB and Hi-Tech C compiler ver 9.80.

Parts List:
  • PIC Microchip 16F88
  • 7x5 LED Dot Matrix Display
  • 5 x 160 Ohm resistor
  • 2 x 10K Ohm resistor
  • 1 x 100K Ohm Resistor
  • 2N3904 NPN Transistor
  • Electret Mic
  • 1 x 0.1 uf capacitor
  • 1uf capacitor
  • 78L05 5v voltage regulator
Circuit Diagram 
Eagle Schematic available here

The gain I was getting on the amp circuit above was only moderate. I changed the circuit to use a LM386 based on Jose Pino's circuit and got a much better gain. The circuit diagram is below. The 10K potentiometer is used to adjust the sensitivity of the mic while the 100K potentiometer is used to adjust the gain. 

Designed by Mindfront Technologies for  
The complete kit is available at

Here is the video of the project in action:


  1. hye,
    im currently doing a project using pt2272 and pt2262 ic ( but i cant find that particular chip in Eagle to do my simulation. Any suggestion on which IC to be used in Eagle that have same function as pt2262 and pt2272?

  2. thanks for u r posts with diagrams which made me understand more easily.

  3. The outlook is fantastic with a nice blend betweengray and orange. The text is quite extensive and is fairly technical. Will be a good read for tech enthusiasts

  4. The gaming platform created by 888 combines basic video games of French and American Roulette with other great variants. While I take pleasure in taking part in} Blackjack there, most of them are not nearly as good as good} phrases of|in relation to} on-line Roulette. really have} analysed all the top Roulette websites obtainable in 2022 assist you|that will assist you|that can help you} choose the most effective Roulette web site and to make sure the video games are ALWAYS nearly as good as good} as you want them to be . And if you don't want|you don't need|you do not need} any of this — 토토사이트 cease for a free roulette game.

  5. motogp สล็อต แตก ง่าย pg ไม่ผ่านเอเย่นต์ ค่ายเกมสล็อตใหม่ปัจจุบันจากค่าย PG พร้อมให้บริการเว็บไซต์พนันสล็อตให้กับลูกค้าทุกคน ถ้าท่านกำลังมองหา”เว็บไซต์สล็อต pg แตกง่าย”


YDLidar (lidar) X4 API in golang

YDLidar X4 This is a demo of the YDLidar using a golang API. The software supplied with the device only contains the drivers in C++ an...