Welcome! Log In Create A New Profile

Advanced

odd sensor and voltage issue

Posted by DjDemonD 
odd sensor and voltage issue
March 08, 2016 08:15PM
Previously I had a bad voltage regulator on my arduino on my smartrapcore alu. (ramps/mega, marlin 1.1.0 rc3) So I supplied the arduino with 5v via the dc jack but for some odd reason my proximity sensor was triggering at random. The sensor is a npn LJC18A3-H-Z/BX NO type.

I have now replaced the regulator, everything is working normally except my proximity sensor which triggers shortly after I ask for z homing and stops the z axis which barely lifts at all (starting from z max i.e. bed down as its a corexy). I have the sensor wired GND (blue), +12v (from PSU) (brown) and then have the signal wire running through a 7805 voltage regulator to the z min endstop pin on ramps, ive used these for this purpose many times before having never had much success with voltage dividers. What is really strange is that the voltage it is outputing via the regulator when it is not triggered is 2.5v when triggered its 0v. (if I measure the voltage direct from the signal pin its 12.65v - which is what I would expect (I have my PSU turned up a small amount), but then 0v when triggered. It is an NO sensor so why is there any voltage when it is not triggered???

Also why would a 5v regulator be regulating 12.65v to 2.5v???

Puzzled to say the least.
Re: odd sensor and voltage issue
March 08, 2016 08:46PM
The output has high impedance and it drops when 7805 tries to regulate it. It isn't ideal regulator where everything above 5V would dissipate in heat and rest would come out. It need some biasing currents etc, which loads the sensor and when it loads it, voltage drops to 2.5. So try the voltage divider.

Edit: First make sure you have connected everything right and you have no ground leaks. Also firmware could have something to do with this. Someone who knows better can answer to that.

Edited 1 time(s). Last edit at 03/08/2016 08:50PM by Vuokko.
Re: odd sensor and voltage issue
March 09, 2016 11:46AM
Thanks and I know it is advisable to use capacitors with this regulator but I'm wary about doing so as they'll generate a delay in the signal switching from 5v to 0v. I've used voltage regulators like this before in the same way, without any issues. The thing that's puzzling is that before sorting out the regulator on the arduino ie when the arduino was running off usb power the sensor worked normally. How can these two things be related as they do definitely interact with one another.
Re: odd sensor and voltage issue
March 09, 2016 11:49AM
Using a regulator to drop the sensor output from 12V to 5V is not a sound method. You should use two resistors configured as a voltage divider, or one resistor and a zener diode, or a bipolar transistor and a few resistors.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: odd sensor and voltage issue
March 09, 2016 11:51AM
So it seems, do you know why? This might help me work out not so much the regulator isn't ideal, but why recovering my arduino has changed the sensor performance from excellent to non functional.
Re: odd sensor and voltage issue
March 09, 2016 11:59AM
The reason that a standard series voltage regulator chip is not a good solution is precisely because they require input capacitors for stability, and some also need an output capacitor. An input capacitor will at best degrade response time and at worst overload the output device in the sensor if it isn't current-limited.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: odd sensor and voltage issue
March 09, 2016 01:02PM
Heres an idea... Since I've never managed to get a sensor to work with a voltage divider and have had now one failure to get it to work with a voltage regulator despite many other successful applications of this approach - would 6v on the signal pin cause problems for the ramps electronics or would that be within its tolerance? Why not power the sensor from a proper voltage regulator circuit at 6v (it's minimum operating voltage although I know some will work at 5v too) and connect the signal directly to the z min endstop?

This means the issues of reducing the voltage have little or no bearing on the signal switching.
Re: odd sensor and voltage issue
March 09, 2016 01:05PM
6V is too much for a RAMPS input and will likely damage it.

For RAMPS, a voltage divider should work just fine, as long as the resistors you choose are not too high. I suggest 3.3K from the input to ground, and 6.8K from the input to the 12V sensor output.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: odd sensor and voltage issue
March 09, 2016 01:14PM
I'll try it David thanks. I've tried the 15k/10k resistors before and got no usable output from the sensor.
Sorry, only registered users may post in this forum.

Click here to login