Questions about audio OpAmps and best practice

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear all,

 

I am developing a prototype device, that shall perform the following tasks:

 

  • Record a voice sample while a switch is pressed and held down
  • Save the voice sample on a microSD card
  • Load and playback the voice sample when a PIR sensor is triggered

 

I am using an ATmega 644PA (44PIN TQFP). The whole circuit is powered by a 3.3V coin cell battery.

 

My microphone is a standard Electret 34dB. I have various speakers I will test with, from 1W/4Ω to 2W/8Ω.

 

My questions:

 

  1. Because I only have 3.3V, I can't use the LM386 OpAmp to amplify the audio signal. Is this general purpose amplifier a reasonable substitute?

     

    https://lcsc.com/product-detail/...
     

  2. What is the best practice: To amplify the audio signal when recording, when playing back, or both?

 

Any input much appreciated.

 

Regards,
Roy (Maks)

This topic has a solution.

Last Edited: Thu. Dec 12, 2019 - 08:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Playback from a coin cell?

 

What kind of levels do you get from your  Electret 34d?

The largest known prime number: 282589933-1

Without adult supervision.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That is a good question. Until now, I have been powering the 3.3V from a proper power supply, not from an actual coin cell.

 

I don't have an oscilloscope here. I am testing it by simply connecting the output to my PC. Works fine so far.

 

But, hmmm... you think a Coin Cell would not have enough oomph to drive a small 1W speaker? Not even for a few minutes?

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maks Delanight wrote:
you think a Coin Cell would not have enough oomph to drive a small 1W speaker?

No!

 

surprise

 

Maks Delanight wrote:
To amplify the audio signal when recording, when playing back, or both

You will need both.

 

In normal audio terminology, the microphone would connect to a pre-amplifier, and the speaker would be driven by a power-amplifier.

 

I suggest that you search for "microphone amplifier" and "speaker driver" - pretty sure there should be plenty designed from this type of application and, therefore, suitable for 3V.

 

Maxim springs to mind as a good place to start ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maks Delanight wrote:
Because I only have 3.3V

From a  coin cell, you actually have only 3.0V

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

No!

 

surprise

 

Oh my... typical me and my optimism. frownsmiley Well then, I guess I will have to look into using more powerful, lithium ion batteries.

 

Thank you so much for the pointers!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Maks Delanight wrote:
you think a Coin Cell would not have enough oomph to drive a small 1W speaker? Not even for a few minutes?
Never mind the speaker.  It won't even be able to write to the SD, and probably won't be able to read from it either.

 

From https://en.wikipedia.org/wiki/List_of_battery_sizes:

 

While you can in practice get more than the 3mA/15mA quoted, the voltage of the cell will rapidly take a nosedive.

 

An alternative might be to slowly charge a supercap from the coin cell, and power your circuit from the supercap.  However losses will be > 50%, but it still won't give you continuous operation, and the physical size of the supercap will negate the space savings of a coin cell.

 

A small LiPo seems like a good idea.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:

While you can in practice get more than the 3mA/15mA quoted, the voltage of the cell will rapidly take a nosedive.

 

An alternative might be to slowly charge a supercap from the coin cell, and power your circuit from the supercap.  However losses will be > 50%, but it still won't give you continuous operation, and the physical size of the supercap will negate the space savings of a coin cell.

 

A small LiPo seems like a good idea.

 

Very interesting idea about the supercap... but probably not viable in the long run.

 

Yeah, I'll look into getting a LiPo for this. Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't have an oscilloscope here

If you are going to tinker with microphones, audio signals, the ADC, and the DAC, and analog signal processing you NEED an O'scope.

Even a single channel "toy" O'scope will be fine for looking at the audio signals, their amplitude, DC offset, noise, etc.

 

Get yourself a Christmas present, a small O'scope kit from Banggood Electronics for $12 USD.

You can't purchase the chip and the display for that amount!

 

JC

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gabotronics is another source with multiple distributors.

Gabotronics - Development Boards and Electronic Kits

 

Saelig has two Rigol scopes on sale.

Rigol DS1202Z-E 200MHz 2-Ch Digital Oscilloscope ($339.00) : Saelig Online Store

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

Get yourself a Christmas present, a small O'scope kit from Banggood Electronics for $12 USD.

You can't purchase the chip and the display for that amount!

 

Waauv, that is the cutest little O'scope that I ever saw! smiley And the price is incredibly cheap. I will certainly consider.

 

gchapman wrote:

Gabotronics is another source with multiple distributors.

Gabotronics - Development Boards and Electronic Kits

 

Saelig has two Rigol scopes on sale.

Rigol DS1202Z-E 200MHz 2-Ch Digital Oscilloscope ($339.00) : Saelig Online Store

 

 

Excellent alternatives - love the Rigol scopes, had one in the past.

 

Thank you both.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You may want to get a copy of application note " AVR335: Digital Sound Recorder with AVR® and DataFlash"
 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maks Delanight wrote:
Is this general purpose amplifier a reasonable substitute?
Don't need that much GBW (6MHz) for telephone-quality speech; consider LMV321 (1MHz)

Maks Delanight wrote:
To amplify the audio signal when recording, when playing back, or both?
Both though some audio DAC output enough current to drive some headphones (more so voltage for some headphones)

 


Diodes Incorporated Offers New Low Voltage Rail-to-Rail Operational Amplifiers | Diodes Incorporated

LMV321 (Operational Amplifiers) | Diodes Incorporated

AVR Parrot

[AN2547, page 15]

Figure 4-3. Example Microphone and Speaker Circuit

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
A small LiPo seems like a good idea.
Lithium-ion coin cells are about an order of magnitude less internal resistance than a CR.

Still iffy even with a 100mW speaker.

 

Bulk quantity Lithium Ion Button Cells for sale

Li-Ion Rechargeable 2032 Button Cells, LR2032, 3.6V 40mAh (20d x 3.2mm, 0.14Wh) (0.012) - UN 38.3 Passed

Micro Speakers - Soberton Inc.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:

You may want to get a copy of application note " AVR335: Digital Sound Recorder with AVR® and DataFlash"

 

This document is pure gold. It contains almost everything I need to know. Thanks!

 

gchapman wrote:

Is this general purpose amplifier a reasonable substitute?

Don't need that much GBW (6MHz) for telephone-quality speech; consider LMV321 (1MHz)

 

Yeah, the LMV321 looks more reasonable.

 

gchapman wrote:

A small LiPo seems like a good idea.

Lithium-ion coin cells are about an order of magnitude less internal resistance than a CR.

 

Still iffy even with a 100mW speaker.

 

Bulk quantity Lithium Ion Button Cells for sale

Li-Ion Rechargeable 2032 Button Cells, LR2032, 3.6V 40mAh (20d x 3.2mm, 0.14Wh) (0.012) - UN 38.3 Passed

Micro Speakers - Soberton Inc.

 

Wow, thanks for all the pointers.

 

The final device is supposed to run non stop (and the speakers should be easily audible), so as for LiPo, I think I will go with a 500 mAh battery like this one:  https://www.lazada.com.ph/products/lithium-ion-polymer-battery-37v-500mah-i315312163-s643184265.html

 

They are small and can be attached to the hidden side of the PCB (inside of device). Then I'll use a Micro USB plug type B for charging it from a PC or USB outlet.

 

Again, thanks all. This site is an amazing resource.