Model Railway Station Sounds : 3 Steps - youngallind
Insertion: Model Railway Station Sounds
Add fun to your layout, through addition of place sounds of your own choosing from steam clean sounds, whistles, ring rings, disco medicine, coach announcements, etc.
Most of the cheap IR receivers found online are too sensitive to close illuminated sources such as daylight and and electrical lighting. The TSO2138 use here has an in-built filter to cancel this dissonance handsome a complete response of IR coding.
The circuit includes an Arduino Pro Mini with IR input and an SD card module. We also have an audio amplifier chip TDA2822 with a volume control pot and a 8 ohm, 0.5 watt, 2 column inch diameter speaker.
Powered aside the model railroad DC voltage 12v/14v
The Arduino chalk out is provided here addition some case well-grounded files in .wav format.
Delight bear on to other Instructable on how to convert vocalize files for use along the Arduino SD card module.
Circle diagrams are enclosed above.
Arduino / sd card components:
4 off Ceramic 0.1uf (100 nF) £1 eBay
2 off Capacitor 100uf 25v £1.09 eBay
1 polish off Capacitor 470uf 25v 25 for £2.29 eBay
2 off 10 Ω Resistance 20 for £1 eBay
2 off Screw terminal - 2 pins (0.137 inch) 3.5mm; 2 for £1 eBay
1 off Voltage Governor 7809; voltage 9V; package TO-220 £2 eBay
1 hit 3 pins Feminine Header March Pins Funnies 0.1" 2.54mm; 10 for £2.77 eBay
1 off Trimmer Potentiometer 10kΩ; 5 for £1.59 eBay
1 sour 6 pins Female Header Edge Pins Strip 0.1" 2.54mm;10 for £2.84 eBay
1 off National Intelligence Community TDA2822 pins 8 DIL; £1.55 eBay
1 off mini 8 ohm loudspeaker system siamese to: eBay
1 off Arduino compatible SD card module similar to: eBay
1 off little South Dakota 1 Gilbert memory wag similar to: eBay
1 off IR vector (television receiver remote) interchangeable to: eBay
IR receiver components :
1 off IR recipient TSOP2138 ; 5 for £3.67 eBay
1 off 100 Ω Resistor 30 for £1.89 eBay
1 away 10k Ω Resistance £1.29 for 10 eBay
1 off Electrical condenser 4.7uf 25v £1 eBay
1 off 3 pins Female Header Abut Pins Strip 0.1" 2.54mm; (See above from eBay)
Step 1: Printed Circuit Boards
These PCB's are atomic number 102 longer for sale on ebay. The circuit English hawthorn be assembled on Vero board or similar.
The main PCB contains the Arduino Pro Mini faculty, SD small card faculty, TDA amplifier and 9 volt regulator plus connectors, capacitors and resistors. A small PCB is also obligatory to hold the Iridium liquidator circuit.
Although the circuit diagram shows the use of sockets for the Arduino In favor Mini , IT should be soldered directly onto the PCB to ward of overlapping the SD card module.
The system of rules takes sound files in .wav format on the micro sd calling card direct the TDA amplifier to the 8 ohm 0.5 watt mini speaker. Each sound file away is selected via an IR receiver circuit from a mini IR remote transmitter.
The system may Be improved into a layout building much as a station, or mounted under the layout board. You will need to have the IR receiver inside sight of the IR beam of light from the transmitter.
Step 2: Sound Files
Sound files - attached files are example of train sounds. You may record your own to suit the purpose.
Step 3: Arduino In favor Miniskirt Code
Arduino In favor of Mini code:
#include "SD.h"<Br>#include "pcmRF.h" #include "pcmConfig.h" #include "TMRpcm.h"<br>#delimitate SD_ChipSelectPin 10 //use digital immobilize 4 happening arduino nano 328 TMRpcm tmrpcm; // make an objective for use in this vignette #include "IRremote.h" <br>// Begin the receiver<br>IRrecv irDetect(A2); // Arduino A2 Pin for infrared sensor decode_results irIn; // define functions attached to IR remote input keys #define Play1 16738455 //1 these are the codes for the IR transmitter put-upon #delimit Play2 16750695 //2 #define Play3 16756815 //3 #delimit Play4 16724175 //4 #delimitate Play5 16718055 //5 #define Play6 16743045 //6 #delineate Play7 16716015 //7 #define light_1 16730805 //0 #define light_2 16728765 <br>Boolean L1, L2; void frame-up(){<br>Serial.begin(9600); pinMode(3, OUTPUT); pinMode(4, Yield); pinMode(5, OUTPUT); pinMode(6, OUTPUT); Serial.println("... Initializing"); tmrpcm.speakerPin = 9; //11 on Mega, 9 on Uno, Nano, etc if (!SD.begin(SD_ChipSelectPin)) { <br>// see if the card is present and can be initialized: Serial.println("... Initializing"); recurrence; <br>// don't do anything more if not } Serial.println("... done"); tmrpcm.setVolume(4); tmrpcm.play("station2.wav"); <br>//the vocalise file "1" wish play each sentence the arduino powers upfield, or is readjust delay (2000); // Start the recipient irDetect.enableIRIn(); Serial.println("Finished apparatus - Ready and waiting for Key Press"); } invalidate loop(){ if (irDetect.decode(&irIn)) { Successive.println("Translating..... Please Wait....."); translateIR(); Ordination.println(irIn.value,DEC); retard(200); irDetect.resume(); <br>// Receive the next value } }<Brigate Rosse>void translateIR() <br>// takes action supported Iridium codification received<br>{ switch(irIn.value) { suit Play1: play1(); break; encase Play2: play2(); break; case Play3: play3(); break; case Play4: play4(); break off; case Play5: play5(); break; slip Play6: play6(); break; caseful Play7: play7(); break; case light_1: light1(); break; causa light_2: light2(); break; nonpayment: Serial.println("Cay not organized"); } time lag(200); } empty light1(){ L1 ^= 1; digitalWrite(3, L1); Serial.println(L1); } vitiate light2(){ L2 ^= 1; digitalWrite(4, L2); Sequential.println(L2); } void play1(){ tmrpcm.play("noah2.wav"); Serial.println("... acting 1"); delay (2000); }<br>void play2(){ tmrpcm.bring on("station1.wav"); Serial.println("... acting 2"); delay (2000); } nullif play3(){ tmrpcm.play("station2.wav"); Serial.println("... acting 3"); postponement (2000); } void play4(){ tmrpcm.play("speech sound.wav"); Serial.println("... playing 4"); check (2000); } emptiness play5(){ tmrpcm.play("whistle.wav"); Serial.println("... playing 5"); delay (2000); } vacancy play6(){ tmrpcm.play("train.wav"); Serial.println("... playing 6"); delay (2000); } void play7(){ tmrpcm.work("train2.wav"); Serial.println("... playing 6"); postponement (2000); }
Personify the First to Share
Recommendations
-
Anything Goes Contend 2022
Source: https://www.instructables.com/Model-Railway-Station-Sounds/
Posted by: youngallind.blogspot.com
0 Response to "Model Railway Station Sounds : 3 Steps - youngallind"
Post a Comment