(→PicoBat : a PIC-based simple and cheap ultrasonic detector) |
|||
Line 5: | Line 5: | ||
{{#ev:youtube|EjEkXlET0CM}} | {{#ev:youtube|EjEkXlET0CM}} | ||
− | The idea of this circuit is to hack the PIC oscillator circuit, by replacing the crystal by a piezo sensor : the frequency of the oscillator depends on | + | The idea of this circuit is to hack the PIC oscillator circuit, by replacing the crystal by a piezo sensor : the frequency of the oscillator then depends on [[wikipedia:Ultrasound|ultrasounds]]. |
Oscillator frequency is then divided by 4 by the PIC, and pushed into a piezo speaker. | Oscillator frequency is then divided by 4 by the PIC, and pushed into a piezo speaker. |
An ultrasonic bat detector with only 3 components !
Contents |
A short video clip is sometimes better than a long explanation :
The idea of this circuit is to hack the PIC oscillator circuit, by replacing the crystal by a piezo sensor : the frequency of the oscillator then depends on ultrasounds.
Oscillator frequency is then divided by 4 by the PIC, and pushed into a piezo speaker.
It shares the same idea as PicoDetector, the metal detector.
/* ******************************************************************************* * picoBAT : an ultra simple ultrasonic bat detector ******************************************************************************* * * Author : Bruno Gavand, February 2009 * see more details on http://www.micro-examples.com/ * * source code for mikro C compiler V8.2 * feel free to use this code at your own risks * * target : PIC12 * * PIC PIN Assignemnt : * * GP0 GP1 : piezo speaker * GP5 : ultrasonic transducer receiver * ******************************************************************************* */ void main() { /* * configure GPIO as digital port */ CMCON0 = 7 ; ANSEL = 0 ; TRISIO = 0 ; GPIO = 0b01 ; for(;;) { /* * toggles speaker outputs */ GPIO ^= 0b11 ; } }
No, there is no mistake, full source code is above !
Download PicoBat-project.zip file for mikroC : File:PicoBat-project.zip
Includes :
powered by commenterra | Recent comments |