Circuit suddenly stopped working... fried?

Hi all, I built this attached circuit with a couple changes to analyze audio (changes listed below). It worked before, but when I tested it again today, it just stopped working. My code below prints 127 (half of 255 due to my DC offset) to the serial monitor just fine, but when I play audio, the value stays at 127 and does not fluctuate as it did before.

What I know is that when I tested it today, I started smelling smoke, but I couldn’t identify where the smoke smell was coming from. I felt one of the batteries, and it was significantly warmer than the other one. My jumper cables connecting to the batteries do have exposed ends (rookie mistake), is it possible that they touched another part and fried some part of the circuit? Should I rebuild the entire circuit with new parts?

Changes to circuit:
-removed 47nF capacitor
-voltage divider resistors are 10k
-feedback resistor 30k
-audio input is done by connecting iphone jack to a female socket with ground, sleeve, and tip pins. Sleeve and tip connected to 5k resistors, both fed into the noninverting input of op-amp.

byte incomingAudio; //setup A0 pin
boolean clipping = 0;

void setup(){

  pinMode(13, OUTPUT); //LED clipping indicator pin

  cli();  //disable interrupts
  
  //set up continuous sampling of analog pin 0 (increase default sampling rate of 8000Hz from analogRead() function in order to increase resolution)
  
  //clear ADCSRA and ADCSRB registers
  ADCSRA = 0;
  ADCSRB = 0;
  
  ADMUX |= (1 << REFS0); //set reference voltage
  ADMUX |= (1 << ADLAR); //left align the ADC value- so we can read highest 8 bits from ADCH register only
  
  ADCSRA |= (1 << ADPS2) | (1 << ADPS0); //set ADC clock with 32 prescaler- 16mHz/32=500kHz
  ADCSRA |= (1 << ADATE); //enable auto trigger
  ADCSRA |= (1 << ADIE); //enable interrupts when measurement complete
  ADCSRA |= (1 << ADEN); //enable ADC
  ADCSRA |= (1 << ADSC); //start ADC measurements
  
  sei();//enable interrupts

  Serial.begin(9600);

}

//Interrupt function: every 26us (13 clock cycles / 500000 Hz = 26us, or a rate of 38.5kHz), incomingAudio 
//automatically updated: pauses loop() every 26us to run then continues loop()
ISR(ADC_vect) //when new ADC value ready
{ 
  incomingAudio = ADCH;//update the variable incomingAudio with new value from A0 (between 0 and 255)
  Serial.println(incomingAudio);
  if(incomingAudio == 0 || incomingAudio == 255) //if audio at either value, means it is clipping
  {
    digitalWrite(13, HIGH); //turn LED on
    clipping = 1; //clipping state ON (currently clipping)
  }
}

void loop(){
  if(clipping) //if currently clipping boolean 1 = true
  {
    clipping = 0;
    digitalWrite(13, LOW);  //turn LED off
  }
  delay(100); //wait so LED on is visible to human eye
}

How to post an image


I believe I might have mentioned this before...

Inside an ISR ?

Serial.println(incomingAudio);


Maybe be better:

if(incomingAudio <= 5 || incomingAudio >= 250)

Is it possible that they touched another part and fried some part of the circuit?

I find this a strange question, surely you know the answer.

What happens if you vary the voltage on A0, for example by putting another resistor in parallel with one of the voltage divider resistors? Does the printed value change?

Realistically, the only thing you might damage is the amplifier, the other components are more robust.

PerryBebbington:
Realistically, the only thing you might damage is the amplifier, the other components are more robust.

Hi Perry - sorry about the image file, I keep forgetting. I appreciate the reminder; I will definitely try my best to correctly post an image in the future.

In any case, luckily I had a spare amplifier lying around - I replaced it, and it worked!! I must have somehow fried my old amplifier. You really are a hardware whiz, thank you for the suggestion.

I also have one more concern - the battery that is connected from ground to VCC- of the amplifier seems to be draining at a much faster pace than the other battery. Why is this? I'm also leaving the batteries plugged into the circuit overnight, does this drain the battery even when the circuit is not in use, or do I need to unplug the batteries / implement a switch?

Aside from wrapping electrical tape around exposed connections, I would seriously appreciate any suggestions for protecting my circuits in the future. I just got into this hobby, and I'm eager to learn.

The battery that is connected from ground to VCC- of the amplifier seems to be draining at a much faster pace than the other battery.

I vaguely think that the current drawn from the negative supply might be less than from the positive supply for reasons I have forgotten :confused:

I'm also leaving the batteries plugged into the circuit overnight, does this drain the battery even when the circuit is not in use, or do I need to unplug the batteries / implement a switch?

As far as the circuit is concerned, if it has power it is in use and will drain the batteries. Yes, you need to disconnect the batteries when you are not using the circuit.

Aside from wrapping electrical tape around exposed connections, I would seriously appreciate any suggestions for protecting my circuits in the future.

Use electrical connectors of some kind. At the very least use chocolate block connectors:
chocolate block connector.jpg

chocolate block connector.jpg