Model Boat Mayhem

Please login or register.

Login with username, password and session length.
Pages: [1]   Go Down

Author Topic: Arduino Sound System  (Read 1031 times)

DJW

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 380
  • Location: London
Arduino Sound System
« on: December 17, 2020, 04:49:08 pm »

Afternoon All


I've been looking around for a compact and capable sound system for my Riva Aquarama build.  So lightweight, small form factor, able to utilise an engine startup, and a proportional engine running sound.  I've tried a couple of off the shelf units but am frustrated by the lack of control.


So I've found this: [size=78%]https://github.com/TheDIYGuy999/Rc_Engine_Sound[/size]


And I wondered whether anyone has any experience with it..?


Best regards
David.

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 991
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: Arduino Sound System
« Reply #1 on: December 17, 2020, 07:21:16 pm »

Yes I have used this.

The sounds are amazing when you consider the investment - less than 10-15 excluding a speaker but including an amp.

It uses an 8bit DAC so the sound is a bit thin in places with some odd sonic artifacts - I am working on something along the same line but with a 12 bit DAC - sound is head turning, super rich.

The software this guy has written is pretty complex but you don't need to understand it - just how to use it in your project

To use you need to be able to compile and then upload some code to a little board called and "esp32" - all using freely available tools

PM me if you would like specific help
PS What sound boards have you tried so far?

Regards

C-3PO


If anybody wants to hear the type of sound - check this out this video

https://www.youtube.com/watch?v=KnSSUgjbCdg
or
https://www.youtube.com/watch?v=KnSSUgjbCdg
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

DJW

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 380
  • Location: London
Re: Arduino Sound System
« Reply #2 on: December 18, 2020, 11:10:26 am »

Hi 3PO


Thanks for this.


I've looked at the Model Radio Workshop 'Petrol Motor Sound Generator', but its a synthesised sound with a limited number of cylinders, not really what I need for the deep rumble of twin V8s in a Riva.  Then I tried the Mtronics system, gives a startup and a running sound, better but engine sound has a delay and is very sensitive to throttle so its idle.. idle... then a frantic engine racing.  And not adjustable in any way except volume.


So the solution I'm looking at is actually the earlier version that does not use the ESP32, its Arduino Pro Mini based, uses a PAM8403 as the amplifier, and I'm using an MP1854 to get the voltage down to 5V:





I've just added some header pins to start testing.


There a video illustrating the sound for this build here: [size=78%]https://www.youtube.com/watch?v=pPlrx9yVI6E&t[/size]


I know he's moved on to the improved ESP32 version, but I don't really need all those features yet.


My speaker is built in at the bow of my Aquarama, I'm hoping to use the cabin to enhance the sound, make it deeper with some resonance.



 



I'm not into the programming of the Arduino, but as you say I don't really need to be to use it.  I do like the fact that various parameters can be adjusted in config files, and it's possible to use custom sounds. I've extracted the startup and running samples from a full sized Aquarama, then used a bin2hex tool to generate the correct format.  The Arduino has such limited memory its tricky to get the sound files small enough.  I'll get it put together on the bench and see what happens...


If this goes well maybe the ESP version next time, I'm thinking that as that version supports multiple sound streams concurrently it would be possible to run two engine streams with slight config timing changes so they resonate at different points, as the real engines do.


Will keep you updated.


Best regards
David.

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 991
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: Arduino Sound System
« Reply #3 on: December 18, 2020, 03:18:09 pm »

Hi David,

Looks like you have it sussed!

The ESP32 is a very different beast to the Nano and more than likely cheaper as well. But biggest benefit is memory and 2 channel DAC facility ) oh and WiFi and BlueTooth & & & & :)

Worst thing about ESP32 is getting the computer environment ready to allow you to use it - done this a few times one of which left me scratching my head for hours as it simply did not work...

The ESP32 has 2 DAC channels - by memory the solution written by TheDIYGuy999 puts 3 sources of sound to each channel.

Never thought it was as easy as just doing maths on the encoded sound (hex) files and then outputting the result to the DAC - quite a revalation

