• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using DIP switch for discrete IO

Status
Not open for further replies.

somcar

New Member
We are looking at a simple method to identify tooling on a injection molding production line. I want to create a simple circuit using a DIP switch that would send a binary code back to a PLC to tell it what mold is currently setup. We are not going to use more than 15 molds, so I purchased a 4 position DIP switch. These DIP switches will stay with the mold. I need a simple circuit that would identify the mold, send the binary code to the PLC (24 v input). I would like to keep it at 5v to the dip switch and then up the voltage to 24v so the plc can read the code. I will use standard 9 pin D connector for the connection method. My electronic experience is basic, but learning rapidly. Any help would be appreciated.
 

Papabravo

Well-Known Member
I would not bother with the 5V. Just run a 24V ouput over to the common on the dipswitch and read the four 24V inputs. Unconnected inputs should read 0 but you'll have to verify that.
 

somcar

New Member
Problems with LED's flickering

I tried the schematic with the 24 volts going directly through the dip switch. The problem I am having now is with the LED's. I am using the LED's to visually indicate the decrete I/O that is setup in the box. When the dip switch is set in the off position and another is in the on position, I am getting feedback to the LED's that are off. I am also having problems with the LED's when they are on, they start to flicker on and off. This is a very simple circuit, but I am having a hard time getting it to work with the visual LED's. The inputs to the PLC seem to be steady and do not flicker. I have attached the schematic with the specs on the LED's. I have went from a 1.2 K ohm resistors to 2.7 K ohm to see if that would help.
 

Attachments

MikeMl

Well-Known Member
Most Helpful Member
Is the 24V AC or DC?

What is the input resistance of the PLC?

Do those inputs have internal pull-down (to 0V) or internal pull-up (to 24v) resistors?

You should be able to tell if you use a voltmeter to measure the voltage at one of the unconnected inputs to the PLC.
 
Last edited:

somcar

New Member
This is a 24vdc system. I am using the same type of LED's to simulate the PLC. I don't actually have this connected to a PLC. I measure the voltage to the PLC and it measures 24 vdc. The LED's that I am simulating the PLC don't flicker or dim in any way. Just the ones that are on the Printed circuit board.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top