Go Down

Topic: Sound diesel engine module for RC Truck (Read 9670 times) previous topic - next topic

Jul 26, 2013, 02:49 am Last Edit: Jul 27, 2013, 06:54 pm by renatortb Reason: 1
Hello everybody, I'm passionate about the world of radio controlled model car (RC). Since I entered this world, turns and moves, I ran into Arduino as a way of completing tasks for the RC. Therefore my interest in this platform was born when I realized that I could do many things with the Arduino to make RC more exciting. However, I'm a doctor, and my education has nothing to do with this type of technology. Nevertheless, I have strived to learn how to work with Arduino, but i still do not understand very much. So I come to ask you some help with a project.

The RC cars that i control are electric and the scale type, ie, they try to represent the real cars. One of the cool things that you can do in scale is to put a sound module that mimics the sound of the engine. This brings much realism to the car and let the RC more fun. Look how cool is this:
http://www.youtube.com/watch?v=17MyR9oSXHQ
http://www.youtube.com/watch?v=IPZ3YgaqmlM
http://www.youtube.com/watch?v=Fh1wUoFMXCc

In the international market there are already some options, not in arduino, of sound modules that mimic engines, some even have built-in modules for controlling LEDs and smoke system, but they are extremely expensive. Check out some of them:
http://benedini.de/ (For me this is the best. has a very good sound, totally customizable by software, and includes a controller smoke part, but it is expensive).
http://www.beier-electronic.de/ (very good too, but too expensive).
http://www.modelsoundsinc.com/ (Same from above).
https://www.tamiyausa.com/product/item.php?product-id=56511 (Not as good as it is not customizable, features a built-in controller LEDs, but is extremely expensive. Overpriced even!).
http://www.technobotsonline.com/light-and-sound-effects/model-engine-sound-effects.html (Until it is very cheap, the sound is not good enough).
http://www.ramrcandramtrack.com/ (Very cheap, but the sound is crap).

As you can see, we got stuck in international solutions that are very expensive, often even impossible to buy. So I ask for your help in building a sound module based on the arduino to simulate engines to the world of RC Scale. Even further, still with your help, I want to build a good tutorial showing step by step how to build such a module, for we all can have a good and afordable sound module for RC scale. I intend to buy all the parts on dealextreme, since there is cheap and a lot of people already know how to buy ...

Searching the internet for a sound module made with arduino, i found one guy from Czech that had already done something similar. Check out:
http://www.youtube.com/watch?v=HkopwvHJPwA
All I could get of this project is that he used the Arduino Nano with a AD converter and an amplifier. But I do not know Arduino very much and I can not imagine how to proceed from here ...

So I count on the help of this arduino community to make possible this project

Since now very grateful for all help.

EDIT: i found more infromation of the David module:
http://translate.google.com.br/translate?hl=pt-BR&sl=cs&tl=en&u=http%3A%2F%2Fforum.rctrucktrial.cz%2Fviewtopic.php%3Ff%3D28%26t%3D377%26sid%3D2122a921df4d787b71ce733fd598d710%26start%3D140
http://tatraportal.com/drracer/t130/20130314_233923.jpg
http://tatraportal.com/drracer/t130/20130314_233946.jpg
http://tatraportal.com/drracer/t130/P4270690.jpg
http://tatraportal.com/drracer/t130/P4250187.jpg
http://tatraportal.com/drracer/t130/P4250181.jpg
"From a technical point of view this is a very simple hardware - Arduino Nano with AD converter and amplifier - at today's level of integrated circuits very simple. Hardware I bought apospojoval. So far it Tatra riding the back of the box, the target solution will be much greater than Arduino Nano itself.
After the software is much more interesting, but the implementation details I will leave as a trade secret, but you should know that from the first idea to the realization of this prototype passed a year and a half and it completely on my work (all I had conceived, programmed and odladil) only with the use of library functions to control servos from the Arduino .. Do speaker goes 16bit 11kHz audio created in real-time software simulator engine. The input is a PWM (pulse width modulation) "gas" and "shift" from the receiver. The output of the PWM controller to the engine and the sound of the speaker, that's all."
It seems that he want to sell his module... But we can do something similar to that he made.

