pure tone generation and output to speaker

Status
Not open for further replies.

Hirnwunde

New member
Hey folks,

my goal is to use a Teensy 4.0 to generate simultanious one to three (maybe more if achievable) pure tones and output these to an speaker.
There should be three switches to turning the tones on/off and potentiometers to control the tone height.

Maybe later i will add a display via SPI to show the the states and (k)Hz for each tone.

But ... first of all. Is the Teensy capable to generate three (or more) tones and output these combined to one speaker?

Thank you in advance for your time!
 
Yes, Teensy 4.0 can certainly generate 3 sine waves and mix them in software. You would use the audio library with 3 instance of the waveform synth, and a mixer to combine them.

Getting the signal output to a speaker requires additional hardware. The best way would use the audio shield and an amplifier.

Teensy 4.0 also has an output called MQS (medium quality sound) which creates sequences of pulses. You can buffer those with transistors and drive a speaker, or perhaps drive a very small speaker if done carefully with an extra resistor and capacitor in series. MQS sounds pretty good for casual listening, but because it's made with digital output pulses, it's a compromise in quality.

The audio shield of other audio DAC gives the best output signal.
 
Hey Paul,

thank you for your suggestions/explanations.

Perhaps I should describe in more detail what I have in mind.

I want to stick a mirror on the speaker, which will deflect the light beam of a laser pointer onto a wall (or the ceiling, depending on how you point the laser).

Primarily, I want my children to play around with it a bit and maybe they will want to learn a bit more about sound waves, light and/or electronics.
But I also want to finally give the Teensy, which has been living on my desk for far too long, a task. ;)
Based on the different frequencies or maybe even the voice (via mic) you can draw some nice figures.

I think that even if the quality of the MQS is sufficient, I will probably go for the Audio Shield for the sake of simplicity. (Mic/SDCard)

In another thread, you recommended the LM4871 to a user. This is already available on a small board with the corresponding caps and resistors.
Unfortunately I have little knowledge of the audio world ... but would this amp be enough to drive a 4ohm/20w speaker.
What would happen if i used an 8ohm speaker?

with every new buzzword comes a thousand new questions :rolleyes:
 
Hi Hirnwunde,
sounds like a fun project!

Info on the LM4871 can be found in the datasheet: https://www.ti.com/lit/ds/symlink/lm4871.pdf

As you can see, this chip can drive an 8ohm or 4ohm speaker but only delivers 3W maximum. I'm not sure if this will move your speaker enough for the laser pattern (I guess this depends on the angle and distance?)

To find how how much power you will actually need, you can prototype with a regular stereo amplifier or receiver - feed your teensy audio shield output into the stereo amp and connector speaker and see how loud you have to turn the volume knob up to get the patterns you need and then find an appropriate standalone audio amplifier chip that can deliver that amount of power. Have fun!
 
Perhaps I should describe in more detail what I have in mind.

I want to stick a mirror on the speaker, which will deflect the light beam of a laser pointer onto a wall (or the ceiling, depending on how you point the laser).
I'd worry about the MQS (which has ultrasonic components) perhaps generating visible artifacts for this, but its
worth trying
I think that even if the quality of the MQS is sufficient, I will probably go for the Audio Shield for the sake of simplicity. (Mic/SDCard)

In another thread, you recommended the LM4871 to a user. This is already available on a small board with the corresponding caps and resistors.
Unfortunately I have little knowledge of the audio world ... but would this amp be enough to drive a 4ohm/20w speaker.
What would happen if i used an 8ohm speaker?

with every new buzzword comes a thousand new questions :rolleyes:

20W is a lot, room-fillingly loud, for a continuous tone. Music is very peaky so a 20W system might actually be running at
an average less than 1W, with the headroom only needed for the peaks and transients.

I suspect you are wanting a large excursion of the speaker to provide large mirror deflection, which is more a case of
driving the speaker at/near its resonant frequency, and at low frequency anyway (displacement goes down as frequency
goes up with sound).

Speakers vary in their sensitivity too - choosing a sensitive speaker will give more displacement for a given power, all
else being equal.
 
Hi! I'm a laser artist, here to learn about the Teensy audio library in preparation towards building my own midi laser control desk, using Teensy. I played around with HeNe lasers and small mirrors on speakers back in ~1978. You can simply connect the Teensy audio output to the 'aux in' of any amp.
But be very careful with laser beams around kids. Lasers can blind, if shown directly into eyes. I suggest putting the speakers inside a box with a hole to limit the beam path and make sure that everyone is positioned on the opposite side of the box.
Having said that, you're onto a fun project, once you're to the point of generating waveforms with the Teensy. At that point, I suggest that you kick up th fun factor with some real X/Y galvanometers, like these inexpensive ones.

https://www.ebay.com/itm/262375347000?_trkparms=amclksrc%3DITM%26aid%3D1110006%26algo%3DHOMESPLICE.SIM%26ao%3D1%26asc%3D20200818143230%26meid%3D51c3e645a33048cc902e53d0c265f6bf%26pid%3D101224%26rk%3D1%26rkt%3D5%26sd%3D264723774855%26itm%3D262375347000%26pmt%3D1%26noa%3D1%26pg%3D2047675%26algv%3DDefaultOrganicWeb&_trksid=p2047675.c101224.m-1
There are also RGB laser diode modules, which only require 3 voltage levels to produce full color imagery.
Hope this helps to kick you off to a great fun project for 2022.��
 
Status
Not open for further replies.
Back
Top