Last Updated or created 2025-10-08
While I made this for my Commodore C64, it is applicable for many things.
It started with some cheap displays from Ali, and some leftover Wemos D1 from my Pressure Lab project.
I Started measuring the audio output from sound devices and from my C64.
I soon discovered that I needed some way to get the offset and amplification correct for the analogue input of a Wemos. (0-3v3)
So a little op-amp circuit was born, but not without some struggles.
I forgot many things about amplifiers. It was one of the first school books I got rid of. (Sorry mister Rafaela)
After searching the internet and posting a question on Reddit I ended up with the following.
R1 and R2 are 100M. The potentiometer P1 allows me to set the offset.
R3 is 1M
C1 is 100nF to decouple the audio signal from the RCA.
R4 is 47K and C2 is 330nF (thanks tycho205)
Cimportant=1/(2πfR2)
where f is the lowest frequency of interest. In this case Cimportant should be about 330nF
LM324 is a quad amplifier, leftover from another project.
Note, the SINGLE RAIL power.
P2 potentiometer is 2M (leftover) and gives me a variable amplifying opportunity.

A = Audio input
B = Setting the offset with P1
C = Setting the amplification
The displays are 3 Wemos controllers with a cheap I2C display.
These are just fast enough to do FFT.
Analogue in is the output from the OP-amp offsetter ..
CODE
Needs cleaning up, and a better stabilize routine.