45 MP3 sound decoder v4

 

1.Summary
A realise the MP3 player using the MicroSD in the size of the N-Gage.
Compact than the previous version. Further added the ability of the motor decoder.

2. Features
MP3 decoder
・Size 67mmx14.5mm
・Correspondence from F0 to F28 in the function of DCC
・Capacity of the memory cards is up to 32GB
・Quantity of high-pitched tone power-saving by D-class amplifier Built in
・Repeat reproduction is possible by a command
・I use a regulator IC for cost reduction(Switching power supply available as an option)
3.Composition

4.Circuit diagram

 
A PDF version is this
5.Artwork

Artwork

 

6.Description of the circuit board

7.Sketching


Download sketch
Sketch file (I download it by a right-click)   Ver Remarks  Update
 MP3V4b  04b First edition  2016/09/18
 MP3V4c  04c Parameter change of Motor ACK (6 ms -> 10 ms)
Description of Manufacture ID (108: nagoden)
 2017/01/29
・DCC library of NMRA is necessary for this sketching
・Hardware is based on the SmileDecoderR4's Desktopstation.
 Please use this for library also NMRA DCC Library 2014-10-15 edition. (DesktopStation site)
・DFPlayer_Mini_Mp3 library for MP3 reproduction is necessary.

Writing is not required, so we have shipped confirmed the operation in a state in which the written
latest sketch for distribution products.
Modified with self-responsibility is the free.
If you can not resolve on their own, those who Arduino do not know, you can hope that not written
in a smile writer.

8.CV setting


CV# Explanation Range Initial value
1 Two columns of addresses 0-127 3
2 The start voltage 0-255 20
3 Acceleration rate 0-30 16
4 Slowdown rate 0-30 16
5 The most high voltage 0-255 255
7 Version ID
8 I reset it by writing in decoder reset 1
CV read returns ManufactureID (108) (Version 04c later)
17 Four columns of addresses are higher
18 Four columns of addresses are lower
29 Configuration Register 2
30 Function mode0: Motor 1: OFF 2: Polarity headlight 0-2 0
54 BEMF coefficient 0-9 3
55 It is 1 time in PI_P 8d. that the initial value doubles 32d 
4. When I come very much and do it,
responsiveness improves, but is trembling when I raise it too high.
32
56 It is 1sec in PI_I 32d. The initial value is 16d(0.5sec).
The responsiveness worsens when I raise it, but works gently.
16
57 When set BEMFCUTOFF 0, is BEMF invalidity, 1 or more; BEMFOn 0-1 0
58 MP3 Master Volume (when an audio breaks off, please lower a volume level) 0-30 28
110 0 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction
CV30 set 1 at the time of 2 (polarity headlight)
0-2 0
111 1 MP3 function function 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 0
112 2 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
113 3 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
114 4 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
115 5 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
116 6 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
117 7 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
118 8 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
119 9 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
120 10 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
121 11 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
122 12 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
123 13 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
124 14 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
125 15 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
126 16 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
127 17 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
128 18 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
129 19 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
130 20 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
131 21 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
132 22 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
133 23 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
134 24 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
135 25 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
136 26 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
137 27 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1
138 28 MP3 function functions 0: OFF 1: Single reproduction 2: Repeat reproduction 0-2 1


The reading of CV is possible with a direct mode.
Is possible with the Page mode, but recommends a direct mode.
Reading may not go well when do not connect load to the terminal of the motor.

9.Writing of the MP3 file to the MicroSD card

The MicroSD card, please use the 32GB following.

Format of the MicroSD card

Case 2GB below will choose the"FAT" in the "file system".
If following the larger 32GB than 2GB is required format in FAT32.

            

After having formatted, make a directory (folder) MP3 from a PC..
  case of do not work when make plural folders.
.

Function Number and file name is linked.

Like the F1 → 0001.mp3 ~ F28 → 0028.mp3
Please put the file in the folder you created.

Write order does not matter.
10.KeepAlive capacitor
It is difficult to stably output the sound during driving.
Should be always the rails and the wheels keep kept in good condition.
Moment from the rail with a slight vibration and movement, but you may want to contact loss.
In the electronic device equipped with a microcomputer, it will be not function a very slight momentary expires.
For this reason, it has maintained its functions correctly by backing up in the capacitor and the battery in the circuit of the equipment.
For alleviate this, to back up the power supply by adding a large in the electrolytic capacitor of the little capacity of KeepArive capacitors with an external board, to prevent a power failure caused by the moment away line.

 

Please connect with the terminal for the KeepArive capacitor of the circuit board.
The side where there is a described as a "+" on the circuit board will be the + side of the capacitor.
11.Implementation to a vehicle
The width of the board is 14.5mm breadth of the N gauge,
but concerning the structure of the body head and the vehicle in the vehicle of some makers,

There is a vehicle having difficult implementation.
Please implement it after enough examination in implementation.
I will recommend the implementation to the vehicle which it is easy to implemented..

In the case of Meitetsu 6000 Series in MicroAce 
Make sure the unit will fit.(the board is different from a real board in a trial product)
The board width assumes it 14.5mm in a design.
When it is hard, not to cut a print pattern; the width of the boardI adjust it. Match the body with a floor board in this state,
It is properlyI confirm whether it is a circle. The seat parts which a floor board has concerning heightIt is necessary to exclude .
I attach KeepArive condenser next. The photograph implements it without attaching resistance + diodeBut, of the apparatus
I recommend that I soak resistance + diode for the protection.
 

Processing (when necessary) of the floor board

Work such as processing a floor board because I may not enter the body may be necessary for the size of the speaker.
Because the volume of sound changes in size and enclosure presence,
I examine the speaker by each person, and, please implement it.
(please use an optional speaker)


 
If the body and a floor board are settled well, it is implementation completion.
12.Attention
1. When used in combination with the motor, it may motor driver and diode bridge becomes hot by the current
  consumption of the motor.
2. CV read-write of and make sure that it works in the current consumption of the bridge driver.
  If the motor terminal there is no load you may not be able to read and write CV.
  In this case, it allows you to read and write by connecting such as resistors and LED to the motor terminals.
3. Speaker terminal Please do not short-circuit. (D-class amplifier PAM8408 will be damaged)
4. Regulator IC of the power section will have a fever, but this is not a fault.
  However, the case is a high temperature of about not touch under no load, there is a possibility that failure
   in some kind of reason.
  In this case, please discontinue use because the continued use is dangerous.
  If you heat generation is a concern, it is recommended that you replace the option of switching power supply.
5. MicroSD is Correspondence with the following SDHC 32GB
  MicroSD card is 2GB or less FAT16,32GB following is required format in FAT32.
6. MP3 files, in some cases it may not be able to play.
  Sample has been supported by the MP3 chip (YX-5200) rate is 8 / 11.025 / 12/16 / 22.05 / 24/32 / 44.1 / 48KHz.
7. For MP3 sound source
  For the source of the MP3 of the sound source, we have developed on the premise for you to use the sound
   of their own preference.
  This site does not do me of the sound source.
13.Reference site
DesktopStation      http://desktopstation.net/index_jp.html
WebNucky         http://web.nucky.jp/
Fujigaya2 blog      http://fujigaya2.blog.so-net.ne.jp/
DCC Pavilion       http: //1st.geocities.jp/dcc_digital/

nagoden homepage     http://www007.upp.so-net.ne.jp/nagoden/  (japanese only) 
Blog                 http://nagoden-diary.blog.so-net.ne.jp/


Copyright (c) Nagoden http://www007.upp.so-net.ne.jp/nagoden/