Reading voltage of infraredsensor
I'm trying to read the voltage of a infrared sensor, the sensor will continualy send to pin0.
Maybe a ADC, but that requires a output pin.
CPU.readPin(CPU.pin0); will only reaturn a boolean.
Can you help me?
Thanks!
Maybe a ADC, but that requires a output pin.
CPU.readPin(CPU.pin0); will only reaturn a boolean.
Can you help me?
Thanks!
Comments
If you only have one spare pin, then that pin must be the ADC input.
For output, you can possibly use another pin that·is currently assigned to some
other device. For example, if you do have an I2C bus implemented,
you can use the SCL pin as output for the ADC. You only must start and stop
the ADC between using the I2C bus. (the SCL pin may be toggled as long as SDA
remains high, eg. idle state for I2C)
Without further knowledge what you have connected to the javelin
this is the best advice I can give.
regards peter
It has the following connections:
- 5V
- 0V (ground)
- signal
Can I connect the 5V to pin1 and use that as output?
Thanks for your quick reply!
(this sensor can be used with a Robocup junior infrared ball)
Connect 5V to sensor 5V pin.
Connect GND to sensor 0V pin.
The sensor signal pin is input to the ADC circuit.
The ADC output pin generates a pulsewidth signal.
Without knowing what you have connected to the javelin, and how, I cannot help.
Draw up a schematic and post that.
regards peter
I've found the following script for the muvium processor. adc information can be foud here: http://www.muvium.com/Tools/uVMDK/uVMDK-Standard/com/muvium/apt/ADCReader.html
I still don't get why ADC (for Javelin) needs an output pin.
··················· +
o Javelin ADC in
··················· |
Vin o
[noparse][[/noparse]10k]
+
[noparse][[/noparse]10k]
o Javelin ADC out
··················· |
················ [noparse][[/noparse]0.1uF]
··················· |
···················-+- GND
The ADC out pin outputs a pwm signal such that the voltage
level at the ADC in pin is maintained at 2.5V
The dutycycle of the pwm signal is then equal to the Vin voltage
in (5/255) volt units
regards peter
Thanks!
I've used the following connections, can you check if this is right?
Thanks!
Vss = ground pin from sensor
Vis = 5V input on sensor
Sig = signal from sensor
Post Edited (Robot Freak) : 2/14/2007 8:30:27 PM GMT