Let's Make Robots!

Proximity Sensor Problem

I have an Picaxe-18x and 4 servos conencted to 4 AA batteries. The picaxe (on 4.5v) and servos (on 6v) work fine when i turn on the power however when i connect my proximity sensor to the circuit, the servos stop spinning and the microcontroller also stops working. When i take out the proximity sensor and turn of and on hte ciruit, everything works fine.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
A model number would help

Well it sounds like.. a couple things could be happening.. and we could be missing a model number. :D

It could be draining too much power, causing a "brown out" which basically just... keeps everything turned off, or resets, while it tries to drain the power. (keep in mind, most AA batteries.. especially rechareables.. brownout fairly easy even when fully charged.) 

Or.. sounds like there could be a short in the Proximity sensor. (I've never used one, so no idea how they work, but a short will.. generally do that)


But I say you take everything but the proximity sensor off, until you get the sensor functioning, then move on from there. :D

Best of luck, and welcome to the site.

A Proximity Switch comes in 2-wire and 3-wire versions. Never used the 2-wire type. The 3-wire type operates like a Sharp IR sensor. You have a red [usually +5-24 vdc], black [0vdc] and white input to Picaxe ADC input pin. When a metal (specifically steel) comes within sensing range of the prox. switch end an output signal goes to the PicAxe input pin. This signal is a constant output until the metal moves out of sensor range and then drops to nothing. These operate much like most IR detectors so I am not sure why you would have a problem like this one.

  Post a link to the datasheet of the prox. switch you are using. Most seem to be Balluff, Turck or Keyence.

Tell me more (link please) about these metal-finding prox sensors you speak of... This might be better than my "turn into a line follow when you get close" system of going to "home base".... More input!!!

Hey CtC,

  Here is a link to the Keyence type


  We use a lot of these at work. Sensing range is usually from 2mm to 8mm depending on the prox. sw. diameter. Bigger senses farther away. They have varieties to sense ferrous and non-ferrous material. Let me look in my spare stuff box at work Monday and see what I can find. Probably be able to send you some samples to play with. I know I have some 6mm sizes that sense from 0.5mm to 2mm. These sensors are lots of fun to work with.

Its a Sharp IR Distance Sensor GP2D120. Thank you for yoru replies! My theory is that the proximity sensor uses too much power? When i debug with just the Sensor plugged in (All 3 Wires) the information comes slowly. For example theres usually a count on the debug window for which iteration the microcontoller is running the code and theres a 5~10 second pause between iteration 1 to 2. sometimes it just stops also. The circuit only has the Sensor and PicAxe on it.
Add an electrolytic capacitor across the red and black wires of the sharp IR, as close as possible to the sensor. Watch the polarity. Try anything from 22uF up.
Out of curiousity, what effect does the capacitor have on the sensor?
If the sensor is dropping the voltage too much the capacitor should be able to absorb it. The problem could be something completely different, but adding the cap won`t hurt it and some sites recommend adding one.
alright i will try adding the capacaitor ill get back to you guys in a few days, lol