still have sensor issue- when i test sensor with 9 volt it seems to

still have sensor issue- when i test sensor with 9 volt it seems to work as normally on sensor, and when i test voltage divider with 9 volts , seems to work as should . But when i connect sensor to voltage divider i get 0 volts irrespective if triggered or not…

555e99e9f49b644e7b2cf8ae2de4dd50.jpeg

13c05f91830af446832fd5e4193f2455.jpeg

54468b1b5b1885a8b396cca060238603.jpeg

Do you actually have a PNP-type sensor? I’m thinking you might actually have a NPN-type and your meter is measuring leakage.

By my maths, a 15k/10k divider would give 3.6V from a 9V source not 2.4V as you’ve shown. Perhaps your battery is a bit depleted.

hi Neil , sensor is NPN type . Is there another way to use meter to test this ? cheers ben

I have a NPN-type sensor. This behaves like a simple transistor switch to the negative supply.

I just connected my signal from the sensor directly to the endstop input pin on the controller board.

The on-board pullup resistor acts as the load for the sensor.

My sensor actually has a diagram showing a load connected between the sensor +VE supply and the sensor signal (output). This indicates that the sensor sinks current when triggered.

@Ben_Walters You can connect the sensor to your battery then place a resistor between battery +VE and sensor signal. Measure the sensor output voltage between the sensor signal and battery -VE.

Your multimeter has a relatively high resistance, adds very little load. Your voltage divider may be too great a load for the sensor output. Try measuring the voltage at the top of the divider as a check. If that is the problem, try a voltage divider with higher resistances (like 1M and 600k)

@Eric_Davies ​ That’s not the problem. The resistive divider is required for PNP-type sensors which switch the sensor supply voltage to the output.

The NPN-type (which Ben has) is an open collector transistor switch which sinks current to the sensor ground when triggered. It just requires a resistive load to a positive voltage. The on-board pullup resistor provided on the controller endstop input serves this purpose adequately (it is typically 4k7 ohm).

Thanks heaps, I’ll give that a shot !

update , HOORAY for @Neil_Darlow ! all works if i plug sensor in directly , not going to bother to measure voltage as have shrunk ramped cables… now to work out marlin so that home z occurs over metal , and then have to work out z offset…etc etc , cheers

@Ben_Walters I’m happy to hear that your now up-and-working.

A little basic semiconductor theory goes a long way. I learned mine some 45 years ago but, sadly, nowadays it’s too easy to throw students into learning Arduino and Raspberry Pi without an appreciation of semiconductor fundamentals. I won’t even get into what I think about the teaching of analogue electronics.

I found using an NPN sensor feeds an additional current in parallel with the 15k suggested. I found that a 33k / 3.3k combination provided 4.5v (off), and 0v (on).

@steve_meacham I’d be interested to see how you have your sensor connected.

If it is a NPN-type sensor there is absolutely no need for a resistive potential divider. The signal output can be directly connected to the endstop input irrespective of whether the controller board is powered from 5V or 3.3V.

A NPN-type sensor will sink as much current as it is capable of handling. The endstop input usually has a 4k7 ohm pullup and a 10uF capacitor which provides the required load for a switch or sensor and makes for a poor-mans filter.

@Neil_Darlow I started out with the suggested 15k/10k divider, which of course gives 12/25*10=4.8v (open circuit).
However, when I connected the sensor into the network the voltage raise to something near 8v, which is above the 5v max required by the Arduino/Steps board.
I reasoned that the NPN sensor ( a cheap EBAY unit BTW) must have its own Vcc pullup resistor ( about 10k ) internally connected to the output terminal.
I expect I could have just removed the external 15k resistor and got the required 4.5v directly with the 10k changed to something like a 3.3k , but I decided to play safe and tweek the external divider values to give the required output voltage.
I also disabled the pullup resistor in the Marlin config file for that input.
I suspect other sensors may have different ( or no ) internal pullups.

@steve_meacham ​ That’s odd because I have sensors from eBay sources and they don’t have any such pullups. Does your sensor really present a voltage with no load connected? I would expect a PNP-type to do so but not NPN.

@Neil_Darlow Yes Neil, with just 12v powering the sensor, the output signal is about 10v, dropping to 0v when active. The sensor is labelled LJ12A3-4-Z/BX.
Just checked my purchase history, and I eventually sourced it from Amazon, as the Ebay order never delivered. https://www.amazon.co.uk/3-wire-Noncontact-Inductive-Proximity-LJ12A3-4-Z/dp/B008FZ9UNA/ref=sr_1_1?ie=UTF8&qid=1474232719&sr=8-1&keywords=DC6-36V+LJ12A3-4-Z%2FBX+Inductive+Proximity

@steve_meacham ​ This is worrying and echoes another post I made on here that the markings on these things can’t be trusted.

Mine is marked exactly the same as yours and, through isolated testing, I determined that it has an open collector output.

Definately a case of buyer beware and test thoroughly.

my sensor is - LJ18A3-8-Z/BX , it says NPN on it - it appears to show voltage on sensor wire when not triggered, and go to zero volts when triggered, light on top works. I have successfully got G29 working with sensor wired directly to Ramps, but might be putting too many volts through !?!., could not get voltage through
voltage divider happening

probably unrelated … but i noticed some meltage on blue contact block in vicinity of D9 - prior to taking photo i bent back metal thing-a-mi-bob that was in contact with melted area…

b43a2c8a801511385a58cc4d4fd20629.jpeg

p.s. if i had too much voltage coming in via Zmin sensor wire, and it was a normally on sensor, what would be the damage to my electronics ? , would it hurt both ramps and arduino ? cheers ben

@Ben_Walters ​​ What voltage are you seeing when not triggered? If all is well, I would expect it to be under +5V i.e. the Arduino regulated supply voltage.

Application of too much voltage could damage the MCU input or result in various effects ranging from not being able to read the input to the Arduino not running properly with the sensor connected.

@steve_meacham ​ has suggested that some so-called NPN sensors are equipped with a pullup resistor to the sensor supply. If that is the case then that resistor may limit the current flowing into the on-chip protection diode of the ZMIN input. In this case the input would likely read as a permanent logic 1 without physical damage occuring.

I don’t know what might have caused that meltdown you show there but I’m not familiar with that controller setup. I do recall reading something related to diode functionality on the RAMPS and the need to address it on occasion.