Heidak

I want to do the same but for the use in a shovel. I was thinking of using a low cost WTv020-SD-16 with my Arduino. I want to create some different sound files which are played based on acceleration. It would also be possible to make a soundfile for the shifting sound.

You can use a  8 Ohm speaker directly attached to the sound chip. This is also a very low cost solution.

Did you also evaluate this concept?

Hello, i didn't think this. But maybe it works. I'm learning arduino yet, i don't understand very much.
Thank you for your reply!

skoubri

Hi, have you done any progress ? I am also there by using the SD play library but still someproblems with PWM reading..

andrezan

#4
Jun 08, 2014, 10:49 pm Last Edit: Jun 09, 2014, 07:13 pm by andrezan Reason: 1
I'm also trying to develop a similar module; Been successful so far using the above mentioned technique;

http://www.youtube.com/watch?v=Z_BBQcF91yo

Code: [Select]

/*
 SDCard Play Engine sounds;
 Andre Zanelatto
Example based FROM:  Stereo doorbell example, created 23 Jan 2013 by Lutz Lisseck
Need SD card properly connected with files idle.wav, start.wav, rev_700.wav and stop.wav in root folder.
Connect button between pin 3 and GND. (Start/stop)
Connect button between pin 2 and GND. (Reverse)
Audio out on 9/10 @ Normal-Arduinos, pin 44/45 @ Mega-Arduinos
*/
#include <SimpleSDAudio.h>
#define BUTTON  3
#define rBUTTON  2

boolean engine_on = false;

void setup()
{
 // SdPlay.setSDCSPin(10); // Enable if your SD card CS-Pin is not at Pin 4...
 SdPlay.init(SSDA_MODE_HALFRATE | SSDA_MODE_STEREO | SSDA_MODE_AUTOWORKER);
 pinMode(BUTTON, INPUT_PULLUP);
 pinMode(rBUTTON, INPUT_PULLUP);
}

void loop(void) {
 // Wait until button is pressed
if (!engine_on) {
 while((digitalRead(BUTTON) == LOW) && (digitalRead(rBUTTON) == HIGH)) {
 engine_on = true;
   SdPlay.setFile("start.wav");
   SdPlay.play();
  delay(2200);}
}
else if ((digitalRead(BUTTON) == HIGH) && (digitalRead(rBUTTON) == HIGH) && (engine_on)) {
   SdPlay.setFile("idle.wav");
   SdPlay.play();
      while((!SdPlay.isStopped()) && (digitalRead(BUTTON) == HIGH) && (digitalRead(rBUTTON) == HIGH))  {
     SdPlay.worker();
   }
}
else if ((digitalRead(BUTTON) == LOW) && (digitalRead(rBUTTON) == HIGH) && (engine_on)) {
      SdPlay.setFile("stop.wav");
     engine_on = false;
   SdPlay.play();
      while(!SdPlay.isStopped()) {
     SdPlay.worker();
   }
}
 else if ((digitalRead(BUTTON) == HIGH) && (digitalRead(rBUTTON) == LOW) && (engine_on)) {
      SdPlay.setFile("rev_700.wav");
   SdPlay.play();
      while((!SdPlay.isStopped()) && (digitalRead(rBUTTON) == LOW)) {
     SdPlay.worker();
   }
}
}


Now i'm probably switching to another library since it shows some advanced features to play multiple files simultaneously and asynchronously which would free up arduino to process other stuff such as lights.

However, i believe i've hit a "roadbock" using SDAudio, which is changing the "pitch" for the engine.
I have all the sound files with engine revving at different rpm, but playing each one, just doesn't seem to have a good effect, i would rather have a smooth sound as engine rpm increases, so changing pitch for a single file, would be better;

Anyone has made progress? Any suggestions?

Go Up