LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Honeywell microswitch

Solved!
Go to solution

Hello!

 

I need to read out the state of a microswitch, I have the following model:

http://sensing.honeywell.com/micro-switch-914ce-limit-switch-914ce1-3a-highres.jpg

I have a cDAQ card NI 9209, +-10 V AI. If I get a 10VDC PSU, and wire up this particular microswitch with the PSU and the NI9209, would it work? Do I need to use some resistors to protect the DAQ module? Sorry for the dumb question, I am not an electrical engineer 🙂

thanks!

0 Kudos
Message 1 of 13
(4,969 Views)
Solution
Accepted by topic author Blokk

This should work, but a couple comments:

 

First, I wouldn't use a 10V power source. All you really need is enough to see a voltage change when the switch changes state.

 

Second, you will need a resistor. Try googling "pullup resistor". You should find info on how to size the resistor and wire it up. Also the purpose of the resistor isn't to protect the DAQ input, it's to protect the power supply and switch. Depending on how sophisticated the power supply is, tying its output directly to ground can cause it (and/or the switch) to fry -- or at least crowbar the power supply.

 

Third, for future reference, the prefered way of reading a switch closure like this is with a digital input. With an analog input the latency (how long it will take to detect that the switch has changed state) is a function of the analog sample rate. For example sampling at a 1Hz rate will only allow you to see changes once per second, whereas sampling at a 1kHz rate will allow you to see state changes every millisecond.

 

Fourth, there is a thing called "contact bounce". Basically when a pair of contacts close they don't just snap together and that's that. Rather unless the contacts are "wetted" (a thin coating of mercury is common) the contacts will bounce for a few msec before settling closed. 

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 13
(4,960 Views)
Thanks for advice! In my case i do not need fast detection, this microswitch will be used as a secondary indicator for a valve position to see if all is right (no loss of pressurized air for example which actuates the pneumatic valve). The state of this valve will only change in every few hours only, so i will just sample this channel at 1Hz.

I will look for some DC source to use, like 5V or similar...
0 Kudos
Message 3 of 13
(4,948 Views)

This would be ok? I would use a PSU like this: http://uk.rs-online.com/web/p/din-rail-panel-mount-power-supplies/6138808/

I would use only two wires of the SPDT switch, as an SPST. Thanks!

 

schemeit-project.png

0 Kudos
Message 4 of 13
(4,896 Views)

HI Blokk,

 

yes it will work. But it depends on what you expect. Do you ask for a High or a Low Signal on your DAQ input? If you close S1, you will get a LOW or " 0" Signal on your DAQ. If you open the S1, you will see an HIGH Signal on your DAQ. If you want wo have an HIGH Signal when you close S1, you should use the Pulldown version.

 

Best Regards

 

Chris

Message 5 of 13
(4,877 Views)

Hello,

 

Both case is ok for me, I just need to do a negation in the code depending on the logic.

thanks for feedback! 🙂

0 Kudos
Message 6 of 13
(4,870 Views)

Whilst it work fine, I wouldn't spend £40 on a 5V power supply just for a single switch unless I was going to use it for something else as well (e.g. to power the rest of a circuit etc.). You only need a tiny amount of current for a switching circuit - you could probably use a USB socket which will give you 5V or one of those wall-wart type power supplies.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 13
(4,862 Views)

I agree with you, however in our case I would prefer a more robust "industrial" solution. We already have some different PSUs with DIN rails in an electrical cabinet, and it would be nice compact way to integrate this 5VDC PSU into the same place. Besides, it might be possible we will need to integrate new pneumatic valve(s) into the rig in the future, so more switch circuits might be expected later.

The total material cost of this new experimental rig which we build now is about 50k EUR. So lets say this component does not impact the total budget too much...

0 Kudos
Message 8 of 13
(4,843 Views)

Ah ok, yeah - if it's part of a much larger system then it makes more sense, although in that case you probably already have some power supplies in the electrical cabinet - you could use a voltage divider to scale any DC voltage (e.g. 24V, 12V) down to something safe to use with your analogue input module. e.g.

 

 

You just need to choose the ratio of Rtop and Rbottom such that Vout = 5 (or 10, since you have a 10V AI module) and Vin is your DC supply voltage. You then just need to make sure that the sum of the resistances will cause only a small amount of current to flow through the switch (e.g. the total is something like 10k ohms).


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 9 of 13
(4,825 Views)

Hmm, thanks, this is indeed a simpler solution 🙂 I have already a 24VDC PSU in the rig, which will supply like 8-10 pressure sensors. So I will just create another parallel output from this 24V PSU, and add the voltage divider as you described.

 

edit: so I would make it in the following way. But why you say the sum of the resistors will decide the flowing current? When the switch is closed, the top resistor value will matter only, no?

 

schemeit-project.png

 

0 Kudos
Message 10 of 13
(4,816 Views)