Look foward to your update

Regards
C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

DJW

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 380
  • Location: London
Re: Arduino Sound System
« Reply #4 on: December 22, 2020, 05:56:26 pm »

Hi 3PO (and All)


First test today...  And instantly fried an amplifier... Put 7v through it rather than 5v...


Luckily as you say they're cheap and sold in packs so I tweaked the voltage and put another Amplifier together.


And now it works: https://youtu.be/oDKfcFO7rvw


I've now got to look at the curves.h file to try to setup the throttle curve, and the speed multiplier to get it 'running' a little faster, but quite pleased that its already outputting an actual Aquarama V8 start up, idle and run sound.  Instant throttle response, so already ahead of the MRW and Mtroniks hardware already.


 :-))


Best regards
David.

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 991
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: Arduino Sound System
« Reply #5 on: December 22, 2020, 07:42:41 pm »

Hi David,

Nice job - and as you say a lot of bang for your buck!

Releasing the magic black smoke from components is all part of the journey... overall I am sure you have found this a rewarding project.

I have some digitised Riva engine sounds - would Riva engines be the same as the Aquarama?

Regards
C-3PO

Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

DJW

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 380
  • Location: London
Re: Arduino Sound System
« Reply #6 on: December 23, 2020, 07:36:31 am »

Morning 3PO


Thats a kind offer re the sound files. The Aquarama uses 2x V8 petrol engines, so if you have some good samples I'd love to see (hear) them. I need the startup and idle.


You're probably aware, but for anyone who isn't, this project needs two sound files, a 1 second max startup sound, then a single engine cycle at idle. This cycle in particular needs editing so that the signal is visually analysed then edited to start and end at the same mid level point, and wave direction. This avoids any clicking when played back end to end continuously. My sample was around 1/3 of a second. The startup file i have had to be edited for length to keep to 1 second. The Arduino pro mini has 32kb of memory overall...


3PO, I'll PM my email address.


Good day to all.
David.

plastic

  • Full Mayhemer
  • *****
  • Online Online
  • Posts: 1,251
  • Bobbing Along!
  • Location: Watford
Re: Arduino Sound System
« Reply #7 on: December 23, 2020, 07:56:21 am »

I think the biggest problem with all these sound systems is the naff speaker that can't reproduce the grunty, low frequencies you really want to hear from big, powerful engines.

Given that these are going in a large-ish boat, has anyone tried turning the whole hull into a ported sub-woofer?    There's normally loads of space buoyancy and all it would require is beefing up the materials for dampening the rattles and some acoustic wadding and a proper class D amp & better speaker.     

I used to play with 8-bit sampling and you can get some really good quality sounds - especially if you can dump the higher frequencies.
Logged

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 991
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: Arduino Sound System
« Reply #8 on: December 23, 2020, 08:12:49 am »

Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

tonyH

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,784
  • Model Boat Mayhem Forum is the Best!
  • Location: Suffolk, England
Re: Arduino Sound System
« Reply #9 on: December 23, 2020, 12:47:17 pm »

Logged

DJW

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 380
  • Location: London
Re: Arduino Sound System
« Reply #10 on: February 26, 2021, 06:04:58 pm »

Evening All


By way of an update, the sound system us up and running, now looks like this:








Additional board is an MP1854en thats dropping 3C lipo voltage down to 5V for the Arduino Pro Mini and the Amplifier.


Running one conventional speaker, and one 3w Audio Exciter...





The Exciter is not fully installed yet, but current sound is on this video at timecode 4.50


https://www.youtube.com/watch?v=Rj3ynymx54Y


Best regards to all.
David.

Martin [Admin]

  • Administrator
  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 20,635
  • Location: Peterborough, UK
    • Model Boat Mayhem
Re: Arduino Sound System
« Reply #11 on: February 26, 2021, 07:48:29 pm »


WoW!   :o
Logged
"This is my firm opinion, but what do I know?!"    -   Mayhem FaceBook Group!
Pages: [1]   Go Up