Shop
OBEX
P1 Docs
P2 Docs
Learn
Events
hz reader and switching — Parallax Forums
toggle menu
Categories
Discussions
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Sign In
·
Register
×
Home
›
BASIC Stamp
hz reader and switching
prochips
Posts:
6
2007-03-21 04:19
edited 2007-03-24 03:37
in
BASIC Stamp
hello
I
·
trying to
·
write the code for bs2 oem
·
,
·
for reading hz of 5v square wave and later trigger relay if the Freq is > 120hz
but dosent work
·
thanks
·
wilson
Post Edited (prochips) : 3/21/2007 4:44:12 AM GMT
bs2
bs2
test2.bs2
360B
hz switch shematic.JPG
538 x 382
-
9K
test2.bs2
360B
hz switch shematic.JPG
8.6K
Comments
stamptrol
Posts:
1,731
2007-03-21 12:09
edited 2007-03-21 12:09
Wilson,
Everything looks OK.
Are you sure the the square wave is actually swinging the stamp pin 15 from 0 to 5v? Also, is the negative from the square wave source tied to the stamp's negative?
You can reduce the 10K resistor down to 100 ohms or so when inputing a ttl signal.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
allanlane5
Posts:
3,815
2007-03-21 12:57
edited 2007-03-21 12:57
I see no ground input indicated -- have you connected a ground as well as the desired signal?
Phil Pilgrim (PhiPi)
Posts:
23,514
2007-03-21 15:06
edited 2007-03-21 15:06
How many pulses per revolution does your motor produce? If it's one — not four — you need to compute RPM as follows:
RPM = Pulses * 120
The same applies to the frequency. Since you're counting for 1/2 second, the frequency you want to check will equal
pulses * 2
, not
pulses
.
And finally, in your code, when the value being checked equals
100
, the state of the LED doesn't change. Is that what you intended?
-Phil
prochips
Posts:
6
2007-03-24 03:37
edited 2007-03-24 03:37
ok ,I need conect ground to input signal
Sign In
or
Register
to comment.
Comments
Everything looks OK.
Are you sure the the square wave is actually swinging the stamp pin 15 from 0 to 5v? Also, is the negative from the square wave source tied to the stamp's negative?
You can reduce the 10K resistor down to 100 ohms or so when inputing a ttl signal.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
The same applies to the frequency. Since you're counting for 1/2 second, the frequency you want to check will equal pulses * 2, not pulses.
And finally, in your code, when the value being checked equals 100, the state of the LED doesn't change. Is that what you intended?
-Phil