Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert 10.5V signal to 5V digital input

Hey everybody, thanks in advance for your help on this. I have an inductive proximity sensor that I'd like to read as a digital input signal on my USB 6008 DAQ. It takes 12V power and has about a 1.5V drop, so the resultant signal when the sensor is activated is about 10.5V.

 

I thought I could use a simple voltage divider to lower the voltage and input it as a digital signal. Now the sensor will read 0.4V low and 4.9V high, which seems like it would work great. But when I plug it into my digital input on my DAQ, my low voltage jumps over 3V, reading a constant high whether the sensor is activated or not. Anybody know why it is pulling my voltage up and how I can fix it?

 

Thanks again!

0 Kudos
Message 1 of 11
(7,533 Views)

This is due to the onboard 4.7k pull-up resistor of the USB-6008. See page 18 of the datasheet for more details.

 

You can redesign your dividor by taking this resistor in account but I would use an optocoupler (for example PC817).

0 Kudos
Message 2 of 11
(7,530 Views)

Hi,

 

Reading your post I think your sensor a 2-wire device ? Can you confirm this.

 

Kees

0 Kudos
Message 3 of 11
(7,526 Views)

is your 12v source mutually grounded together with the daq? sounds like your daq is loading the voltage divider, thus changing the voltages you are seeing....

 

i would use a voltage comparator(VSS tied to your 12v source) to interface with your daq. connect the comparator ouput open collector to a pullup resistor connected to your daq 5vdc. set your input voltage reference to 6v, assuming that your sensor switching is 12v and gnd(off and on). voltage signals above 6v ouputs daq 5vdc, thus less than would sink to daq GND(all sources mutually tied).

0 Kudos
Message 4 of 11
(7,511 Views)

Do you have to use a digital line?  Analog will take that voltage, and presents a higher impedance without the pullup resistor that the DI's have.  Use the coerce/in-range to turn it into a boolean in software.

0 Kudos
Message 5 of 11
(7,506 Views)

Thanks everyone for the tips!

 

JB: I will try recalculating my voltage divider and give it a shot. But it seems like the impedance of my signal is going to be an issue.

 

KC: It's a single line signal.

 

Apoc: You got a little over my head, but it seems like what you're suggesting is very close to the solution I think may work. Which is to wire in an op amp before the DAQ. Which as I understand it, basically acts as a poor mans voltage comparator. My question is, how do I decide which op amp to pick? The only equation I've been able to find is V=Ao(V+ - V-). But I can't find Ao spec'd on any op amps at my local radioshack. Do I just need to look harder for this spec? Or am I misunderstanding your suggestion?

0 Kudos
Message 6 of 11
(7,493 Views)

something like this....

 

prox sw.png

Message 7 of 11
(7,485 Views)

Apok,

Any simpler solutions? I'm really not much of an electronics person and am rather overwhelmed by your circuit (although I'm sure it seems very straightforward to you). Thanks for your help.

0 Kudos
Message 8 of 11
(7,467 Views)

JB,

Thanks for the info. I really don't know how to appoach redesigning my voltage divider with the pull up resistor connected the the 5V signal though. I'd really appreciate any help you can give me on that.

 

I also like the optocoupler idea. But I'm a little confused by your suggestion of the PC817. Keep in mind I've never used one before. But when I pulled the datasheet up, I couldn't find anywhere that showed that it would accept a 10.5V input and it indicated that it had a 6V output. Am I way off on this?

0 Kudos
Message 9 of 11
(7,464 Views)

Sorry, I read your answers only now.

 

As you can see below, the circuitry with an optocoupler is really basic. If needed, add a capacitor (eg 220nF) between pins 1 and 2 of the optocoupler to filter the output of the sensor.

 

Obviously, the used Px.x of the USB-6008 must be configured as a DI with the default open collector mode.

 

The main advantage of this solution is the galvanic separation provided by the optocoupler.

Connected like this, the optocoupler acts like an inverter so don't be surprised to get a low level when the output of the sensor is high.

 

PC817.jpg

 

Don't hesitate to answer if you need further help.

0 Kudos
Message 10 of 11
(7,458 Views)