6

Does a component exist that allows an analogue signal through until it receives a digital 1, then allows that digital 1 through? As an example:

  1. Analogue sine wave going 0V to +5V is only input, output is the exact same sine wave
  2. +5V DC input turned on
  3. Output now becomes only +5V DC, ignoring the sine wave.
  4. +5V DC input turned off
  5. Output returns to sine wave

The digital signal won't be on all the time. When it is, I want it to override the analogue signal. My specific case is using four button/fader pairs.

I haven't found an accurate way to word it that might return actual components in Google. An Analogue OR Gate, perhaps?

Corsaka
  • 165
  • 6
  • Are you sure this is the best approach? What does 0-5v analog vs. 0/5v digital mean to the circuitry downstream? How is that circuitry going to determine if the signal is 4.99v (part of analog signal) or 5v logic high? Why not use the digital state to do something else downstream, which can more accurately delineate the state. – rdtsc Nov 18 '20 at 13:13
  • It controls a light on the other end, so exact values don't exactly matter. – Corsaka Nov 18 '20 at 19:23

4 Answers4

8

there's various ways of doing this, but the simplest would probably be using an analog switch IC that you control with the digital input, which has two inputs, one of which you connect to your analog signal, the other which you simply tie to 5V.

In the more general case, "maximum of two inputs" is not hard; all you need would be two diodes:

schematic

simulate this circuit – Schematic created using CircuitLab

If your inputs are driven well enough and output is weakly, but pulled towards ground, a) is sufficient. I'd recommend you make sure that you neither put any large load on the diodes (as that will lead to an inequal voltage drop!), and make sure the output converges back to 0 V when the output becomes low, so go with something like b).

Now, you say:

I've got four button/fader pairs, and I want each one to be combined into one wire, with the digital signal overriding the analogue one.

well, that's even more trivial.

Your fader is probably a resistor, i.e. your analog signal has a relatively high source impedance.

That makes this really trivial:

schematic

simulate this circuit

The button pulls the output high, done!

Marcus Müller
  • 94,373
  • 5
  • 139
  • 252
7

An analogue multiplexer sounds like it could work. You can get them that are SPDT configuration and the control line chooses either (a) the analogue signal or (b) the digital signal. Maybe the ADG852 will do the job: -

enter image description here

Analogue sine wave going 0V to +5V is only input, output is the \$\color{red}{\boxed{\text{exact}}}\$ same sine wave

You'll never get an output that is "exactly" the same - there might be the odd 100 μV offset or 0.01% change in amplitude (depending on the source impedance of the sinewave and the loading of the output) but, it'll be "more secure" as a solution compared to diodes. If your sinewave frequency is above a few tens of MHz then there are other analogue multiplexers that are more intended for higher frequencies.

Andy aka
  • 456,226
  • 28
  • 367
  • 807
3

If you're not bothered about the small voltage drop, you could just use diodes to give you the maximum of the two voltages? Does require a fairly low impedance on the output though, as then the analogue input can't actively drive the output lower.

Other solutions might be available if we knew what the context was.

pjc50
  • 46,725
  • 4
  • 65
  • 126
  • This is about as much context as there is. I've got four button/fader pairs, and I want each one to be combined into one wire, with the digital signal overriding the analogue one. – Corsaka Nov 18 '20 at 09:53
  • How do you intend to un-combine them? – pjc50 Nov 18 '20 at 09:54
  • They won't need to be un-combined; the digital signal won't be on all the time. Just, when it is, I want it to override the analogue signal. – Corsaka Nov 18 '20 at 09:55
  • That is exactly the context missing from the question, @Corsaka!! (this is really changing my answer.) – Marcus Müller Nov 18 '20 at 09:58
  • Oh, shoot. Apologies! – Corsaka Nov 18 '20 at 10:00
  • @Corsaka you added in the obvious thing, forgot to add the important part about your application: faders and buttons. (generally: if you can, tell an engineer what you want to achieve, not only what you are asking yourself. Our jobs are literally knowing what to do to solve problems, not only be encyclopedias with an unhealthy desire for coffee) – Marcus Müller Nov 18 '20 at 10:04
1

Such devices are called analog multiplexers or analog switches.

Justme
  • 147,557
  • 4
  • 113
  • 291