Author Topic: Light sensor and brake mode  (Read 4021 times)

0 Members and 1 Guest are viewing this topic.

Offline bradTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Light sensor and brake mode
« on: April 17, 2009, 07:27:47 AM »
I am working on a small robot car at the moment, my prototype works well but I want some more speed. The car starts and stops with a simple micro switch (stopping switch turns off motor when the car impacts the end of the track). When I speed the car up I think I will have trouble stopping it safely within the track. I was wondering if I could install a light sensor that would detect a 3mm black line on the track and switch off the motor and possibly put the motor into a brake mode to slow the car down. I have been doing some searching and have found this for the light sensor.

http://www.reuk.co.uk/LM741-Light-Dark-Sensor-Circuit.htm

and this for the motor braking which would be wired into the relay of the light sensor.

http://www.societyofrobots.com/schematics_dcmotorbraking.shtml

Im a little unsure if this will work as this is my first attempt, I am keen to buy the parts and wire it up but I don't know if this will actually work. I am hoping to get the robot to move along a 1.2m (4ft) track in about 2-3 seconds so the light sensor will need to be pretty responsive
Can you help me out with any possible options or ideas?

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #1 on: April 17, 2009, 07:52:01 AM »
i dunno if that would work for sensing a line to well as ambient light could get in, have you considered a small bump in the track and a microswitch underneath the car so the bump pushes the microswitch in? also have you considered using a microcontroller?
Howdy

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Light sensor and brake mode
« Reply #2 on: April 18, 2009, 01:36:24 AM »
Hi,

I am working on a small robot car at the moment, my prototype works well but I want some more speed. The car starts and stops with a simple micro switch (stopping switch turns off motor when the car impacts the end of the track). When I speed the car up I think I will have trouble stopping it safely within the track.
You could have the circuit wired so that when you switch it off, the motor is shunted.
If you have the switch on the underside, a cam on the track could switch it off and this cam could be positioned a bit before the end of the track.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline bradTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Light sensor and brake mode
« Reply #3 on: April 18, 2009, 07:58:46 AM »
Thanks for your replys

The ambient light could be a problem I think I know what you mean, would using a infra-red light source work? kind of like lego mindstorm sensor..

The bump in the track is a good idea but but I would like to work on this as a optical problem as the track that im using is just a simple piece of ply wood, it has a raised edge that Im currently using to trigger the micro switches to break the motor circuit. I suppose I am looking to understand how a optical sensor works and how a dc motor can be used as a brake...

Using a microcontroller, what would that involve? it sounds interesting, would it help with using a optical sensor?

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #4 on: April 18, 2009, 08:03:42 AM »
well if you are just after a quick stop moving type thing a microcontroller will not be needed, and infared is an option, you could have a row of infared leds built into the "track" and an infared photo transistor one the bottom of your car maybe?
Howdy

Offline bradTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Light sensor and brake mode
« Reply #5 on: April 18, 2009, 05:48:49 PM »
so would i simply wire in the infra-red photo transistor to the light and dark sensor on this circuit http://www.reuk.co.uk/LM741-Light-Dark-Sensor-Circuit.htm and then would I use the relay to short out the terminals of the motor when I want to put the motor in to brake mode?

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #6 on: April 18, 2009, 05:57:54 PM »
yes but therein lies a problem with your idea, the motor will only be stopped while it detects the light. so as soo as it passes the led the motors will reengage and keep going, one way to solve this problem is to use a strip of leds so the sensor is seeing leds until it comes to a halt. but this would require a fair few leds as if you had a line with too few leds the motor would constantly be switching on and off producing a kind of "jerky motion".

the other option which i described before was to use a microcontroller. now this option requires you to know a few programming basics. which in turn would be good for you if you decided to get into robotics ever. pretty much you will have your motors hooked up to a driver then to the mcu's digital outputs. then you would have a phototransistor or photodiode hooked up to the mcu's analogue input you may also need a comparator but i dont know much about them :P

then you will program your mcu to read the analogue pin and if there is a value high (which means it found the led) to stop pulsing the motors. although the second setup is more expensive it is worth it if you intent on building some robots later on, and not to mention more reliable eh?
Howdy

Offline madchimp

  • Robot Overlord
  • ****
  • Posts: 158
  • Helpful? 2
