# Trying to Build a voltage-driven smart shunt/threshold switch

I'm trying to build a smart DC switch that measures the input voltage (3V to 40V)1 and determines to which output pin to send it, similar to this threshold switch idea or a SIP3242 for Vin, not load current.2 It should be based on the below logic:

If (Vin > 35V OR Vin < 3v) Then send to GND (via a crowbar circuit?; too high or low)
Else If Vin > 9V Then send to buck circuit
Else If Vin >= 7V Then send to Vout
Else send to boost circuit


I'm not sure what components I need and how to arrange them (schematic), if I can't buy such a device in IC form. (What would such a thing be named?) I am thinking of using a level-shifter to supply shifted Vin to a micro-controller (such as an ATTiny) as analog input, calculate the value of initial Vin and activate an appropriate relay. Is this a reasonable starting point or is there a better/simpler approach using transistors, op-amps or other devices?

I already have the buck and boost circuits designed (using MC3X063As from TI).3 The initial design uses a manual SPDT to send Vin to the buck or boost branch of the circuit. I'd like to replace that with something that doesn't rely on a human to decide what path must be taken (id est, what I'm trying to design/build).

simulate this circuit – Schematic created using CircuitLab

SW2 is what I currently have. SW1 is what I'm trying to build/buy.

1. 3V to 40V is the range a MC33063A can cope with (according to the data sheet), although I'd like to limit it to 35V to be safe. (That's the rating of my caps, although some are rated for 50V.)
2. I'm not trying to immediately pull the voltage down to 7V (as would be done as per this answer, which I think would waste a lot of energy as heat), although that is the ultimate goal, but determine to which switching regulator branch to send it.
3. From what I understand, a MC3X063A can be wired to either buck or boost (but not switch between them of its own volition).
• how much current does your load need? Dec 1, 2018 at 12:18
• @MarcusMüller The device intended to be connected at Vout draws around 500mA to 1A. Dec 1, 2018 at 12:20
• webench.ti.com/power-designer/switching-regulator/select hey, if you hammer in that spec (I used a max output current of 1.25 A, for, you know, being on the safe side), you'll find that the LM3481 can do a SEPIC topology. Dec 1, 2018 at 12:26
• Re 3: the thing isn't really supposed to "switch over" from one mode to the other, but to have a continuous range of operation . Dec 1, 2018 at 12:29

So, the crowbar circuit makes a lot of sense; by the way, do the same for Vin < 0, so that you can avoid damage if someone connects the voltage source the wrong way 'round.

The rest doesn't.

• V == 7 V (exactly) doesn't exist. Your voltage is a natural, random variable, and you can't even measure anything in this world exactly (course you, Heisenberg!)
• Instead of trying to switch over between different two different supplies, simply use one supply that can do both, step up and step down, continuosly.

That supply is more complicated than a Boost or a Buck supply individually, but if you incorporate that you avoid having both, and avoid having to design a clever switchover that avoids transients and damaging the supplies in situations where the voltage oscillates around the nominal output voltage, it's worth it.

I'm a bit surprised: you designed something based on a TI chip, but TI's product tables actually have a selection guide that let's you select "Buck/boost or SEPIC" as architecture!

After pluggin' in your 3V < Vin < 35V and Vout=7V I get 5 results. Lo and behold! Your MC33063A is one of them!

So, don't design one boost and one buck with two MC33063A, design one book/boost or SEPIC converter. Sadly, TI doesn't supply a great Application Note telling you how to design your buck/boost converter. Now, that's not a big deal, since the MC3360xx is not a TI invention (but a derivative of one amongst the oldest mainstream SMPS converters in existence), but exists from many suppliers, one of which is bound to have a good description of how to design one, but let's stick to things that come ready-made for our confused minds:

The TI Webench designer (terrible name) allows you to design a 3 V – 35 V in, 7 V out, 1.25 A converter. It recommends an LM3481 in a flyback configuration.

However, going by the LM3481's datasheet, SEPIC would (at least at first sight) work, too.

• Thank you for pointing out that 7V doen't exactly exist. I have adjusted the conditions to reflect that the device to be connected to Vout can take between 7V and 9V (actually as high as 12V but that's more than what's recommended for efficiency). Dec 1, 2018 at 12:17
• "Sadly, TI doesn't supply a great Application Note telling you how to design your buck/boost converter." That's a contributing factor as to why I came to design two branches (one for buck and one for boost). I was given to the understanding that I'd need one chip per operation. I'm reading up on SEPIC now and will see if I can get a design together. Thank you. Dec 1, 2018 at 12:38