Convert "Sound" digital output into controllable voltage

joliebrise

New Member
My Tai Chi metronome works using a digital10k potentiometer to select and display timings of 2 to 5 seconds beats.

My problem is to increase the "sound" output.
I have tried OpAmps and Darlington pair with little effect, once using a 100R preset to reduce volume.
I looked at using the "sound" digital pause pulse to trigger a 555 to allow me to control the volume but it does not like the trigger pulse to be held on for too long.
The trigger/reset pulses are the wrong polarity.

DAC digital to analog is a solution but I cannot see what and how this is achieved with Picaxe.
First thing is to read the "Sound" output as an eigth bit binary code. ( My 8 bit led display uses %00001100 to light a led bar.)
I know the voltage will be in steps and not continous which is similar to the digital potentiomenter as it has 64 resistor steps. This is not a problem.
I have read many articles with nothing applicable to my needs.

Sound b.1, (50,50) : Pause 2106 :

How can Picaxe help?

Thanks Tony
 

AllyCat

Senior Member
Hi,

It depends what type of loudspeaker or "transducer" you're using to convert the electrical signal into "sound". But if it's a conventional loudspeaker of between about 4 and 32 ohms (mounted in a suitable enclosure) then I'd probably use a PAM8403. I discussed it here as a stepper-driver, but it's intended to be used as an audio amplifier. With its H-bridge output(s), it gives double the (supply) drive voltage, with no need for any coupling capacitors. For low power battery operation you might want the PCB version that gives access to the standby pin (the one I linked does not, and would be very difficult to modify).

In principle you could use the PICaxe's DAC output (using the SOUND output pin as its Reference input), or drive narrow (PWM) pulses into a low-pass filter (R-C), to control amplitude and tone.

Cheers, Alan.
 

joliebrise

New Member
Thanks AllyCat for pointing me in the direction of PAM8403

I have spent a lot of time researching its usage and how to use it with only one channel in my Tai Chi metronome. I also got involved in which speaker to use.

This post is an extract of my website Picaxe Tutorial - Full details "Digital Volume Control"

"Turning to The Picaxe Forum has produced valuable advice. AllyCat suggested using a 2 channel 3W PAM8403 audio amp 5v module. The chip is on a 20 x 20mm PCB with just 9 wires to solder and no added components needed. “Cheap as chips”.

My first concern was the module comes with 2 channels and needs two speakers where as I only need one channel and speaker for my metronome.

Another forum “Electric Point” came to my rescue.

Use one channel and forget all about the second. Use 4Ω 3W speaker."


Thanks again AllyCat
 

Attachments

Top