Hello there hopefully someone can give some guidance, I am using a 6-30v npn nc prox sensor with arduino mega 2560 to detect gear rotations of a machine with a bolt & nut acting as the activator for the switch. I am powering externally with 12v and have combined both grounds from power and arduino. I have added a 10k resistor between the 5v and output signal of sensor and a 10uf capacitor between 5v (output) and ground. I am having issues where when the machine runs constant it counts as expected but if the operator jogs the machine a small amount i am getting false readings.
Why the resistor from 12 volt to 5?
Please post a link to the datasheet of that sensor.
@Railroader MY fault I have the 10kR between 5v and signal to arduino
- Product Name:Inductive Proximity Switch; Wire Type : DC 3 Wire Type (Black, Brown, Blue);Switch Appearance Type : Cylinder Type
- Supply Voltage : DC 6-36V;Current Output : 300mA;Detect Object : Iron
- Model: LJ12A3-4-Z/AX;Theory : Inductive Sensor;Output Type: NPN NC;Diameter of Column Sensor: 12mm;Detecting Distance : 4mm
- Total Size: 6.2 x 2cm/2.4'' x 0.8'' (L*Max. Dia); Cable Length: 1.2m/47'';Net Weight :44g
- External Material : Plastic, Alloy;Package Content : 1 x Inductive Proximity Switch
That's better.
I guess the output is an open collector type.
Look for intermittent contact i the wiring. Touching the cables might cause the same error. Else there's a mechanical play somewherer-
@Railroader I'm assuming the same that its an open collector i couldnt find any specs for it, Ive tried also NO NPN and same issue. Its odd ill have the sensor away from the machine and still same reaction when moved a small amount but constant operation is fine. It posses an issue if the operator is doing a change out and jogs to feed in would jump the count. It has been a lot less since the introduction of the resistor and a capacitor for noise i don't know if the small of uF is gonna cut it and my next option is to add a diode to the signal side for any irregular voltage.
Do You say that removing the sensor from the machine and jogging the machine causes errors?
What is the physical sensing element in the sensor? Know that hand moving a thing might contain like a vibration, moving forward and easily have small backwards compnents in it.
Is it a physical switch of some kind? Then contact bouncing might be the reason.
@Railroader Not removing it from the circuit just off its mount, it is mounted facing a gear using a bolt without direct contact to trigger. If i take it off the mount still connected and place down facing away from the machine i will get the same results. It is a physical start button, but yes the machine itself def has vibration.
If you get results with the sensor removed then the signal is not related/originated to the rotation of the bolt. Make the sensor output stable when removed off the mount.
Can You make a close up photo of that sensing thing alone and one mounted?
Is the sensing device a conventional button? If it is, You are facing normal contact bouncing.
@Railroader sensing device is a non contact proxy sensor, mounted to an L bracket and when not mounted was placed on a plastic cart still wired in. The start button to the machine is a physical star button, the machine itself is pretty used and has a lot of vibration in jog. I ended up adding a debounce delay to counter act the false triggers in between the rotation of the gear to the next next proximity trigger
Okey. What´s the diameter of the sensor sensing end and what's the distance between teeth of the wheel?
@Railroader the sensor is 12mm, I was originally using a fork sensor to count the teeth. But unfortunately I had to switch to the proxy due to the gear teeth being driven by a chain and catching debris giving false break beam readings
and the distance between the gear teeth is?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.