Hi all
I have a little project I have been working on, on & off for a month or so...
I am counting the number of cars passing a given spot (either direction) and recording how many pass at each speed. Also, if they go too fast, they are beeped.
Basically, it works... 98% of the time!
OK, I have 2 lasers on one side of the road 1/2 a mtr apart, and 2 NPN photo resistors on the other side of the road, 1/2 a mtr apart also. When a beam is broken, I get a high signal.
What I have at the moment is an 08M waiting for either laser trigger, when one beam is broken, it puts an output pin high, then waits for the other beam to be broken, and when it is, switches the output low again. I then have an 18X waiting for the high from the 08M, per a pulsin. Once it has a valid pulsin time, the 18X calculates the speed, adds a count to the EEPROM, displays the data on a 16x2 LCD & toots the horn via a relay once for every 10 kph's above the speed limit, then waits for the next car.
As I said, it is fine 98% of the time. I think I'm getting poor transitions from high to low on the 08M, but as it is intermittent, it's hard to track down! and it's worse the further away the laser is from the photo transistor! Also, Daylight vs night testing doesn't seem to make much difference to the intermittent nature of it, as I had expected it might, so it's left me scratching my head!
I had been wondering about ditching the 08M & trying something like op-amps?? in place of it?? but before I do I thought maybe some suggestions from the forum might help either to improve the signal to the 08m or suggest something in it's place??
I have a little project I have been working on, on & off for a month or so...
I am counting the number of cars passing a given spot (either direction) and recording how many pass at each speed. Also, if they go too fast, they are beeped.
Basically, it works... 98% of the time!
OK, I have 2 lasers on one side of the road 1/2 a mtr apart, and 2 NPN photo resistors on the other side of the road, 1/2 a mtr apart also. When a beam is broken, I get a high signal.
What I have at the moment is an 08M waiting for either laser trigger, when one beam is broken, it puts an output pin high, then waits for the other beam to be broken, and when it is, switches the output low again. I then have an 18X waiting for the high from the 08M, per a pulsin. Once it has a valid pulsin time, the 18X calculates the speed, adds a count to the EEPROM, displays the data on a 16x2 LCD & toots the horn via a relay once for every 10 kph's above the speed limit, then waits for the next car.
As I said, it is fine 98% of the time. I think I'm getting poor transitions from high to low on the 08M, but as it is intermittent, it's hard to track down! and it's worse the further away the laser is from the photo transistor! Also, Daylight vs night testing doesn't seem to make much difference to the intermittent nature of it, as I had expected it might, so it's left me scratching my head!
I had been wondering about ditching the 08M & trying something like op-amps?? in place of it?? but before I do I thought maybe some suggestions from the forum might help either to improve the signal to the 08m or suggest something in it's place??
Code:
---------o----------+5V------------o
| |
| |
.-. .-.
| |10k | |10k
| | | |
'-' .-------. '-'
| | ???? | |
o--------|o o|--------o
| | ???? | |
| '---o---' |
| | |
|/ NPN | |/ NPN
-| Photo | -| Photo
|> Transistor | |> Transistor
| | |
| | |
=== | ===
GND .----o---. GND
| 18X |
| PICAXE |
'--------'
Hopefully this displays OK!