Adjustable signal voltage control with 2.5v center

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
wstuck
 
Posts: 28
Joined: Mon Nov 28, 2011 8:58 pm

Adjustable signal voltage control with 2.5v center

Post by wstuck »

I need help finding a kit or parts to solve what I thought would be a simple problem.

I have a motor controller that has the ability to have analog input devices like a potentiometer or an analog joystick. The input signals are 0v-5v DC with a 2.5v center point. When the analog device is calibrated correctly it is easy to achieve the 0v-5v DC.

But what if you want to add gain to the input signal and maintain the 2.5v center or add loss to the input signal and maintain the 2.5v center. Or what if you replace the analog device with a hall effect sensor that has voltages that are not quite 0v-5v DC? Another example is to have limitation adjustability so the center is always 2.5v but the min and max can be changed to something like 1.5v-3.5v with the same 2.5v center

Thanks for any help or suggestions.

meseta
 
Posts: 82
Joined: Tue Aug 02, 2011 7:57 pm

Re: Adjustable signal voltage control with 2.5v center

Post by meseta »

Ah yes, this is a classic text-book analog electronics example.

You can use a simple opamp circuit to amplify/attenuate the signal with respect to a 2.5V bias. The circuit you want is an inverting amplifier circuit something like this:

Image

Replace Vref with two resistors to supply 2.5V to the non-inverting input.

If you want adjustability, simply replace either R1 or R2 with a variable resistor/potentiometer.

In your example, scaling +/- 2.5V down to +/- 1V (both centered at 2.5V), you would use any combination of resistors where R2/R1 = 0.4. or example: R1: 20k, R2: 8k (though 8k resistors don't actually exist, find an alternative pair or find nearest match).

Because this is an inverting amplifier, your output will be inverted, i.e 5V becomes 1.5V, and 0V becomes 3.5V. Add an unity-gain inverting amplifier stage after this to flip things the right way round.

Because you're probably using a 5V supply, you may want to use rail-to-rail opamps (these can output voltages right up to the supply voltage, as opposed to many opamps which can only reach 1.2V below the supply voltage)

User avatar
wstuck
 
Posts: 28
Joined: Mon Nov 28, 2011 8:58 pm

Re: Adjustable signal voltage control with 2.5v center

Post by wstuck »

Thanks for your help.

User avatar
wstuck
 
Posts: 28
Joined: Mon Nov 28, 2011 8:58 pm

Re: Adjustable signal voltage control with 2.5v center

Post by wstuck »

Do you have any recommendation on circuit design software to test the above circuit?

meseta
 
Posts: 82
Joined: Tue Aug 02, 2011 7:57 pm

Re: Adjustable signal voltage control with 2.5v center

Post by meseta »

Hmm, I've never really used any circuit design software, I do it old-school style with the paper and the pencil and the theory, testing on the actual circuit with a signal generator and oscilloscope (or potentiometer and multimeter since this works in DC quite well); op-amp circuits tend to be fairly well behaved.

I'm sure another forum user can suggest to you a good electronics sim software.

User avatar
wstuck
 
Posts: 28
Joined: Mon Nov 28, 2011 8:58 pm

Re: Adjustable signal voltage control with 2.5v center

Post by wstuck »

Thanks for your help.

User avatar
ImaginaryAxis
 
Posts: 267
Joined: Sat Nov 13, 2010 3:16 pm

Re: Adjustable signal voltage control with 2.5v center

Post by ImaginaryAxis »

TINA-TI is free from Texas Instruments.

LT Spice is free from Linear Technology.

TINA-TI is easier to get up and running in my opinion. LT Spice has those idiosyncratic annoyances like PSpice.

User avatar
wstuck
 
Posts: 28
Joined: Mon Nov 28, 2011 8:58 pm

Re: Adjustable signal voltage control with 2.5v center

Post by wstuck »

I have attached an image of the circuit that I built. The circuit works but I do not think the design is electrically sound. If someone would like to help me design a better circuit it would be greatly appreciated.

Thanks for any help or suggestions.
Attachments
Data Files.zip
Circuit Maker Files
(89.23 KiB) Downloaded 59 times

User avatar
wstuck
 
Posts: 28
Joined: Mon Nov 28, 2011 8:58 pm

Re: Adjustable signal voltage control with 2.5v center

Post by wstuck »

Op Amp update:
The op amp on the drawing is an MC1458 but the one I used in the real circuit is an ALD2702A 5V rail-to-rail.
Attachments
ALD2702.zip
Specs
(67.31 KiB) Downloaded 59 times

christosg
 
Posts: 11
Joined: Mon Jan 20, 2014 9:41 pm

Re: Adjustable signal voltage control with 2.5v center

Post by christosg »

im using this mic for the voice changer and it has a great pick up on it . sounds supper clear when i have it away from my face but i need it to sit in a industrial respirator for the costume to work .when i put it in all i hear is a distorted version of my voice (and not the way i like it lol) is there a way to turn down the gain or add a resistor to it and take away some of the reverberation?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adjustable signal voltage control with 2.5v center

Post by adafruit_support_mike »

If you're using the circuit in the diagram above, you can lower the gain by reducing the value of R2, which sits between the amp's output and negative input. The ratio of R1 to R2 sets the gain.

WRT the echo, there isn't much you can do electrically. The mic is picking up sound waves that are physically present in the mask, and can't tell the difference between the ones you want and the ones you don't. Try mounting the mic so it's as close to your mouth as possible and putting a layer of foam around it. That should deaden some of the echo.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”