Add audio to existing large Teensy 4.1 project?

Status
Not open for further replies.

MMESSITER

Active member
Hi

I read with great interest about the fabulous audio possibilities of Teensy 4.x. I’m using a Teensy 4.1 as MCU in a new full featured radio control system for model helicopter flying I’m developing.

I’d like to add audio to this system so that the transmitter can ‘speak’ to the user. Can I do this in a practical way, using only a few pins?

(Using a shield isn’t practical at this stage of course. )

I hope so!

Malcolm Messiter
 
It depends on what pins you have available.

If you have the TX/RX pins of one of the 8 serial ports available, you could use one of the various chips that play a sound based on a serial stream. The company dfrobot.com came out with one that takes a micro SD card, and you can control it via a UART, or via pins. It has been cloned many times on ebay and such, but I tend to prefer to go with the original maker. I see they now have two other versions that have 8MB and 128MB chips instead of a micro-SD card. The DFPlayer can either support a mono speaker (amplifier provided) or stereo line out where you need separate amplification;

If you have pins 10 and 12 available, you can use the MQS sound system. You would need to amplify the sound.

If you have pins 14 and 15 available, you could do S/PDIF output, but I suspect the S/PDIF to audio converter is too much weight. You actually only need pin 14 for output, but I suspect pin 15 may be reserved if you use S/PDIF.

If you want to make a noise, but not necessarily 'talk' to the user, you could always hook up a buzzer to a PWM pin to drive it at various tone levels.

I tend to like this speaker since it contains the amplification circuity:

Before that speaker was available, I tended to use a small breadboard speaker and amplifier (mono or stereo):
 
Last edited:
Thank you very much Michael!

Yes I have several serial ports free still. I had hoped to store .wav files on the micro SD card that the Teensy 4.1 has built in, because I’m already using a card there for flight data and it’s got masses of unused capacity still. Do some of your options let me store data there?
 
Thank you very much Michael!

Yes I have several serial ports free still. I had hoped to store .wav files on the micro SD card that the Teensy 4.1 has built in, because I’m already using a card there for flight data and it’s got masses of unused capacity still. Do some of your options let me store data there?

Not really. The DFPlayers are setup where the microprocessor really doesn't have access to the data. The idea is you hook up the device via USB to your computer, and put songs/sounds on it. And then with the control stream, you say what sound to play. But if you were determined, the Teensy 4.1 does have USB host control. So you could fire up the USB host control, and then mount the filesystem and write to it.

But given you have both a SD card reader already on the 4.1 and the ability to solder a flash memory chip, I don't see the need to try and jury rig something, that likely would be slower than the SD/flash memory option on the Teensy.

The MQS and S/PDIF options are just sound emitters. If you want to play something, you have the RAW/WAV/etc. sound image already on the Teensy, and you would need to read it in to emit the sounds.
 
Status
Not open for further replies.
Back
Top