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.
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.
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.
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.