boyoh wrote: ↑
Fri Feb 16, 2018 6:02 pm
zassx wrote: ↑
Fri Feb 16, 2018 3:04 pm
boyoh wrote: ↑
Fri Feb 16, 2018 2:58 pm
The speed of a object passing the sensors, could this be don by ,two sensors spaced apart
The first sensor will start a timer when the leading edge of the object passes the sensor.
When the leading edge of the object passes the second sensor ,this will stop the timer.
Calibrate timer to suit
Thanks but I am already doing that, but only with one sensor. No need to have two. So the logic and the software is not a problem, the problem is my lack of knowledge in creating circuit.
Saying you already have the circuit working using only one sensor , so what is your problem
It would be a good Idea to draw your circuit, to save going over ground already covered
You must have built a circuit to get it working,,
I don't have a circuit, but like I said I have software already written and working (only simulated since I have no circuit yet). My point quoting your comment was to tell you that you don't need two sensors to make this work but you can measure speed with only one sensor (ofc you got to know the object width in order to do this).
I've done this many times as it's used for lightgates in science/physics.
It's a simple switch at its basic level.
Either a led or a laser if you need a more directional beam of light.
That and a LDR works fine (or a photodiode too)
- Laser/LED just powered off the Pi pins (5V or 3.3V as needed, with an inline resistor.)
- LDR placed in a potential divider circuit.
An everyday LDR that has no light has a lower resistance compared to the high resistance with the laser/LED shining on it.
So look up GCSE potential dividers and work out which way around the circuit needs to be so the voltage at the divider will drop from >> ~1.7V to <<~1.7V
One side is 3V3 the other GND and the middle is the GPIO pin.
You can then easily use python and gpiozero module in button mode.
It works a bit nicer if you switch to the pigpio pin factory (as they call it now,but only once you works).
So basically just a common LDR and a resistor a common 'laser diode pen', either pull the module out the front or just power it from batteries.
Arduino's also work well for this as do Micro:bit and others.
Thanks for this, will check it out!