I'm currently trying to design a circuit which controls the input of a receiving module which interprets the current flowing through itself as StateA, StateB or StateC. What the input module does with the states is irrelevant in this matter, since I'm focusing on making these currentStates flexible through a raspberry pi.
Normally this input module is controlled with switches and resistors.
But the control circuit I'm designing needs to be maintained (switched) in software and there can't be any physical switches that need to be pressed. Also, since I want to control which of the current States occur with a raspberry pi, a portion of the circuit will end up running on 5 volts. The input module is supplied with 24 Volts. (range goes from 19 to 27 volts)
Originally I planned to get an Arduino Mega (which then gets its input from a raspberry pi) and with it's ~50 Digital Pins I'd be able to control a relay per State per Input. There are 8 Inputs on the module with 3 States each. That makes 24 Relays with corresponding resistor values. But this turns out to be very ineffective compared to just using resistors with switches.
See the schematics below for clarification:
simulate this circuit – Schematic created using CircuitLab
Is there a different way to provide these 3 "States" with the usage of GPIO? Maybe some sort of switch that is controllable with GPIO?