I'm working on a simple guitar amplifier and reader with Arduino. The Arduino will use this input to find the amplitude and frequency of the input signal.

I'm getting confused about how the ADC inputs should be protected from negative voltages. So far, there's I've found two solutions: Use a diode to stop negative voltages OR offset the voltage. Using a diode seems like it would be easier to calculate the frequency since the negative cycle is just 0V, but I'm afraid that the signal will get too distorted or weak. But I'm just not sure which is the correct one for this situation. Which is the better solution? And why?

This is my circuit using a diode on the output. Vout is across R3: enter image description here

This is my circuit using offset voltage. Vout is the BJT collector voltage: enter image description here

  • \$\begingroup\$ You permanently lose dynamic range if you offset and know your signal won't ever have anything useful that is negative. \$\endgroup\$ – DKNguyen Jun 8 '20 at 23:22

1) In that circuit, set the collector resistor == Rbase / beta.

This set the DC Vout to VDD/2.

That suggests 1,000 Ohm in the collector.

2) your circuit will have a gain of 0.5 * ( 5v / 0.026 ) = 0.5 * 5 * 39 = 100x

Thus more than 0.05v input will be clipping (in the rails);

3) for moderate (10%) distortion, keep the input voltage at 4 milliVolts or less

4) the ADC needs to grab a bunch of charge during each sample; you can evaluate the impact of these impulse_functions, by adding 10nF from collector to Ground.


Your output voltage (across R3 or at the collector of the transistor) can not be negative. You are powering the transistor with a 5V supply...there is no way to get a negative voltage at the collector of the transistor in this circuit.

Assuming that you have properly biased the transistor, and that you are using an Arduino operating at 5V, then no offset or diode is needed to prevent negative voltages.

  • \$\begingroup\$ I ran some simulations (the same circuit as above, but with only a capacitor and no diode) and the output can reach up to -1V. This is below the Arduino's minimum voltage rating (-0.5V). \$\endgroup\$ – sparpo Jun 9 '20 at 0:18
  • \$\begingroup\$ Your simulation is wrong. Also putting a diode directly in series with a capacitor will result in no output at all. Think about it: A diode only passes DC, a capacitor only passes AC. result - nothing. \$\endgroup\$ – Kevin White Jun 9 '20 at 0:43
  • 1
    \$\begingroup\$ If you couple the output of the amplifier with a capacitor the voltage can go negative. You should either directly couple the collector to the ADC or ac couple via a capacitor with ADC biased to 2.5V with 2 resistors. \$\endgroup\$ – Kevin White Jun 9 '20 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.