Shop OBEX P1 Docs P2 Docs Learn Events
Frequency and Duty Cycle Meter using BS2 and LCD — Parallax Forums

Frequency and Duty Cycle Meter using BS2 and LCD

Tronic (Greece)Tronic (Greece) Posts: 130
edited 2006-07-26 08:48 in Robotics
Frequency and Duty Cycle Meter using BS2 and LCD


bigfreqexamplesm7os.jpg



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.

frequencymeterlcdbreadboardeds.jpg


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.

serialconnectionsm6rm.jpg


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.

bfmvsbs2sm1cm.jpg
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


insidetopsm0tp.jpg

freqboxundersm0sg.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

progmodulesm2eq.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!!
lcdbacklightpwmcircuit3oz.gif
lcdbacklightpwmcircuitpcbsm7qo.gif


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:

dutyform3b50br.gif

For example:

dutycy23b55mo.gif

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

connectionscloseup2sm2ng.jpg

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


· scool.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Greekbotics: Greek Robotics Forum

Post Edited (Tronic (Greece)) : 6/8/2006 2:08:28 PM GMT

Comments

  • BeanBean Posts: 8,129
    edited 2006-06-08 14:07
    Very nice. I like it alot.
    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
    ·
  • SN96SN96 Posts: 318
    edited 2006-06-08 20:02
    You did a fine job cutting out the space for the LCD!

    Very Nice.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    ·
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-06-09 06:44
    Thanks,

    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
  • Robert@HCCRobert@HCC Posts: 80
    edited 2006-06-09 10:53
    I love that serial module and mini-BS2 ! I remember seeing both here before, and have been tempted to make both myself - just have not worked up the courage yet to attempt it!

    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
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-06-09 12:05
    Robert@HCC·you are right. Our server is down due upgrade reasons and might be a while before I fix the links... so I'll post it here...


    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
    800 x 300 - 94K
  • Robert@HCCRobert@HCC Posts: 80
    edited 2006-06-10 00:42
    Thanks , Tronic - that would be great! email at :
    robert@hawaii.rr.com

    BTW, I was actually looking for the underside of the SerialModule.. thats ok , though.

    Alohas, and thanks!
    Robert
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-06-10 07:17
    Oh, I'm sorry. I was so tired yesterday I replyied that I sended wrong image.

    well here it is:


    PS. I sended you the whole project by email. yeah.gif



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Greekbotics: Greek Robotics Forum
    800 x 600 - 135K
  • Robert@HCCRobert@HCC Posts: 80
    edited 2006-06-10 09:03
    Thank you so much, Tronic - that was great of you to email me the project!

    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
  • Jim RicheyJim Richey Posts: 82
    edited 2006-06-10 22:22
    Tronic:

    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!
  • MarcelMarcel Posts: 32
    edited 2006-07-26 08:48
    Good project, nice.

    Marcel
Sign In or Register to comment.