Problems with laser tripwire using raspberry pi

I’ve been working on this project for best part of a year now. I’ve been through the process of learning about the Raspberry Pi from scratch, learning electronics from scratch, and I’ve even learnt how to cut mirror glass!
To this point in time, this is what I have built:-

This is a laser tripwire gateway for a dog sport called ‘Flyball’. There is a light tree which helps count down to ‘go’, and there are 2 laser tripwires in use. The first tripwire is used for recording lap times and it will also sound a buzzer if the dog breaks the beam before the starting countdown gets to zero.

The other laser tripwire is used to ‘deactivate’ the buzzer for a window of 3 seconds. This will be tripped by the returning dog before the next dog in the relay can enter. If the next dog breaks the front beam before the dog already running returns… alarm!

Now I get to my problem… the rig works fine in the garage (although it is a little prone to vibration) but when you take it outdoors on a sunny day, it won’t work.
The laser light is virtually drowned out by ambient light and is near impossible to see where the red dot is.

I’ve looked into the possibility of using a more powerful laser, but it appears that anything more powerful than 1mW is banned in Australia. I’m reluctant to go more powerful because I don’t want to have a burning or eye damaging hazard.

Is it still possible to get this setup to work on a sunny day? If not, could I use IR as an alternative to laser?

I’ve experimented a little with IR using a Duinotech IR transmitter (XC-4426) and the matching receiver (XC-4427). Trying to get IR to work any further away than point-blank range is beyond my realm of knowledge.
The distance between the poles on the gateway is 5 feet (flyball is an American sport hence the ‘feet’), therefore if I’m going to reflect IR light using a prismatic reflector, the beam would need to travel a minimum of 10 feet so it can activate an IR receiver of some kind.

The other thing to know is that each laser is reflected 3 times before being directed onto an IR photo transistor. I can adjust the lasers and the mirrors individually to get the laser dot to go where I want it to.
This creates a gateway which has ‘4’ tripwires for the start pole and the passing pole. The reason for this is because dogs come in different sizes.

One more additional piece of info… the power source is a 12 volt sealed lead acid battery. I use DC-DC step-down converters to dial the voltage down for the various parts of the project.

Most outdoor sensors using light are modulated. An IR break beam sensor typically runs at 40khz and the receiver circuit filters out any signal that’s not 40khz. Most light sourses like the sun are constant and fluorescent lights operate at 100hz (twice the 50hz mains, 120hh120hzin the US) - hence the reason you shouldn’t use fluros for lighting machinery (it strobes and may mack it look like it’s not moving).

You need to modulate the LASER and filter the output of the receiver. The receiver would first filter everything but the modulation frequency with a notch filter and then use a low pass filter to remove the modulation signal from the output of the notch filter to give you back the signal.

1 Like

Thank you Shaun for your reply.

It’s great to hear that my project is not completely dead in the water! It will more than likely take me months to learn all about how to modulate the laser and how to filter the receiver, but it will be worth it in the long run.

At least now I know what to start Google searching.

If anyone can point me in the right direction with regards to tutorials on these procedures it would be greatly appreciated.

I’ve done a little bit of reading so far, and it appears that a 555 timer chip could be used as a pulse width modulator.

Would this work as a means of modulating the laser output to a desired frequency, say 40hz?

If so, this would be a cost effective solution to my problem… and I wouldn’t have to do any more coding on the Pi to get it to work.

The 555 timer is perfect but 40Hz is a bit low. Try around 40kHz (40,000Hz).

1 Like

Thanks again Shaun. I’ve got a book which is all about the 555 timer so hopefully my problem will be solved in the near future

Hey Matt and Shaun,

If the 555 timer solution doesn’t fix the issue another option would be to switch out the laser diode and light sensor for an ultrasonic sensor and recording any sudden changes in distance as this should be more easily applied to outdoor use as it eliminates the variability of external light sources and also could allow you to change the project from a gate to a post which, if the ultrasonics are mounted accordingly, detects movement in any direction with highly customisable sensitivity.

All the best with your project! and have a Happy New Year!

Bryce
Core Electronics | Support

1 Like

Hi Bryce,

Thank you for the extra information… this could be a BETTER setup for my project as it would reduce set up time at training. My current model requires me to position small mirrors so I can get the laser dot to shine on the corresponding photo transistor.
As you would imagine this can be a little fidgety to get right, and a little bit of movement in the posts and all of a sudden, the tripwire is not connected.

Before I go exploring this option I have a question for you Bryce… can an ultrasonic signal be ‘funneled’ into a narrow signal like a laser beam?

The reason is because I have 2 laser tripwires and 2 photo transistors in use. One tripwire is the “Start Pole”, the other is the “Passing Pole”. The lasers are set 65mm apart from each other and they run in parallel to each other.

Wouldn’t an ultrasonic signal spread out over distance?
Please excuse my ignorance as I’ve never worked with ultrasonic signals before. Are they the same thing that is used in a car bumper bar for parking assistance?

I have one more question about the ultrasonic sensor to ask.

According to Google, dogs can perceive an ultrasonic signal up to 45kHz. The HC-SR04 module you have on your Core Electronics website appears to have an operating frequency of 40kHz.

The dogs would more than likely be able to hear this and it probably wouldn’t work for my application. Is it possible to adjust the frequency on these sensors to they operate above 45kHz?

Hey Matt,

Unfortunately, 40kHz is a standard for the ultrasonic sensors so the dogs may be able to hear them, if that’s a concern then the 555 timer and lasers are probably your best option of the two as Shaun described. And yes they do spread out over a distance but generally, over distances under 5m the effect is negligible and should still be able to detect an object such as a dog passing it. Another two options that would be able to detect the dogs are RF tags like the kind used in shopping centres or a microwave radar-like sensor which could also be used to detect a dog if you’re looking for something broader than a laser.

Enjoy 2020!

Bryce
Core Electronics | Support

1 Like