Go Down

Topic: Recieving Data From High Voltage Sensor (Read 2511 times) previous topic - next topic

Hypnotoading

Hello, I am new to higher voltage electronics, so forgive me for my ignorance.  I am trying to use a Banner mini-beam SM321CV light sensor  ( http://www.fileden.com/files/2007/10/21/1529625/03365.pdf ) (I have to use this sensor) to send data (voltage high or voltage low) to an Arduino so I can program the Arduino to tell the user whether or not the sensor is detecting what it is supposed to monitor.  Programming the Arduino is something I think I can work through with time, but I want to make sure my circuit and parts will fit the bill.  In other words, I want the Arduino to read information (digital is my only concern) from the light sensor.

The SM312CV outputs 10-30V DC with a maximum current of 150mA.  Well my little Arduino can't handle such massive voltages/currents, so I thought about adding a solid-state relay between the light sensor and the digital I/O pin.  It was really hard to find a SSR that would be control a small voltage circuit, as controlled by a large voltage circuit, as SSRs are usually made for the exact opposite purpose.  I choose an SSR because I needed a very reliable circuit, and optical isolation seems the way to go.  But as I often learned, if the tool doesn't seem to fit the task, it probably isn't the right tool, but I just don't know of a more reliable solution without making a massive circuit (I would prefer to keep this tiny if possible).

I chose the 84145001 SSR ( http://www.crouzet-ssr.com/english/products/download/simm_ssr_output.pdf  ), as it seems to fit my desired range the best.

Input:
10-44V  (I want 10-30V)
6mA max current     (my sensor has 150mA max, this feels like it could be a problem)

Output:
5-48V DC (I only need 5V)
500mA  (I was planning to simply use a couple of resistors (roughly 10ohm 2.5W rated) to create a current divider  to lower this to 30mA)

However, this one seemed pretty close to my desired specs too, http://eshop.wieland-electric.com/shop/showdatasheetpdf.jsp

Note: I have not bought the parts yet (except for the sensor), so I am just planning it out right now.

Here is my really bare schematic: ()

Any help would be appreciated.

Hypnotoading

johnwasser

A 1 k resistor will limit a 5V signal to 5 mA.

You will need a pull-up or pull-down resistor on the digital input pin so when the SSR is "OPEN" the pin isn't left floating.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

wanderson

If I am reading the data sheet for that device correctly, it is not outputing a continuous analog voltage, but rather a logic type voltage, which is based upon whatever supply voltage (10V -30V) is connected to the sensor.  If this is the case you can use a simple voltage divider to reduce that logic voltage to a 0-5V range.  So for instance if you have a 10V supply a divider made of two 4.7k resisters would produce a 5V signal for the arduino to detect--and the resistors would limit the current to a safe level for the arduino.

Now if I am wrong and the device is output an analog range of voltages based upon light levels, then you can still use a voltage divider to feed the signal to an analog (as opposed to a digital pin).  In that case connect the signal output from the sensor to one end of a 33k ohm resistor.  The other end to an analog pin on the arduino AND another 10k resistor.  Connect the other end of the 10k resistor to ground and you would be good to go measuring an analog signal from the device.

No SSR needed.
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

johnwasser

Looks like the NPN (current sinking/Open Collector) output of the light sensor (White wire)  is TTL compatible.  Just turn on the internal pull-up resistor and connect the Open Collector output of the light sensor directly to the Arduino pin.  Connect the - side of the power (Blue wire) to Arduino ground.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Techylah

I agree with John.  This thing is made to interface directly.  No external resistor needed.  Just one wire.
Wire the NPN current-sinking output directly to an Arduino input pin, with the internal pull-up on.

johnwasser


I agree with John.  This thing is made to interface directly.  No external resistor needed.  Just one wire.
Wire the NPN current-sinking output directly to an Arduino input pin, with the internal pull-up on.


Two wires.  Don't forget that the sensor and Arduino have to have a common Ground. :)
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Hypnotoading


Looks like the NPN (current sinking/Open Collector) output of the light sensor (White wire)  is TTL compatible.  Just turn on the internal pull-up resistor and connect the Open Collector output of the light sensor directly to the Arduino pin.  Connect the - side of the power (Blue wire) to Arduino ground.


First, thank you all for responding so quickly, I really appreciate it!

Second, could you tell me how you knew which colored wire did what?  I have scaled through the data sheet and the only wire reference I see is referring to how to connect the device to have a 10-30V output, but not specifically saying what each wire does (I guess it may be obvious to someone more experienced, but not me!) for the circuit.

Does, "(NPN output) less than 200 millivolts at 10 mA and less than 1 volt at 150 mA" mean that should my device draw 150mA (which the Arduino cannot do), it will output 1V?  So the circuit would never have current above that of the Arduino current threshold?

What exactly makes you know that the Arduino will never receive above 5V?  Is it the fact that it is TTL compatible?

I am eager to buy my parts now and get started!  Thanks folks!

Techylah

Yes, ground, of course.
Quote
Does, "(NPN output) less than 200 millivolts at 10 mA and less than 1 volt at 150 mA" mean that should my device draw 150mA (which the Arduino cannot do)
No.  Think of the NPN output as a big resistive crowbar conducing current to ground when it is on.
The spec is saying how good the crowbar is at doing that. - When it is conducting a reasonable 10 ma of current to ground, the voltage will be very close to 0, specifically 1/5 of a volt above ground.   And even if it has to conduct as much as 150ma, the voltage will only be as high as 1v.  Any input circuit will certainly see these as a LOW logic level (roughly considering the threshold to be halfway up from 0, or 2.5v for 5v logic)

The value of the pullup resistor and the value of the voltage it is pulled up to combine to determine the actual current via Ohm's law. 
A 5k pullup resistor to 30v would draw 6 ma and result in a voltage even less than 200 mv.

The input pin should always be thought of as very high impedance, and thus drawing neglibible current.

johnwasser

The datasheet is REALLY sucky but they mention having both NPN and PNP outputs.  Under Application Notes" in the Specifications table they say "The NPN (current sinking) output".  This implies that one of the outputs is an "Open Collector" transistor.  This is the Collector pin of an NPN transistor that, when activated, will connect the pin to Ground.  When not activated the pin is left floating, hence the need for a pull-up resistor.

Because the pin switches between floating and ground it can be used with any logic level.

The wiring diagram shows the two output transistors as switches.  The NPN transistor is represented by a switch between a load and Ground (the negative side of the power supply which is the Blue wire).  That load is connected to the White wire.  The other 'switch' would be the PNP transistor output.  When activated it will connect the load to the power rail (10 to 30 volts).  Just leave that wire (Black) unconnected.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Hypnotoading

Big thanks for all the help, especially with the wiring description!

I bought my parts and am about to start hacking at it, I will update the thread on my results/problems.

On a side note, I am thinking about powering my Arduino board and ethernet shield in a somewhat odd way.  I am going to use a 24V to 9V DC/DC converter ( http://www.newark.com/xp-power/il2409s/dc-dc-converter/dp/88M0777?in_merch=Popular%20ProductsP ) to take the voltage coming from a PLC pin to power an Arduino Uno board and ethernet shield.
The DC/DC converter has the following spec:
Input: 24V
Output: 9V
Current: 222mA

I figured that the 222mA should be more than enough to both power the Arduino and the ethernet shield, but what do you guys/girls think?  And if you're wondering, no I do not plan on using the Arduino to control anything that could harm anyone, it's being used to simply make a sensor more user friendly.

johnwasser


I figured that the 222mA should be more than enough to both power the Arduino and the ethernet shield, but what do you guys/girls think?


The W5100 datasheet says it uses about 140 mA (183 mA max).

The ATmega328P uses about 40 mA.

I think 222 mA would be marginal.  I'd recommend 300 mA or more.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Techylah

#11
Jun 25, 2012, 03:50 pm Last Edit: Jun 25, 2012, 03:51 pm by Techylah Reason: 1
Why did you decide on that "miniature" dc-dc converter?   Ebay has terrific ones for incredibly cheap money. Ok, they take a week delivery, but well worth it.
They all have high efficiency, at least 1a output, most above 2a, and many with fully adjustabe voltage and/or built-in heat sinks.  I love mine. They've really perfected these.
Do an ebay search on DC to DC converter.
Just one example (It's $4.99 with free shipping):
http://www.ebay.com/itm/LM2577-Boost-DC-DC-Voltage-Step-up-Power-Converter-3-34V-to-4-35V-/280906614152?pt=LH_DefaultDomain_0&hash=item416756c588

Go Up