Welcome! Log In Create A New Profile

Advanced

RAMPS capacitive sensor the right way

Posted by wouterheer 
RAMPS capacitive sensor the right way
February 02, 2018 03:16AM
Hi All,

I'm in a bit of pain getting a capacitive sensor working.

Current situation:
- LJ12A3-4-Z/BX capacitive sensor
- connected to Z- through a voltage devider (10K + 15K)

- The endstop ALWAYS shows 'open'
- While not triggered z- pin is 5 volt, while triggered z- pin is 3,5 volt which is too high for triggering the endstop.

After doing some research I found the following solution. Is this a generic 'way to go'? Will this work or would I experience the same issues?
- LJ12A3-4-Z/BX capacitive sensor
- connected to Z- through an optocoupler

Re: RAMPS capacitive sensor the right way
February 02, 2018 03:26AM
I have added the board logic :-)


Re: RAMPS capacitive sensor the right way
February 02, 2018 03:26AM
Your original circuit would work if you disabled the pull-up resistor on the Z min input pin.



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: RAMPS capacitive sensor the right way
February 03, 2018 02:26AM
Do you have an NC or NO probe output?
Re: RAMPS capacitive sensor the right way
February 05, 2018 08:58AM
Re: RAMPS capacitive sensor the right way
February 06, 2018 03:40AM
So you've mixed up the voltage divider, required for NPN-NC probes, with a NPN-NO probe. The NO probe is much easier to connect. For safety reasons, you can add a (schottky-) diode, but I also wired the output directly to a RAMPS board. The probe signal has to be inverted in firmware.

I just tried to find the line in Marlin 1.1.8, where you can invert the signal, but got sick by reading through all these different calibration and leveling methods. What a mess...
Re: RAMPS capacitive sensor the right way
February 06, 2018 08:47AM
I have disabled the pull-up resistor and the voltage devider works as expected now. I do prefer the other option as it reduces risk.I have ordered the optocoupler board and will implement it as soon as I receive it.
Re: RAMPS capacitive sensor the right way
February 06, 2018 09:50AM
I too have ordered the optocoupler board as a test to see if I can get better performance from my TL-W3M2 Proximity sensor.
Have a 12V low profile TL-W3M proximity sensor running on 5V and believe it could work better if it were connected to the 10V minimum VCC it was designed.



As I upgraded from the factory SN04-N DC 10-30V NPN 3-wire 4mm Approach Sensor Inductive Proximity Switch, because of it's size and location to nozzle.
Both work as you would expect. Prefer the TL-W3M proximity sensor as I have it within 20mm of the nozzle and could place in within 10mm without any problems.



Edited 1 time(s). Last edit at 02/06/2018 09:51AM by Roberts_Clif.
Re: RAMPS capacitive sensor the right way
February 07, 2018 05:16PM
Quote
wouterheer
I have disabled the pull-up resistor and the voltage devider works as expected now. I do prefer the other option as it reduces risk.I have ordered the optocoupler board and will implement it as soon as I receive it.

There is no risk to the voltage divider option, because the high value (150k) value of the resistor from the sensor output will limit the current into the input pin protection diode to around 50uA if the other resistor gets disconnected. Microchip doesn't specify the maximum safe pin protection diode current, but an Atmel application note for another processor from the same attiny/atmega range says that 2mA is ok AFAIR.

Edited 1 time(s). Last edit at 02/07/2018 05:17PM by dc42.



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].
Sorry, only registered users may post in this forum.

Click here to login