Audio Processing w/ Arduinos.

I’ve been reading many articles that are similar to my project. But when simulated they never work. Or I’m having difficulty understanding how they work.

The objective is to input the line-out of a music maker shield, omit/shift the signal to ignore the negative portion of the audio signal, run it through an envelope detector/follower and scale the signal to the upper limit of the Arduino or Op Amp.

The important design concerns are that the envelope should closely follow the input. That the actual scale is not critical as it will be subsequently divided in software into 3-5 windows (voltage ranges). That any lag introduced is minimized. And that it is compatible with the Music Maker shield and amplifier.

Summarizing, the main functions are:

  1. connect to MM shield
  2. protect against negative portion of audio
  3. output signal envelope
  4. scale close to 5V
  5. output to Arduino analog pin

Ive attached my last schematic. On simulation, it appears to do what I desire. But I’m not confident on the input circuitry, between the MM and op amp input.

Will this work as is, or do I need any changes on the input side

The important design concerns are that the envelope should closely follow the input.

Why? What do you think this will do for you?

Your circuit seems overly complex.

The peak detector is simple enough to make, just a diode resistor and capacitor. However the decay is determined by a resistor across that capacitor. This will not actively follow the decay of the signal. From an aesthetic point of view this is what you expect. Have you a reason for wanting anything else.

The expanded envelope is used to calculate an RC Servo position of the mouth of an animatronic. “Closely” is relative, as the mouth movements should track peaks and valleys. Some decay is acceptable, and is desirable to move the mouth realistically.

The 1.2V range if the audio is insufficient to track small movements. I agree that it’s overly complex, but is what I came up with to meet the holy trinity of my requirements.

I) Audio input that won’t damage the op amp, II) envelope following and III) expanded input range.

I’m actually working on a new circuit, that combines a summing amplifier (that removes negative components), an envelope follower and amplifier. I have the summing amplifier and envelope follower working in simulation.

position of the mouth of an animatronic

Ok I did this with LEDs see this:-

I used the audio output through an envelope follower back into the analogue input.

Like this:-