Hello,
how can i connect a npn sensor to arduino .My sensor is E3F-R2NK.i want when my sensor is activated to change the value of one variable.
Thanks
Hello,
how can i connect a npn sensor to arduino .My sensor is E3F-R2NK.i want when my sensor is activated to change the value of one variable.
Thanks
When asking for help, it is best to give us a exact link so we do not have to hunt for it.
Also show us your current schematic and your sketch.
.
You connect the sensor to a power and ground in the correct voltage range 10V to 36 volts.
The third signal output is connected to a potential divider that cuts down the supply voltage you use to 5V. Then you connect the center tap to a digital input and also the external ground to the Arduino ground.
That's for PNP sensors.
AFAIK the output of an NPN sensor can connect directly to an Arduino pin, with pullup resistor to 5volt.
Enable the internal pullup resistor in pinmode if you are using it close to the Arduino.
Use a stronger external 1k pullup resisor for longer wiring and/or in electrical noisy environment.
Before connecting the sensor to the Arduino, make sure it's an NPN sensor.
Apply power to the sensor, and measure the output voltage.
An NPN sensor should have 0volt on the output in both acivated/not activated states.
Leo..
Hello wawa,
if i have understand well. BN and BU to external power.And BK to a digital pin through 1K resistor.
This above code is ok?
int sensorVal;
void setup()
{
Serial.begin(9600);
pinMode(5,INPUT_PULLUP);
Serial.println("hi stefano");
}
void loop()
{
sensorVal=digitalRead(5);
if(sensorVal==HIGH)
{
Serial.println("Sensor Deactivated");
}
else if(sensorVal==LOW)
{
Serial.println("Sensor Activated");
}
}
neze18:
....if i have understand well. BN and BU to external power.And BK to a digital pin through 1K resistor.
No.
Read the post again.
A Pullup resistor goes between pin and 5volt.
But it should work with the 1k resistor between sensor and Arduino pin, and internal PULLUP enabled.
Maybe wise to leave that resistor between sensor output and Arduino pin for safety.
The 1k you use there now could be 10k.
Make sure you measure before connecting.
The wrong sensor will fry the pin and the Arduino.
Leo..
Grumpy_Mike:
You connect the sensor to a power and ground in the correct voltage range 10V to 36 volts.The third signal output is connected to a potential divider that cuts down the supply voltage you use to 5V. Then you connect the center tap to a digital input and also the external ground to the Arduino ground.
Actually, the one the OP listed has an NPN BJT that pulls to ground (with a 36V zener across the C and E).
He needs to supply it 10 to 30V power. Then, either INPUT_PULLUP or an external pullup R on an input pin tied to the O.C. output will do the trick.
According to the schematic in the link, . . .
Oh, there is no link to the OP's actual sensor.
.
neze18:
My sensor is E3F-R2NK.
Yes, a link would have been better.
Leo..
Here a link to a datasheet if I read it right it control output is 2 volts max.
Control output =Transistor (open collector), load current: 100 mA max. (residual voltage: 2 V max.)
Forgot link here it is datasheet
Hi
You will need 12V for proper operation of this sensor.
Does you sensor have two or three wires, link to your sensor please, there are so many knock offs to this product.
From what site did you buy it, alibobo or amizon sell the omkqn unit or E14 with omron?
omkqn to omron.
Tom.. ![]()