Subject:
|
Re: Real-world interfacing to RCX: LEDs and magnetic sensor
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Thu, 9 Jun 2005 16:17:19 GMT
|
Viewed:
|
4067 times
|
| |
| |
In lugnet.robotics.rcx, Dave Pyatt wrote:
|
I would like to be able to drive one or two banks of 7-8 LEDs off of the motor
ports on the RCX. I know that there is a winker board that senses the motor
level to determine what pattern to display. Can this be accomplished
otherwise? I also want to use a magnetic sensor to calculate the RPM of a
motor... can the RCX respond quick enough to sense 5000-10000+ switch closures
per minute?
Thanks!
Dave Pyatt
dcpyatt@jclay.com
|
The motor outputs give a square wave of 1/8 up to 8/8 of a cycle. You can use a
counter running at 8x the cycle frequency to measure how many eighths the output
is giving, and light an LED accordingly.
For the magnetic sensor, I suggest converting the pulse frequency into a level
so that the analogue input can read it. For this I suggest a capacitor
(10-470uF) with the magnetic switch providing charge pulses from the supply
through a small resistor and a larger fixed resistor in parallel with the
capacitor discharging it at a fixed rate. Then use an LM358 or LM324 op-amp to
buffer the capacitor voltage onto the sensor input, like this:
http://www.brickshelf.com/cgi-bin/gallery.cgi?i=1067044
Experiment with fixed resistor values to get a discharge rate proportional to
the maximum pulse frequency you want to measure. Bear in mind that a capacitor
discharge wont be linear, but its a simpler system than generating a perfect
sawtooth wave.
Mark
|
|
Message is in Reply To:
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|