Re: Light sensor and brake mode
« Reply #7 on: April 18, 2009, 08:28:53 PM »
They could also have it set up so once the relay is tripped it just stays that way until it is reset by a switch. Which would avoid having to use a microcontroller. Would need a single pole double throw relay so the normally closed goes to the motor and the normally open will feed back to the coil through a momentary normally closed switch (reset). That way when the relay is tripped by the circuit sensing the infrared it will stay energized until the momentary switch is pressed. Might need a diode or something to keep from feeding power back into the light sensing circuit. I'm not sure about that but I'm sure someone here can answer that part. I also don't see why a similar setup to a line follower wouldn't work just instead of following a line once the line is no longer present the brakes are applied. That way it's all contained in the vehicle. Course you would probably want a line wider than 3mm.
« Last Edit: April 18, 2009, 08:36:34 PM by madchimp »

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #8 on: April 18, 2009, 09:59:13 PM »
genius! i was thinking of a relay type thing but didn't think you could make it stay open. i like your idea madchimp!
Howdy

Offline bradTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Light sensor and brake mode
« Reply #9 on: April 19, 2009, 01:49:11 AM »
So, if I can get a sensor to trip the relay I could wire it into a "lock out relay". This sounds good to me...

I am looking at getting some of the gear together to do this as I should be able to make this work. Do I simply wire up the light sensor (with a distinct line on the track) like this one, http://www.reuk.co.uk/LM741-Light-Dark-Sensor-Circuit.htm and then for the brake do I wire up the relay to short the motor terminals?? im a little unsure of how to design the motor brake, do I need to incorporate any electronics or is it a dead short across the motor terminals?


Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #10 on: April 19, 2009, 02:21:44 AM »
you don't need to short anything, just use a normally closed relay and when it gets power across its poles if opens thus shutting off the circuit.
Howdy

Offline madchimp

  • Robot Overlord
  • ****
  • Posts: 158
  • Helpful? 2
Re: Light sensor and brake mode
« Reply #11 on: April 19, 2009, 03:26:04 AM »
you don't need to short anything,
To use the motor as a break which is the whole point I believe he does need to short the motor terminals (someone please correct me if I'm mistaken)
Quote
just use a normally closed relay and when it gets power across its poles if opens thus shutting off the circuit.
I believe he needs a single pole double throw relay and not just a normally closed relay else the relay can't keep itself energized (again someone please correct me if I'm mistaken)

brad the circuit you linked to uses an LDR I'm pretty sure a photodiode or phototransistor circuit would be more suited but that would be best answered by someone more experience. they may even have a better solution than the relay.

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #12 on: April 19, 2009, 03:32:34 AM »
Quote from: admin
The basic concept of this is that if you short the power and ground leads of your motor, the inductance created by your motor in one direction will power your motor in the opposite direction. Although your motor will still rotate, it will greatly resist the rotation.
my bad, you were right. i didn't know he wanted to brake the motors.
Howdy

Offline bradTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Light sensor and brake mode
« Reply #13 on: April 19, 2009, 05:09:25 AM »
Thanks for the advice, I think i'll have a chat with some of the guys at the local electronics store. I'll take in a few schematics and see if I can source a phototransistor / photodiode for infra-red and visible LEDs and get the parts to test the circuit.

I'll try to keep the sensor (and maybe a LED light source) on the robot and make the finish line as thick as I need for the sensor to work consistently. If anyone has a link to a circuit that would work for me that would be appreciated. I have found this which has gotten me a little excited http://www.discovercircuits.com/DJ-Circuits/fastphotonpn.htm but i'll need to modify it (which might be tricky) to incorporate the SPDT relay (and motor)

Thanks again for your help :), as soon as I get this working i'll be sure to put up the schematic and some photos/video of the robot if this would be helpfull to anyone else.

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #14 on: April 19, 2009, 05:20:04 AM »
the bottom left one looks like it may work, and it looks like the easiest one besides the first. ill take a look at it and see if i can find the easiest way to include that setup madchimp said. but wait, does the voltage drop when it senses something?
Howdy

Offline bradTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Light sensor and brake mode
« Reply #15 on: April 19, 2009, 05:55:08 AM »
Thanks SmAsh, I think the voltage may drop when it senses light??? (i could be wrong on this) but if it increases voltage when it senses darkness then this may be what im after... low voltage when it senses light, and then energises the relay when it detects the finish line..

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #16 on: April 19, 2009, 06:01:50 AM »
see the photo i attached, the squiggly line is the signal line, i "think" the 5V is the before and the 2V is the after. like 5V is before the sensor detects something and the 2v is when i detects as there is an output change. what we want for the relays is the opposite, we want the voltage to increase so it can power the relay.
Howdy

Offline bradTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Light sensor and brake mode
« Reply #17 on: April 19, 2009, 06:04:32 AM »
That makes a bit more sense than what is going through my head....

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Light sensor and brake mode
« Reply #18 on: April 19, 2009, 06:06:55 AM »
That makes a bit more sense than what is going through my head....
lol, what were you thinking?
Howdy

 


Get Your Ad Here

data_list