All my source codes were taken from my personal projects and can't be used directly without modification.
Everything is for your
information only. The C/C++ codes have been written
with ICCAVR. You can find the header and source CRT files by downloading their
compiler.
All is for your information and everything is AS IS without any warranty of any kind.
All source files
schematics,
PCB,
HEX file
are not available.
KEYWORD
AVR
MCU
MEGA
128 64
32
16
8 BOOT
ATMEL
Digital 2 channel 10 Amp Meter
History
This project is a 2 channels amp meter. Those channels are completely isolated up to 2000 volts. I'm sure you don't need isolation like this but it could be very interesting to measure the charge current for 110V AC input or on the output of something like 12V DC. That is, it provides auto detection for AC or DC current. The main part of this project is the current sensor ZMC10 a cool DIP 14, which supports up to 10 A. The current is measured inside by hall effect sensor. I had used a graphic LCD to show very big numbers of the read current and max peek value, DC or AC
Ok now, this was supposed to be simple, but I had to overcome a lot of problems
doing this project. First the datasheet of the ZMC10 have a big 2 pages!
How an IC like that can have 2 pages documentation when LED datasheet have more
than 15 pages? Not having proper documentation was my biggest challenge. First
the slope is non linear I had to make calibration at first to use it from 0 to
10 amps. The software calculates the slope from 0 to 1, 1 to 2, 2 to 3, with the
formula Y2 - Y1 / X2 - X1 | B = Y - M * X | X = Y - B / M | Y = M * X
+ B. After I faced another problem, any metal pieces from 2 inches will
completely false the reading. For example, if your charge is 5 A. Moving a screw
driver at 2 inches of the ZMC10 you will give something like 1A or less. The
other problem that I had faced is if the 2 sensors are closed to each other the
current will interfere and will give you false reading. I had to rebuild
another PCB for that to separate each channel. Also at 0 A the sensor will not
give you zero, you must calculate the offset from one part to the other since
the values are not the same. In last all the values, slopes and offset are not
the same if the current pass from A to B or B to A. I think this caused enough
problems for a simple amp meter.
The MCU has two jobs: measure (calculate) the value from the analog board and display that value. I drove the LCD in graphical mode. I had written the character generator for fonts 1x, 2x and 4x other function like draw line, square, clear screen and more. Also the MCU board has the power supply for itself and for the analog part.
Features
|
|
2 Channel |
|
|
From 0 to 10amp |
|
|
Resolution of 0.1amp |
|
|
Isolation between each channel of 2000 volt |
|
|
Automatic AD/DC detection |
|
|
Very big LCD and character |
Digital Temperature/Humidity/Barometric pressure
History
This project is one of many others I had made to control my house with rules, web interface, logger and many more. This project could take several measurements: Temperature/Humidity/Barometric pressure measurements. All measurements are taken digitally and have their own dedicated A/D converter in each sensor. It's a REAL digital environment sensor WITHOUT any calibration.
The humidity and temperature are sense by a very good component made by Sensirion SHT75 and the impressive barometer is done my Intersema MS5534. Those two components talk their own language which is similar to other Serial synchronous protocol (or SPI).
Features
|
|
Digital reading of temperature |
|
|
Digital reading of humidity |
|
|
Digital reading of barometric pressure |
|
|
NO CALIBRATION |
|
|
RS485 interface |
|
|
Network firmware upgradeable |
Propeller Analog/Digital Clock
History
I got this idea by browsing the web. I found by hazard Mr. Bob Blick's page who make the first propeller clock. I began to check how can I build one myself. Base on AVR AT90S2313 I saw rapidly that my MCU must be clocked very fast to make all the calculations needed to light the leds at the right place. The speed is at 16Mhz, 4 times faster than Atmel's specifications. It's working without any problems.
Each time the PCB passed at 12h00 an hall effect sensor sensed the magnet and generated an interruption. At this time, we have to check the counter to se how many ticks had been passed from this rotation since the last rotation tooks this value and divide it by 360. This calculation will gives you the time between each degree. Now, you have to set an interruption to occur at each degree and after you will be able to light leds whenever you want at any of 360 degrees. At this MCU speed, there is no jitter everything is just FIXED!!!
A simple IR sensor is used to take the signal from the remote control (set to a Sony protocol).
Don't forget to use HIGH BRIGHTNESS LEDS 1600mcd. Leds are not lighted very long so the mcd's power must be high.
Features
|
|
Analog clock mode |
|
|
Digital clock mode |
|
|
Infrared clock setting with a standard universal remote control |
Bar Code Reader
History
This is a low cost bar code reader made from a product which has a very long history. You can see it at this link. This bar code reader can be purchased for around 6$ at http://mavin.com/computermice.html.
The bar code reader named CueCat is built to be connected in a PS2 keyboard port (standard PC/AT Keyboard). The problem is the information encrypted. I decided to build a small interface which fits in the CueCat to convert, decode the information and send it via RS232. Each time you scan a product, the decoded code is sent serially and is stored in an EEPROM which could store up to 128 bar codes. The idea is to read many bar codes away from the PC. This information could be retrieved later when the bar code reader will be connected to your PC. Later, you could send some commands to communicate with the CueCat. For example, "G" will get all the codes currently stored in the EEPROM; "C" will clear the entire memory.
Features
|
|
Very low cost |
|
|
128 bar codes memory |
|
|
RS232 interface |
Train Modeling Digital Devices Control (DCC)
Need someone to correct all my grammatical error, please.
History
This is the second part of the DCC project, controlling all accessories via the DCC data on the track. You can connect: switches, lights and many more... This board has hardware address setting via jumpers, so you can have many of those
Features
|
|
Directly connected to the track |
|
|
Very low cost |
|
|
8 relay output |
Train Modeling Digital Control (DCC)
History
This is a common project with my father, building a train modeling. One more time it could be simple, but I had decided to challenge myself once again. The train modeling had changed with years, now you can have more than one engines on the same track and each one could have a different speed, direction "watch out". It's done by sending data on the track by reversing the voltage on the track with an exact timing protocol. Like you can imagine it's not the output of your MCU who drive directly the track, you need a driver that will at lease give you 3 amps. Those controllers already existed but it's costly and they don't do what I was looking for. You can find more info on the protocol and how it's work just by typing "+DCC+train" in Google, that's what I have done.
Features
|
|
Control 4 engines simultaneously |
|
|
Control 30 switches |
|
|
Short track detection and power cutoff |
|
|
Side track programming engine registers |
|
|
Train head beam control |
|
|
Firmware upgradeable |
AVR Debugger
History
The fact is, 10 years ago
this project could have been completed. It will be a useful tool to help you
debug code. The challenge was to make a debugger that does not require any MCU
resources to be used from the MCU, allowing the debugger to run integrated with
the code being debugged. The Debugger only use 1 I/O pin, and is connected to a
serial port from the host PC. Using a VT100 terminal to capture the output from
the Debug tool, all of the debug information can be captured. By adding a simple
command along with the debug firmware, you can send out debug statements like
debugXY(x,y, "test"). The Debugger will adapt to any speed from 1Mhz to 20Mhz
without configuration from the user.
Features Ver : 1.0
|
|
No resource need in the MCU you are debugging |
|
|
No configuration to do |
|
|
Run with MCU from 1Mhz to 20Mhz |
|
|
Use VT100 terminal emulator as debugging window |
|
|
Self powered by the serial port of your PC |
|
|
Simple to build |
|
|
Convert any I/O in a verbose debugger |
|
|
Reset button |
System Requirements
|
|
Terminal software |
|
|
Debugging circuit with the HEX file of the debugger |
|
|
PC free serial port |
Door Bell
History
The door bell seems like a simple project but it's not! There is one major difficulty it's to generate a sine wave via Pulse Width Modulation.
The output of OC1A from ATMega8 oscillates at 32 kHz and the pulse width determined value from a sine look up table. A low pass filter of 1.8 kHz removes the 32 kHz. The resulting output is a pure sine wave. To archive a better sound I used two sine waves at the same note but at a different octave. You can listen this song here. The decay of each note is done via another PWM which control the gain of the output amplifier.
Features
|
|
Many different songs can be done |
|
|
Nice sound |
Frequency Generator
History
This project didn’t look complicated but it was. The MCU part is really simple: just some code for the Display, Keypad and DDS Communication.
Once my MCU Board and the DDS board were done, I connected everything together and a cool sine wave was coming out of my DDS ranging from 1Hz to 5Mhz. I thought to myself that this project was almost done.... beeeeeeeeeep, wrong again! The worst part was to come. It's not so easy to amplify a signal of 400mv to +/-15v, 300ma at 5Mhz. First you CAN'T prototype this on a bread board. So I built more than 5 PCB's. Also, I had to find a very high speed Op-Amp that came in a package suitable for prototyping. I chose the LM7171 for its low cost and DIP package. With an Op-Amp like this you must have decoupling capacitors on the - and + side to GND VERY CLOSE to the IC (each Op-Amp separately).
Note:
The AD9833 DDS datasheet rates it for 25 Mhz, but in the preliminary datasheet
it was rated for 50Mhz. I made my project work at 50 Mhz and there was no
problem. Just don't try it for final production. The higher the clock rate, the
better the output signal will be.
Features
|
|
Frequency from 1Hz to 5Mhz |
|
|
Accuracy of 0.1Hz |
|
|
Square/Sine/Triangle Output |
|
|
5V TTL output |
|
|
Output up to +15v to -15v peek to peek |
|
|
Ajustable DC Offset from +15v to -15v |
Frequency Meter
History
Here is my new Frequency meter who was done with a LCD's cellular phone!!! This is a simple project. The Frequency is passing through an op-amp to convert it in a square wave. The ouput of the op-amp is feeding the 3*8 bits counter (24 bits) who can accumulate at a maximum of 16777216 count. The maximum frequency you can measure without changing the time base of one second is 16.777216 Mhz. The ATMega8 have 3 functions: enable the counter gate at each second, read his value and display it on the LCD.
Features
|
|
Small box |
|
|
Frequency and period display |
|
|
Auto Scale |
|
|
LCD back light |
Graphic LCD Library for SED1330
History
This LCD is very different from the other standards text 2 x 20. This graphic and text LCD is 320 x 200 pixels. This LCD have differents memories map for the text and graphic region. If you buy this LCD in a "real" electronic store you will pay like 400$ each but you can find it brand new in a surplus store for 50$!!!. I used this LCD in a major project to display charts and a lots of information collected around my house: temperature, humidity, wind speed, etc. This LCD is perfect for project that needs to display a lot of information.
In the source code you will find all the functions you need to make this LCD works.
Functions Features
|
|
void LCDWriteData(unsigned char byte) |
|
|
void LCDWriteCmd(unsigned char byte) |
|
|
unsigned char LCDReadData(void) |
|
|
void InitLCD(void) |
|
|
void ClrSCR(void) |
|
|
void GotoXY(unsigned char, unsigned char) |
|
|
void LCDWriteString(char *ptr) |
|
|
void LCDWriteConstString(const char *ptr) |
|
|
void Cursor(unsigned char cursor) |
|
|
void GClrSCR(void) |
|
|
void GPix(int x, int y, unsigned char stat) |
|
|
void GBox(int x1, int y1, int x2, int y2,int stat) |
|
|
void TextBox(int x, int y, int length,int stat) |
|
|
void GLine(int x1, int y1, int x2, int y2) |
HCLoad
History
HCLoad is a Windows boot loader for many flavor of HC11 who the register map is the same as a M68HC11E9. HCload is a solution for many students and hobbyists who look for a powerful tool to program, erase, verify the EEPROM, EPROM, ROM of a HC11. Please note that HCLoad had been written in 1998 and there is no more development in this software.
Features Ver : 6.0b10
In the HC11
|
|
Check the communication between HCLoad and the PC |
|
|
Program/Verify/Compare/Erase the EEPROM of the HC11 |
|
|
Program/Verify/Compare the EPROM of the HC11 |
|
|
Program the config register of the HC11 |
|
|
Download/Execute code in external RAM |
|
|
Upload any internal/external memory range to your PC in a S19 file |
|
|
Program/Verify/Compare a external EEprom |
|
|
Connect/Disconnect HCload to CommPort |
In the Xicor
|
|
Modify the Software Data Protection |
|
|
program/Verify the EEprom |
|
|
Modify the EEM register |
|
|
Modify the SFR register |
|
|
Reset the Xicor (if you mess your Xicor) |
System Requirements
|
|
Windows 95, 98 or NT 4.0 |
|
|
16 Megs of RAM |
|
|
8 Meg of Hard disk space |
|
|
Minimum video resolution of 640x480 (*800x600) *: recommended settings |
Digital Intercom
History
This project was inspired by my girlfriend, who asked me to build an intercom for our house. There are many ways to build an intercom; an example is batteries in series with 2 telephones, a key switch and an amplifier. I felt this was far too simple. I decided to build an intercom with an MCU which digitalizes a voice and then sends it serially and then regenerates the analog signal. I equipped the microphone with an ACG to ensure that anyone in between 1 inch and 10 feet from the microphone will sound good. After that I send the analog signal to the A/D of my MCU which digitalizes the voice and sends it serially to the other intercom that you have previously set the "address" for. The digital signal is sent to an RS422 interface, which sends it to a RS422 hub, which then broadcasts the data to the other intercoms. The addressed intercom takes the data and regenerates the analog signal via a PWM and a simple analog filter. I found a really cool 3 Watt Amplifier which works at 12 volts with a pin to control the output volume.
Features
|
|
LCD |
|
|
AGC |
|
|
Simple power amplifier with volume control |
|
|
PWM generated D/A |
|
|
Sine wave generator for key sound and pre-tone |
Led Sign with MMC Memory Card
History
At the beginning this project was to buy a led sign to interface with my home automation network. This automation network display information like temperature, wind speed, humidity, etc. I had bought on EBay a LED Sign but when I received it I got a surprise! There was no serial port to program messages... After a couple of days, I look inside to see how it was built. The principle of operation is simple you have just 160 bits shift register with drivers for LEDs. I removed the old CPU from the LED sign and connected a couple of wires to the shift register (column driver) and the row driver to an ATMega128. The main reason why I chose to use an ATMega128 was the need of a large amount of RAM. I decided to use a MMC memory card to store all the messages for 3 reasons: low cost, SPI interface and a lot of space for messages.
Features
|
|
3 Colors messages |
|
|
5 Scrolling speed |
|
|
Serial port for uploading messages |
MegaLoad
History
MegaLoad is a Windows based boot loader for all Atmel ATMega microcontrollers that support the Bootloader function. MegaLoad is a solution for everybody who wants fast loading (~8k in 3 seconds) and easy software upgrade via MCU RS232 port.
Features Ver : 8.0
|
|
Now support device larger than 128k flash |
|
|
Small Bootloader code. Only 256 words if only flash program is need (512 word if flash & EEPROM) |
|
|
Auto baud configuration allowing any oscillator setup. |
|
|
Only embedded requirement is RS232 connector like a MAX232. |
|
|
Communicates at 9600,19200,38400,57600,115200bps on Com1 to 20 |
|
|
Simple Monitor window is available to help you to debug your code |
|
|
Checksum everywhere to secure data |
|
|
Automatic page retry, if error in flash programming |
|
|
Automatic byte retry, if error in EEPROM programming |
|
|
Manual set & clear DTR,RTS if need. |
|
|
Reset button |
System Requirements
|
|
Windows, .NET framework 2.0 runtime |
|
|
RS232 |
|
|
ATMega |
Kitchen Mood Light LED Lightning
History
Features
|
|
1024 3W RGB LEDs can be controlled |
|
|
Over 16 million colors can be generated |
|
|
Very powerful, can be used as your primary lighting |
|
|
Many patterns are pre-programmed |
|
|
Can be connected to any audio RCA jack and the system will became a Music color organ!!! (It's crazy) |
|
|
Firmware upgradeable via RS232 |
MP3 Player
History
I decided to do this project for several reasons: first I like music, second I have a huge collection of MP3, and third I wanted to be able to play them anytime in my living room. I began the project with one major restriction, the printed circuit board of MP3 player MUST be single side in order to do it myself. After 2 months of drawing, I realized this project was in fact ‘feasible’! One major characteristic of this player was the bi-directional remote control. I had to give several information, folders and songs on a small graphic LCD. In the comfort of your living room you can browse and listen to 30 gig of MP3.
The MP3 player is nicely built around the Atmel ATMega128 running at 16Mhz. The MP3 decoder is a VS1001k which gives a crystal clear sound. The USB interface is done via FT232MB, which by the way, makes USB development very simple. In this project I found two big difficulties: understanding FAT32 and transmitting a large quantity of information via Infrared.
In order to understand FAT32 I used these tools:
- Windows software for checking the hard drive data on sector like WinHex.
- Microsoft FAT32 white paper's reading (not so easy to understand)
- Other source code of FAT32's analyzing could be useful
Infra Red Communication
Devices like GP1UD26xk (infrared sensor) need to have a density of 1's lower then 45% so the Manchester encoding MUST be used with a speed of 2400bps maximum and 2 stop bits. Manchester encoding gives you 50% of 1's. Each time you send "1" you will send "10” and for "0" you send "01". The utilization of 2 stop bit by bytes will give you approximately 45% of 1's. The fact is that you loose 50% of the original speed but that's the only way to do it and you will send the double quantity of bytes.
ATA Interface
The ATA interface in PIO mode is very simple, if you know how to interface any MCU peripherals this is the same method. You have a 16 bits address bus which controls the register you want to write to or read from.
Features
MP3 Player
|
|
IDE ATA interface |
|
|
FAT 32 with long file name support |
|
|
USB interface |
|
|
On board power supply (input from 7v to 20v DC) |
|
|
Bootloader firmware upgradeable via USB port |
|
|
Infrared bi-directional interface |
Remote Control
|
|
Back light graphic LCD |
|
|
worked with only 2x AA batteries |
|
|
In sleep mode sink less than 1uA (2.5mA in active mode) |
|
|
5 buttons for easy navigation |
|
|
Long range (more than 20 feets) |
Network Light Dimmer with Slider Control
History
This project is one of many I have undertaken to control my house using a set of rules, a web interface, a logger and many more components. This project is a light dimmer which has multiple control interfaces such an RS485 network, an infrared remote control, a proximity touch slider or touch sensor.
It is based on a ATMega8 and
the well known Qprox QT401/QT110proximity sensor. The Mega8 had lots of things
to do: detect zero crossing of phase, calculate the firing angle for the triac,
manage the network communications, check for a finger presence and position on
the proximity touch slider and detect and decode infrared coming from a remote
control. The device is powered from the RS485 network connection which has +12,
data+, data- and GND. On the schematic you will see that there are two
detectors, one is the slider, and the other is a simple touch detector. It was
done like this so that non-dimmable loads can be driven by using the touch
detector as the control. That is why there are circuit pads on the board for two
sensors.
Features
|
|
Slider QProx sensor |
|
|
IR receiver |
|
|
RS485 interface |
|
|
Opto isolated |
|
|
Up to 500watts |
|
|
Network firmware upgradeable |
Nokia LCD Library
History
I found this LCD make for cellular phone Nokia 3310 by browsing the web at www.jelu.se. There is many interesting things about this LCD: low price, easy to interface via SPI port, can support graphic and text and consume low current. The only thing that I did is writing code who gives you friendly functions to support this LCD. The last version of the library only send the bytes who had changed since the last update. It's considerably reduce the refresh time who can be very important in a batteries powered system.
Functions Features
|
|
LcdInit(void) |
|
|
LcdClear(void) |
|
|
LcdUpdate(void) |
|
|
LcdGotoXY(byte x, byte y) |
|
|
LcdChr(LcdFontSize size, byte ch) |
|
|
LcdStr(LcdFontSize size, byte *dataPtr) |
|
|
LcdPixel(byte x, byte y, LcdPixelMode mode) |
|
|
LcdLine(byte x1, byte y1, byte x2, byte y2) |
OneWire Library
History
The OneWire protocol which in fact needs two wires (data and ground) is fantastic for many reasons: you can have a very long cable (250 feets), you can have multiples of devices on this cable and with a simple code you can poll those devices to get temperature, voltage, switch position, wind speed, etc.
This protocol was developed by Dallas Semiconductor (now Maxim-IC). Many flavors of devices can be connected to an OneWire port. You can see them at Maxim (http://www.maxim-ic.com/1-Wire.cfm) web site!
OneWire Features
|
|
Cable can be long |
|
|
Devices take their power from the data line |
|
|
Multiples devices can be used on the same cable |
|
|
Each device has is own ID (48 bits serial number) |
Bench Power Supply 2.0
0-25v @ 0-5Amp
I need someone to correct my grammatical error, thanks
History
This project is like the one that all of you must have done in electronics. I took the idea from Circuit Cellar. The original power supply provides an output of 2.5-15V at 500mA. This circuit will provide 0-25V at 0 to 5A. You will see there is a lot of modification to achieve this.
This is my second version of this power supply, the first one was made with mosfet who need a higher voltage on the gate I had to use a higher input voltage and because of this there was a lot of heat generated for nothing. This version work with transistor and it's much more better.
I will explain you some part of this power supply. First you must find a transformer which can handle 24VAC at 5A and one with 6.3VAC at 100ma. I use 2 transformator to have 2 DC level 30V and 40V. The 30V Power the high current for the output and the 40V power all the rest of the circuit. The LT7013 opamp is split in 2 function, the part A is the voltage control and the part B is the current control both opamp output is connected together via diode so the one who output a lower voltage win on the second, so if you set your voltage to 10V and your current to 1A and you short your ouput the current part will pull down his output and the voltage will drop. The current part use a very nice component the ZXCT1009 that work like a current mirror. it will generate a current proportionally the the one who pass in the sense resistor, this current is pass in the pot R8 who convert it in voltage. The output have many transistor because the opamp can't give a lot of current, and note that the resistor R23 is very important, this one will protect your output transistor from a output short circuit "transistor explosion is faster than the current sense". If you build this supply you will be impress how fine it's work.
I also connect to this power supply a LCD to inform you of the set point for voltage and current, plus the current voltage and current. It's done with a small ATMega32 with 4 A/D input to received the value from the power supply and with some simple calculation it display those value.
Features
|
|
Output Voltage adjustable from 0 to 25v |
|
|
Output Current adjustable from 0 to 5amp |
|
|
Digital reading of set points for current & voltage and output current & voltage. |
|
|
No need of multi tap transformer or center tap transformer |
|
|
Short circuit protected |
|
|
Very low cost |
Text LCD Library for HD44780
History
What can we say about a standard text LCD? Nothing else then for 90% of your project you usually begin with this LCD. With those friendly functions you will be able to begin your projects without loosing time writing code for the LCD.
Functions Features
|
|
void LCDInit(ushort
x,ushort y); |
|
|
void
LCDOff(void); |
|
|
void
LCDClrSCR(void); |
|
|
void
LCDGotoXY(ushort,ushort); |
|
|
ushort
LCDWhereX(void); |
|
|
ushort
LCDWhereY(void); |
|
|
void
LCDWriteString(char *); |
|
|
void LCDWriteConstString(const
char *); |
|
|
void
LCDWriteChar(char); |
|
|
void
LCDWriteData(ushort,ushort); |
|
|
ushort
LCDReadData(ushort rs); |
|
|
void
LCDCreateCHR(ushort chnumber, char *ptr); |
|
|
void
LCDWait(void); |
|
|
void
LCDDelay50us(int Delay); |
|
|
void
LCDTextAttr(ushort attribute); |
|
|
void
LCDContrast(ushort Cont); |
Water Detector
History
This is a very simple one. That's the only project who don't have any MCU, why??? Because it is connected to a external MCU!, It is a water detector who serve to close the main water valve of my home if water is detected at certain places.
Weather Station
History
This project is one of many
others I had made to control my house with rules, web interface, logger and many
more. This one is a weather station that reports almost anything about the
external environment. I bought mechanical part of the wind sensor at
http://www.aag.com.mx/indexaag.html
I had to remove all the electronics that came with it and replace them with my
own. The lightning detector is very simple but it works very well if you have a
REAL ground, not your ground of your electronic part, and don't worry about the
9v battery, after 2 years it is still working. The humidity and temperature
sensors are the same ones I had used in the barometer project. I drilled a 3cm
hole in 5 soup bowls, mounted upside down. The top and bottom soup bowl doesn't
have holes. The sensors are place in the middle of those and this way the
sensors are protected from sun heat and the air could pass through. The light
sensor is done with a simple LDR and that does a good job to tell my house to go
into night mode. Rain fall sensor is a simple tipping bucket that gives pulse
to the MCU and with a simple formula you can know how many millimeter of rain
fell.
Features
|
|
All direct digital reading |
|
|
Temperature |
|
|
Humidity |
|
|
Light |
|
|
Lightning |
|
|
Humidex |
|
|
Wind chill |
|
|
Wind speed |
|
|
Wind speed max in the last hour |
|
|
Wind direction |
|
|
Rain fall |
Wind Sonic
First note
History
This project looks simple, but it’s one of the most complicated projects I've ever made. In books it looks simple, in real life it's really hard though. The main goal is to measure wind speed with the speed of sound. In the beginning I used a cheap 40 kHz ultrasound transceiver. That was working fine until I tried to replace those transceivers with something that will be able to last outside though rain and snow. I tried to make the transceivers closed frame, but as soon as I replaced the open frame with the closed frame, nothing was working, and the output levels were way too low. I started a topic on http://www.avrfreaks.net and by chance, I got heaps of help and ideas. Guillem told me that he had tried something like using 20 closed face transceivers, but he found that only one was working. Guillem was generous enough to send me 6 of his closed face transceivers. As soon as I put in the transceivers that he had sent me, the prototype began to work. Normally if you check all the schematic of ultrasonic measurement you will see that the measure time from North to South and South to North, this way it will remove the difference of sound speed versus temperature, but in fact it doesn't work because it makes a lot of cross talk between the Tx and Rx pins, you need to send a 40 kHz burst at 5V with the same IC that you amplify the signal by 4700... So it measures the time between South to North and West to East, to adjust the calculation. I had use a DS18B20 to measure the air temperature and this way I can have both valid wind speed add valid Temperature
It worked this way. I had to send a very small burst of 40 kHz (3 pulses). I started a counter in the AVR and when the sound arrived at the other side of the transceiver it generates an interrupt, the time between the Tx and Rx is supposed to be the speed of sound at this temperature, if it's faster it's because you have wind in this axe North South, if it's slower it's because you have wind in this axe South North. With 4 transceivers and some formulas you can have the wind speed in any direction and you can know what the direction of the wind is. I want to thanks all the friends that help me on www.avrfreaks.net
You can check all the discution about this project http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=219485#219485
Senscomp ultrasonic transducer http://www.senscomp.com/products.htm#transducers
Here is some formula that I had use in this project
SonicSpeed = (331.4 + (0.6 * SonicTemperature));
D = SonicSpeed *
SonicOffsetNorthSouth;
Vn = D / SonicTimeNorthSouth;
Vn = Vn - SonicSpeed;
D = SonicSpeed * SonicOffsetEastWest;
Ve = D / SonicTimeEastWest;
Ve = Ve - SonicSpeed;
MeterPerSecond = sqrt(pow(Vn,2) + pow(Ve,2));
Tmp = abs(MeterPerSecond * 3.6);
SonicKmh = (Tmp + (4 * SonicKmh)) / 5;
if (SonicKmh > 2) SonicAngle = abs(atan2(Vn,Ve) * 180 / _PI);
Features
|
|
No mechanical part |
|
|
Accuracy of 2km/h |
Very high microphone gain
History
This project is my father
idea, he found in a old army surplus store a radar with a dish mount on. His
idea was to make a very high gain microphone to be able to listen to almost
anything very fare like birds or what ever you want,..... The electronic
circuit is simple, just a electrets microphone mounted in the focal center of
the dish and a amplifier made of two op-amp, the first to give more gain and the
second and the most important is the AGC "Automatic Gain Control" with this if
the sound you listen is fare or near of you the audio signal will be the same.
In the schematic there is no power output for the audio, you can use a simple
LM386 to drive your head phone. You will see it's incredible what you can heard
with that! have fun,