# Switching voltages with demux and switches

I am trying to design a circuit that, depending on a value that a microcontroller recieves (between 1 and 10), a fixed voltage of 20 V, 40 V, 60 V,... or 200 V (depending on the value recieved by the microcontroller) appears at the output. So, for example, if the value 2 is read, then 40 V should appear at the output; if the value is 6, then 120 V; and so on. In other words, I have to control digitally a switch that short-circuits the output of the circuit with one of the ten voltage sources available.

This is what I've done so far:

The microcontroller recieves a value between 1 and 10 (via USB, but that doesn't matter). The thing is that I put that number in an output port using 4 bits. Those pins enter a demux that is connected to 10 different outputs. So the thing is that I want these pins to control a set of interruptors that make a short-circuit between the output and the voltage sources. I have available ten voltage sources of the ten different values (20 to 200 V). I don't know how to implement this part of the circuit.

I've thought of each output pin of the demux being connected to a MOSFET that would act as switches, but I don't know how to connect them in order to get what I'm looking for. I believe some drivers would be needed here, but again, I can't think of a way to connect them to get the desired result.

Do you have any ideas? If the question is not clear please let me know, and I'll try to clarify it.

EDIT:

The resistance load for the circuit will be 50 $\Omega$. The output has to be a rectangular wave (its duty cycle can be varied with a variable resistor). The maximum amplitude of the wave can be 200 V, and the minimum 20 V.

The maximum average output power reaches 1.92 W (there are peaks of instantaneous power of 800 W), and the mean value of the output current is 9.6 mA.

• old linear Lambda supplies could be remote programmed with 200 Ohm per voltage using a resistor DAC. That was the easiest way. HP supplies used HP-IB aka IEEE488 serial interface to remote program easily. – Tony Stewart Sunnyskyguy EE75 Dec 5 '16 at 4:38
• The voltage sources you have to switch on, are AC or DC? Also, as @Richard Crowley is asking, what is the maximum current? – Adam Calvet Bohl Dec 5 '16 at 7:58
• @AdamCalvetBohl The voltage sources are DC. The peak current (found by simulation) gets to 4 A, but the average is way lower. – Tendero Dec 5 '16 at 15:19