« first day (1769 days earlier)
← previous day
next day →
last day (2564 days later) »
James Young
2:09 AM
does anyone still chat?
@UbuntuUser can i see the quection page?
16 hours later…
Lynn Crumbling
6:29 PM
Hi all - I'm new to circuit design, but not programming. I'm trying to read from an Infrared detector (
sparkfun.com/products/241
) -- datasheet here:
sparkfun.com/datasheets/Components/LTR-301.pdf
Wiring Schematic:
reconnsworld.com/ir_ultrasonic_basicirdetectemit.html
Would it be possible to use the digital GPIO to monitor the output of that?
Feels like I need to convert Analog -> Digital, but I read something that lead me to believe that I might not need additional circuitry.
Ideally, I set this up in such a way that it's a discrete 0 or 1, and then use an interrupt when the value changes (as opposed to polling)
Ghanima
Howdy
connect the phototransistor (like shown in the schematics) via a resistor to 3.3V not 5V
that way you should be able to directly connect it to the Pi's GPIO pin (in the schematics labeled "output")
Lynn Crumbling
@Ghanima so -- 3.3v+ -> resistor -> phototransistor -> output to gpio?
1k ohm?
Ghanima
it reads 10k
no need to significantly change that
Lynn Crumbling
Ah, ok
So, just use a 3.3v source instead of 5v?
What does that achieve?
Ghanima
drive the LED like shown in the schematics but the transistor from 3.3V
reason is this:
the maximum input voltage of the Pi's GPIO pins is 3.3V not 5V
so you want to limit the upper voltage level to 3.3V
Lynn Crumbling
6:44 PM
Makes sense. And will the output from the phototransistor be discrete? (0 or 1) ?
Ghanima
it sure is possible to have an output that is inbetween high and low
Lynn Crumbling
(0v or 3.3v)?
Ghanima
so it depends a little bit on the rest of your setup
i.e. have the phototransistor properly illuminated by the LED to have the transistor properly saturated
Lynn Crumbling
Here's the actualy application - this is a racetrack "finish gate". I need to know when a car is passing over the phototransistor, and throw an interrupt when it happens.
Ghanima
hmm
Lynn Crumbling
6:46 PM
Feel free to suggest a different approach.
(including entirely different hardware.)
In the end, I need accurate timing.
Ghanima
the thing with this setup is that it is fairly sensitive to ambient light
Lynn Crumbling
My old circuit (using a netduino) polled all 4 lanes. It was two slow (3.153s and 3.157s could be a tie.)
Ghanima
as the gap between the sender (LED) and the detector (phototransistor) gets larger your more prone to get trouble with ambient light
how did you read the detector with the *duino ?
Lynn Crumbling
Analog input
(hang on, github link incoming)
Ghanima
so you actually have a setup of the the LED / transistor pair up and running
... and with all that being attached to an analog input you could actually test its output levels for both cases
Lynn Crumbling
6:52 PM
github.com/lcrumbling/derby-racing/blob/master/RaceTimer/…
It was completely analog with that code ... fluctuated all over the place between 80 and 1200 or so.
Ghanima
@LynnCrumbling btw: it doesn't need to be exactly 0 and 3.3 V
Lynn Crumbling
I think a difference of 500 was my magic number.
Ghanima
see here:
raspberrypi.stackexchange.com/a/40404/19949
lower than 0.5 V is likely low and higher than 2 V is likely high
@LynnCrumbling but you have a number for "no car" and for "car" and you could calculate the voltage from that
Lynn Crumbling
Can I still use an interrupt, and set a threshold for the interrupt to fire only when it crosses that number?
Ghanima
that I do not know for sure, maybe they know better there:
arduino.stackexchange.com
Lynn Crumbling
7:01 PM
Ah, ok.
Is there an "easy" way to get 5v -> 3.3v?
(My power source for all of that is 5v atm)
Ghanima
hmm, if you use a Pi, you could use the 3.3V from the GPIO connector for things like this transistor here
Lynn Crumbling
7:32 PM
Well, the physical location of the phototransistor will be about 15m away from the pi
It has its own 5v power supply to power leds + phototransistors atm
« first day (1769 days earlier)
← previous day
next day →
last day (2564 days later) »
all rooms
Transcript for
Apr
14
Apr '17
17
Apr
27
The Bakery
Main chat room for
raspberrypi.stackexchange.com
+++ Visit Piv...
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2024 Stack Exchange Inc;
legal
mobile