November 22, 2024, 07:03:55 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


QTI sensor

Started by steveo, June 15, 2008, 05:46:50 PM

Previous topic - Next topic

steveo

Jon,
Have you played with the QTI sensor at all from your friends Parallax? I was wondering if it could be made to sense a "hit" from a red laser light pointer?

JonnyMac

I have used that dude -- with the SumBot that I helped bring to market.  I'm pretty sure that it would work as it's light sensitive.  Use it with a Prop-2 and the RCTIME command.
Jon McPhalen
EFX-TEK Hollywood Office

steveo

June 16, 2008, 07:20:07 AM #2 Last Edit: June 16, 2008, 07:41:10 AM by steveo
That was were my research was sending me, but a one more thing while I helplessly brain-drizzle:

Would a simple photo-resistor make more sense? I've seen some STAMP code wherein (I think) the people wired a small cap across the photo-res leads, then wired one lead to a pin(W), the other to ground(B). They set the pin high for a tenth of a second, then used RCTIME to measure the discharge, and extrapolated the light level based on discharge time.

Your thoughts and advice?

JonnyMac

I have in fact use photoresistors as laser targets -- again with the RCTIME command.  You may need to shield the sensor and do some auto-calibrating of code (i.e., read sensor on program start-up to know what the ambient light is), but it's not too hard otherwise.
Jon McPhalen
EFX-TEK Hollywood Office

steveo

June 16, 2008, 01:34:39 PM #4 Last Edit: June 16, 2008, 06:40:43 PM by steveo
[UPDATE]
works like a charm!

god i love my micro-controllers. Shooting range?... $10 dollar break beam?... what shall i make...

I bought a photoresistor and a 0.01uf cap at lunch today. Will the wiring work as outlined above?

steveo

Jon,
Any trick I could use to make this work with a prop1?

JonnyMac

Not likely; the circuit is designed for RCTIME (Prop-2) and not compatible with POT (Prop-1); you might be able to come up with a kludge in code, but withe speed of the Prop-1 I don't think it would be very effective.
Jon McPhalen
EFX-TEK Hollywood Office

steveo

No way to make it work using the POT function?

JonnyMac

No, the POT circuit is a series RC and the RCTIME circuit is a parallel RC -- the two processors (BS1 and BS2) work completely differently when it comes to measureing RC.

You could try something like this to simulate the RCTIME function:

RC_TIMER:
  rcVal = 0
  HIGH RcPin
  PAUSE 1
  INPUT RcPin

Measure:
  rcVal = rcVal + 1
  IF RcPin = 1 THEN Measure
  LOW RcPin


The Prop-2 RCTIME function has 2 microsecond resolution -- this routine might be about 300 microseconds in resoltuion; not good, but you might want to give it a try for grins.
 
Jon McPhalen
EFX-TEK Hollywood Office

steveo

Thanks Jon,
I'll give it a shot and let you know.