Go Down

Topic: How to connect Keyence Sensor to Arduino (Read 411 times) previous topic - next topic

ksnvarma

Hi, I am new to electronics and arduino,
I would like to connect a keyence FS-V21  photoelectric sensor to arduino to detect an object is placed in front of the sensor or now. All I care is to get a high or a low value from the sensor.
The FS-V21 sensor has 3 wires ,  'Brown', 'Black' and 'Blue'.

As per the manual
The Blue wire  -> 0VDC
The Black wire -> 5 to 40VDC through a load
The Brown wire -> 12 to 24 VDC 

Can anyone help me as to which pins do I need to connect the 3 wires to on arduino UNO ? I only see 5V and 3.3V pins on the UNO
I want to get a high or low value from the serial monitor.

dougp

As per the manual
The Blue wire  -> 0VDC
The Black wire -> 5 to 40VDC through a load
The Brown wire -> 12 to 24 VDC  
Blue to Arduino GND

Brown to some external non-Arduino power source (UNO does not provide +12V) - the ground of which must also be connected to Arduino GND

Black to Arduino digital input with internal pullup enabled - or external pullup resistor and Arduino input configured as just INPUT

Karma for image, part number, and intelligible statement first time out.
Everything we call real is made of things that cannot be regarded as real.  If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr

No private consultations undertaken!

ksnvarma

Thank you so much for the reply dougp.
For the external non-Arduino power source, can I use a power adapter of one of my devices?
The adapter shows below values on the label

Input: 100-240 V  ~50/60Hz 0.35A
Output: 12V DC  1.0A

I am thinking I will cut the output lead pin to expose the 2 wires  and connect one wire to arduino ground and another wire to the Brown wire of the sensor. Would it cause any problems? I don't want to try it out directly, since it may destroy my sensor or arduino.
Thanks for the help.

dougp

For the external non-Arduino power source, can I use a power adapter of one of my devices?
The adapter shows below values on the label

Input: 100-240 V  ~50/60Hz 0.35A
Output: 12V DC  1.0A
As long as it meets the requirements of the PE.  The output voltage is within range for the PE.  Importantly, don't hook it up if the PE draws more than 1.0A (highly unlikely), this will overload the power supply.

I am thinking I will cut the output lead pin to expose the 2 wires  and connect one wire to arduino ground and another wire to the Brown wire of the sensor.
Just make sure of the polarity.  Got a voltmeter?  Failing that does the PE have reverse voltage protection?

Everything we call real is made of things that cannot be regarded as real.  If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr

No private consultations undertaken!

ksnvarma

Thank you so much dougp, I did it as per your instructions, Yes, I used a multimeter  to check the polarity and connected the right polarities to ground and source wire on keyence sensor and it worked!!

The Keyence sensor shows the sensor values on its led panel when I put something in front of the sensor, I am also able to get a high low value in the serial monitor of Arduino IDE.
I didn't use an external resistor, just enabled the internal pullup resistor in arduino.

Now I will write the script to control arduino using python to control the sensor.

I have to connect around 3 or 4 sensors to arduino, I see the arduino has only 2 ground pins. I don't want to use bread board, since I am using the sensor in production environment.
Can I join all the blue wires from the sensor together and connect to ground pin in arduino?

Do I use 3 12V dc adapters for each sensor or can I use one 24V DC adapter ?
If I use one 24V DC adapter, do I just join all the brown wires from the sensors together and connect to 24V DC?

how can I connect

dougp

Thank you so much dougp, I did it as per your instructions, Yes, I used a multimeter  to check the polarity and connected the right polarities to ground and source wire on keyence sensor and it worked!!

Yea!

Can I join all the blue wires from the sensor together and connect to ground pin in arduino?
Yes.

Do I use 3 12V dc adapters for each sensor or can I use one 24V DC adapter ?
As long as the power supply can comfortably provide enough current for all the loads - at a voltage within the device's specs - yes.  Check the datasheet.  Failing that, if your meter's capable, set it to measure current and see how much the PE draws blocked and unblocked.  If the 12V adapter can supply more than three PEs need then that's sufficient.

If I use one 24V DC adapter, do I just join all the brown wires from the sensors together and connect to 24V DC?
Yes.

how can I connect
Do you mean what would the schematic look like or, how are the physical connections made?

Everything we call real is made of things that cannot be regarded as real.  If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr

No private consultations undertaken!

ksnvarma

Thanks Dougp, never mind the "how can I connect" part, but I connected all 3 sensors with the 24V DC adapter and it worked perfectly!! Thanks so much for your help , couldn't have got it working without you.

I want to extend on this.
The Keyence sensor is on an equipment and until now I have been connecting the Arduino to my laptop, so I was able to place the laptop right next to the sensor, but in reality, I want to connect the arduino to my Red Hat server which is about 100 meters away, from the equipment.
I am planning to use a male usb to ethernet converter from the server end and female usb to ethernet converter on the arduino end and connect an ethernet cable in between to extend the arduino cable. Would it cause any problems if I do it that way? I havent tried it yet, since I don't have the usb to ethernet converters yet, but If it is possible to do so , I will buy them.

dougp

#7
Apr 29, 2019, 05:34 am Last Edit: Apr 29, 2019, 05:36 am by dougp

Thanks Dougp, never mind the "how can I connect" part, but I connected all 3 sensors with the 24V DC adapter and it worked perfectly!!
Good job!

I want to extend on this.
The Keyence sensor is on an equipment and until now I have been connecting the Arduino to my laptop, so I was able to place the laptop right next to the sensor, but in reality, I want to connect the arduino to my Red Hat server which is about 100 meters away, from the equipment.
I am planning to use a male usb to ethernet converter from the server end and female usb to ethernet converter on the arduino end and connect an ethernet cable in between to extend the arduino cable. Would it cause any problems if I do it that way? I havent tried it yet, since I don't have the usb to ethernet converters yet, but If it is possible to do so , I will buy them.
I cannot answer your question.  Perhaps someone who knows will happen along.  In the meantime you could try searching the site using some of those terms and poke through the 'Networking, Protocols...' topic.

Possibly, since this new angle is a departure from the original thrust of the thread, a brand-new thread might be in order.  Check with a moderator.
Everything we call real is made of things that cannot be regarded as real.  If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr

No private consultations undertaken!

ksnvarma

I was able to connect the sensor over ethernet using arduino ethernet shield and connecting via telnet with a cisco router.

I have one more question.
How will I connect a 2 wire sensor to arduino? In the 2 wire sensor I only  have Brown and Blue wires.
How will I connect it to arduino with an external LED?

Go Up