cancel
Showing results for 
Search instead for 
Did you mean: 

Solution for receiving BT audio and playing stored audio samples

freeflyer
Associate II

I am looking for ST products that will:

  1. Receive bluetooth audio (i.e. from a smart phone)
  2. Play the bluetooth audio through a single minature speaker (mono)
  3. Play stored samples of a voice counting down numbers at intervals based on an external event (if bluetooth audio is being played when the voice sample is triggered, the bluetooth audio will need to be temporarily attenuated)
  4. Read Bosch BME280 pressure sensor (I2C or SPI)

Other requirements are:

  • Small form factor: As an example 56x41x11mm, although this is not fixed so there is room for some flexibility
  • Low power consumption
  • Powered by lithium battery with built in (wired) charging

I prototyped this project many years ago using:

  • Microchip dsPIC33EP256MU806
  • Bluetooth receiver WT32i-A-AI6
  • CODEC (I2S) TLV320AIC32IRHBT
  • Amplifier (for speaker) TPA6120A2DWP
  • Battery charger DS2745U
  • Flash (to store audio samples) S25FL032P0XMFI011
  • Pressure sensor Bosch BMP280

The original prototype was too large and drained the battery too quick (partly due to an assembly/design fault I think)

I am looking to reinstigate this project using the latest devices available, but make it smaller and more effecient.

What ST products are available that could meet these requirements ?

9 REPLIES 9
STTwo-32
ST Employee

Hello @freeflyer @and welcome to the ST Community.

I suggest you have a look at theSTM32WBA64/65 that is a product based on the Cortex-M33 with a flash up to 2MB and with the support of BLE (not classic Bluetooth) +audio capabilities. Also, it is known as a low power power product with different peripherals (SPI, I2C, ADC,…)to connect external devices (external memory, sensors,…).

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank STTwo-32

So the STM32WBA64/65 will receive blue tooth audio from a smartphone.  But what about the additional requirements ?

In my old protoype

  1. The bluetooth receiver (WT32i) received audio from a smartphone and sent the audio to the dSPic via the I2S interface. 
  2. The dSpic then mixed the blue tooth audio with the audio samples (stored on external flash) in real time and the result was sent to the CODEC via the I2S interface. 
  3. The analouge output from the CODEC was then sent to an amplfiier for the speaker

The STM32WBA64/65 does not have I2S interface, so how can the audio be output to an amplifier ?

The stored audio samples are just spoken numbers (e.g. "one", "two").  Ideally I would like these audio samples saved as a compressed format such as mp3.  On my old prototype I have to save them as wav files which took up more memory because I did not know how to decode mp3.  Ideally these samples could be saved on the processor itself so not need external flash.

If I can meet the requirements using less external compoenents than even better.  For example, I only used a CODEC, external flash, I2S interface etc because thats the only way I could get it to work.  If there is a better or alterntive solution I would be interested to know about it.

 

 

 

@freeflyer

The STM32WBA64/65 provide an SAI interface which includes I2S (see RM0515, section 4.3).

Regarding the remaining parts of your target design:

  • Audio compression can be achieved in various ways. Although MP3 has not been patented any longer since 2017, it should share the scarce resources with the Bluetooth stack on the single-core of the STM32WBA. You can find the somewhat less demanding codec SpeeX in the software package X-CUBE-AUDIO-KIT, which may be sufficient for your application?
  • The amplifier could be replaced by e.g. a TDA7266 (AB amp) or a TDA7491LP (D amp)
  • The pressure sensor could be replaced by an LPS33K or an LPS25HB

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks Peter

The amplifiers use an analogue input, so whats the best way to get this analogue signal from the STM32 ? 

In my old prototype I had to use a CODEC which converted I2S (from the dsPIC) to an analogue signal for the amplifier.

Would I still need a CODEC or is there another option ?

STMicroelectronics does not have an amplifier with I2S input, but you are sure to find something from another manufacturer.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

So the STM32WBA64/65 can receive bluetooth audio from a smart phone such as an Apple or Android device ?

But can I also develop my own software on the STM32WBA64/65, whilst keeping the bluetooth functionality ?

I need to read a pressure sensor using an I2C or SPI interface and convert the pressure to an altitude which requires some floating point calculations.

Then depending on the calculated altitidue, I need the audio (music) received via bluetooth to be attenuated and a voice audio sample played to call out the altitude.

Then theres also some algorithms (state machine) to power up the device and control some LEDs.

Im hoping for an all in one solution unlike my previous project.

In my previous project I used the WT32i to receive the bluetooth, then a dsPIC to read the I2S audiio from the WT32i and then I2C to read the pressure sensor, then algorithms to trigger when the voice audio samples need to be called (based on altitude) where the voice audio samples were stored on external flash (in WAV format) which required an SPI interface.

 

 


@freeflyer wrote:

STM32WBA64/65 can receive bluetooth audio from a smart phone such as an Apple or Android device?


Only BLE audio ("Auracast") - not Bluetooth Classic:

https://community.st.com/t5/stm32-mcus-wireless/stm32wba55g-dk1-not-compatible-with-all-mobiles/m-p/700350/highlight/true#M20354

I don't think there are many LE-Audio capable phones on the market yet?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Thanks Andrew

So STM32WBA64/65 is not suitable then?

Is there another bliuetooth module that’s suitable and if possible one that I can add my own code to whilst maintaining the Bluetooth functionality ?

If you are looking to use classic Bleutooth, our STM32 Wireless products does not support such communication.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.