Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Sick Photoelectric Sensor to Netduino Plus 2

sensor

  • Please log in to reply
5 replies to this topic

#1 pdinnissen

pdinnissen

    New Member

  • Members
  • Pip
  • 4 posts

Posted 16 January 2013 - 01:37 PM

Hi Everyone,

 

I'm working on automating a sheep drafting setup for my family farm and believe that Netduino is going to be the right way to go.

 

For detecting the animals, I have purchased a SICK Photoelectric sensor, VTE180-2P42442 that is four wire (capable of NPN or PNP) but I am not sure how to wire it to my Netduino for PNP.

 

I have attached the datasheet for the sensor.  My main concern is that this sensor requires 10-30V to operate and the netduino is only capable of 5V.  Do I also need an instrumentation amplifier since the max current output is 100mA?

 

Any help or advice would be greatly appreciated.

 

Thank you

Attached Files



#2 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 16 January 2013 - 07:57 PM

Hello,

 

Welcome to the forums!

 

The data sheet is not very clear, in fact I think it is a really good example of a rubbish datasheet.

 

Reading it several times, I think the following is correct:

 - pin 2 white "L/D" is an input to control whether the sensors switches ON when it see light or dark. You can just leave it unconnected to get the default - dark switching but I can't tell what that means!

- pin 3 Blue "M" must be the ground (0V)

- pin 1 Brown "L+" is the supply (10V to 30V)

- pin 4 Black "Q" is the output (0V to supply minus 1.8V)

 

I would suggest using a 12V power supply to give power to the Netduino and the sensor.

The output voltage of the sensor is too high as you have already identified, but that is easily fixed with a potential divider.

With a 12V supply, the input voltage to the divider will be 12V - 1.8V = 10.2V. The output needs to be between 2V and 5V.

Choose the resistors so that they take (a lot) less than 100mA from the sensor's output - I would aim to only draw about 5 to 10mA.

Look up potential dividers on google - if you get stuck, just ask.

 

Its not clear what to connect the L/D input to to switch mode, but it mentions "open-collector" so I think the most likely option is that you connect it to ground (0V) to change the mode. I don't think that really matters as the Netduino software can invert it anyway.

 

A few random thoughts:

Do you know what PNP stands for in the context of this sensor? - I don't think it means "pnp" as in the BJT transistor.

Do you know if this sensor is good at detecting sheep?

It looks expensive and does not have a very long range - I guess you have a narrow gap?

You might want to put a bicycle reflector on the opposite side of the gap to get a good return until the sheep passes through.

 

Hope this helps - have fun counting sheep - Paul



#3 ZenHacker

ZenHacker

    New Member

  • Members
  • Pip
  • 1 posts
  • LocationNorth Carolina (USA)

Posted 17 January 2013 - 01:37 PM

I would have to agree with Paul on the "Rubbish Datasheet" comment.  Personally, I would expect to see at least some portion of the internal circuitry at a minimum.  I have used Sensors from Panasonic (NAiS, SunX, etc.) and for the most part their datasheets do show at least the basic transistor, Zener, reverse polarity diodes, internal pull-up[dn], etc. Even if it does not include the exact component part (part#), a basic internals diagram goes a long way to help me hook things up with less loss of magic smoke.

 

When bridging the gap between Industrial use sensors and microcontroller TTL or LVTTL levels I stay away from PNP generally and use NPN.  PNP in the general context of Industrial refers to Sourcing outputs (Closing to V+[L+]) and NPN is Sinking output (closing to GND, 0V [or M]).

 

The sensor you list is PNP, meaning that when the sensor is made, depending on mode Lite-On (output active if reflected light is seen at sensor), or Dark-On (output is active if light is blocked from Sensor) [L/D], In either case, as previously stated the output [Q, pin 4] on this sensor will be either 0V or VS-1.8V, in other words, if powered at 10VDC you will have 8.2VDC to deal with before putting it into any of the Netduino inputs (Voltage divider with 3.3v Zener perhaps, or Opto-Isolator).

 

 

In general when I use industrial type sensors I just stick with NPN (Open Collector, Sinking, etc.)  the sensor can be powered from any source (per its spec, 10-30V, whatever).  The output signal is only closing to 0V so if your sensor supply 0V/GND were common to the Netduino Gnd, you could use a pull-up resistor to 3.3v from the Netduino and wire into one of the Netduino Inputs.  This has the effect of inverting the signal.

 

 

Best Regards,

Patrick


  • Paul Newton likes this

#4 pdinnissen

pdinnissen

    New Member

  • Members
  • Pip
  • 4 posts

Posted 18 January 2013 - 09:30 PM

Thank you for the replies.

 

I'm thinking that Opto-Insulator might be my simplest and easiest best.  Is there an input opto-insulator breakout board out there?  Or should I just get a MakerShield and put it (opto-insulator or voltage divider) together myself?



#5 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 19 January 2013 - 09:42 AM

Hi Patrick,

Great post for your forum debut!

Thanks for explaing PNP and NPN in this context..

Hope we hear lots more from you.

Paul



#6 pdinnissen

pdinnissen

    New Member

  • Members
  • Pip
  • 4 posts

Posted 19 March 2013 - 11:55 PM

Just to touch base.

 

I put together a breadboard circuit with two resistors, a diode, and an opto-isolator (total cost ~$2).

 

Works great!

 

Thanks again for the replies.







Also tagged with one or more of these keywords: sensor

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.