Frequency and Duty Cycle Meter using BS2 and LCD
Tronic (Greece)
Posts: 130
Frequency and Duty Cycle Meter using BS2 and LCD
I made this project which is measures the frequency of a signal and its duty cycle. I have used the Basic Stamp as a frequency meter tool a lot in the past and lately, thanks to parallax’s mini projects, I got into the procedure coding duty cycle routines.
So I decided instead of having it hanging around with all the wiring exposed to dust and humidity, to place it in a nifty box adding a cool LCD with backlight. I got the box from an old digital phone answering machine that was burned by lightning years ago.
The basic Stamp I had was in OEM packet integrated into a big board similar to the original board of education so I had to make my own little OEM board with only the essential. That is the bs2 chip, its crystal, a 24LC16 memory and a voltage regulator. I fitted all this to a small board of 2cm x 5cm which was little smaller in the size by the LCD itself.
I kept the membrane buttons but I had to solder new touch pads on the support board. I didin't used ALPS buttons because there was no room between the support board and the membrane buttons...
bs2miniboarddiag5cx.jpg
bs2minivslcd2x164ch.jpg
supportboards4sm3vn.jpg
supportboards2sm0ci.jpg
I made a small module that contained the serial connection that I could connect at any time to my mini bs2 thru its programming pin header. I managed to place the mini bs2 into the box in such way that it would easy to plug the programming module easy in the back of the box to program it without having to unscrew the lid. The five small holes I made to the back that fits the bs2 programming header are so small that one might not notice them.
modulecontop16ra.jpg
serialmoduleconnector1sm6bp.jpg
The LCD backlight driver is from a circuit I found somewhere in the parallax docs but with an addition of a 10K potentiometer to be able to set the exact PWM rate or even better its brightness!!
I tested it and worked well on frequencies from 10Hz up to 65 KHz and even higher up to 650 KHz with lower resolution. I even set a button to toggle the High – Low resolution.
I used the following formula to extract the duty cycle:
For example:
The speaker except from beeping on the start can be used to play the frequency the device measures (if it’s in audible limits of course) by pressing the PLAY button!
The RECORD button is used to toggle between the three input lines
boxconnectionscloseupsm2jb.jpg
bs2miniboard5nq.gif
bs2proginterface1gk.gif
Some video of its operation:
Bs2 Frequncy Meter demo1
Bs2 Frequncy Meter demo3
Bs2 Frequncy Meter demo4
The source code is in the projectfiles.zip
Thanos
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
Post Edited (Tronic (Greece)) : 6/8/2006 2:08:28 PM GMT
I made this project which is measures the frequency of a signal and its duty cycle. I have used the Basic Stamp as a frequency meter tool a lot in the past and lately, thanks to parallax’s mini projects, I got into the procedure coding duty cycle routines.
So I decided instead of having it hanging around with all the wiring exposed to dust and humidity, to place it in a nifty box adding a cool LCD with backlight. I got the box from an old digital phone answering machine that was burned by lightning years ago.
The basic Stamp I had was in OEM packet integrated into a big board similar to the original board of education so I had to make my own little OEM board with only the essential. That is the bs2 chip, its crystal, a 24LC16 memory and a voltage regulator. I fitted all this to a small board of 2cm x 5cm which was little smaller in the size by the LCD itself.
I kept the membrane buttons but I had to solder new touch pads on the support board. I didin't used ALPS buttons because there was no room between the support board and the membrane buttons...
bs2miniboarddiag5cx.jpg
bs2minivslcd2x164ch.jpg
supportboards4sm3vn.jpg
supportboards2sm0ci.jpg
I made a small module that contained the serial connection that I could connect at any time to my mini bs2 thru its programming pin header. I managed to place the mini bs2 into the box in such way that it would easy to plug the programming module easy in the back of the box to program it without having to unscrew the lid. The five small holes I made to the back that fits the bs2 programming header are so small that one might not notice them.
modulecontop16ra.jpg
serialmoduleconnector1sm6bp.jpg
The LCD backlight driver is from a circuit I found somewhere in the parallax docs but with an addition of a 10K potentiometer to be able to set the exact PWM rate or even better its brightness!!
I tested it and worked well on frequencies from 10Hz up to 65 KHz and even higher up to 650 KHz with lower resolution. I even set a button to toggle the High – Low resolution.
I used the following formula to extract the duty cycle:
For example:
The speaker except from beeping on the start can be used to play the frequency the device measures (if it’s in audible limits of course) by pressing the PLAY button!
The RECORD button is used to toggle between the three input lines
boxconnectionscloseupsm2jb.jpg
bs2miniboard5nq.gif
bs2proginterface1gk.gif
Some video of its operation:
Bs2 Frequncy Meter demo1
Bs2 Frequncy Meter demo3
Bs2 Frequncy Meter demo4
The source code is in the projectfiles.zip
Thanos
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
Post Edited (Tronic (Greece)) : 6/8/2006 2:08:28 PM GMT
zip
122K
Comments
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
Very Nice.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
·
For the cutting of the LCD space I used only a papercut and a lot patience... Its so firm that the LCD holds in place by it self, no glue!
I forgot to mention that I glued small pieces of aluminioum fold on the membrane button contacts to fix their slow reaction time. Now it acts·like a very soft ALPS button!!·· :-)
In my hurry yesterday I mistaken and uploaded the greek comments version of the source code... so here is a fixed one. (for parallal LCD and·the old one·"serial" using 74hc595)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
Although I really need to at least try out the serial module...that would come in very handy...
Nice work!
Hey, btw Tronic- is your english website w/the mini-bs2 still up? Lost the link , and would like to tale another look at the backside of the serial module.
Alohas,
Robert
If you like I can send to you by email the bs2 mini project to read it offline. (maybe later today).
regards Thanos
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
robert@hawaii.rr.com
BTW, I was actually looking for the underside of the SerialModule.. thats ok , though.
Alohas, and thanks!
Robert
well here it is:
PS. I sended you the whole project by email.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
And no worries about the mixup, especially since I have all of them to refer to as needed. When I first saw your Mini BS2 and serial module, I was getting ready to do a college project that involved the kind of detailed proto board soldering you have done. Looking at your work gave me many ideas and encouraged me to believe that what I was attempting with my own project could be achieved.
Thanks!
Robert
You are to be congratulated for the fine example of engineering and hands on craftsmanship.
Very few people have the patience to develop something this technical.
Best Regards,Jim Richey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thanks, Parallax!
Marcel