users:dagnall53:hardware
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
users:dagnall53:hardware [2019/02/14 12:45] – dagnall53 | users:dagnall53:hardware [2019/02/17 13:05] – [MOBILE DECODER -WEMOS MINI] dagnall53 | ||
---|---|---|---|
Line 17: | Line 17: | ||
- | The [[https:// | + | {{: |
- | This includes the NodeMCU and WeMOS mini modules: | + | This includes the NodeMCU and WeMOS mini modules:\\ |
- | + | ||
- | {{: | + | |
The NodeMCU module is on the left, and is fitted in a " | The NodeMCU module is on the left, and is fitted in a " | ||
The Wemos Mini is a smaller equivalent to the NODEMCU, and is shown right, Note both have the same " | The Wemos Mini is a smaller equivalent to the NODEMCU, and is shown right, Note both have the same " | ||
- | The smaller board by the WEMOS Mini is an ADAfruit MAX 98357 board that is one option for the audio output. | + | Also shown are some optins for the Audio. |
Below the NodeMCU is a 3D printed housing for the Hall effect switch that is used for sensing trains. | Below the NodeMCU is a 3D printed housing for the Hall effect switch that is used for sensing trains. | ||
The 3d file for this is included in my thingyverse item: [[https:// | The 3d file for this is included in my thingyverse item: [[https:// | ||
Line 30: | Line 27: | ||
===== Stationary Decoder ===== | ===== Stationary Decoder ===== | ||
The NodeMCU Motor Shield is very useful as the basis of a stationary decoder because it provides a Servo like three pin connection for each " | The NodeMCU Motor Shield is very useful as the basis of a stationary decoder because it provides a Servo like three pin connection for each " | ||
- | This allows simple connection of hall effect switches or servos. However, the Central V+ rail of these pinouts is connected as standard to the NodeMCU 3.3V supply, which is not suitable for driving most servos. | + | This allows simple connection of hall effect switches or servos.\\ |
- | To overcome this I would recommend | + | However, the Central |
- | Then disconnect the 3.3v drive to the connection rail by cutting the single track on the rear of the board. You can then connect the 5V power (on Vin) to the (cut) 3v3 rail on the line oof pins by adding a link jumper to the " | + | |
+ | To overcome this I would recommend | ||
+ | - Disconnect the NodeMCU 3v3 drive from Motor Shield. This can be done by cutting the track on the back of the board (see photo), OR by cutting the 3V3 pin on the NodeCU board situated between " | ||
+ | - Then connect | ||
+ | - Lastly | ||
+ | |||
+ | {{: | ||
+ | |||
- | {{: | + | {{: |
The motor shield is designed to allow you to use the inbuilt " | The motor shield is designed to allow you to use the inbuilt " | ||
- | These are connected to the D1-D3 and D2-D4 pins, which will need to be set up as outputs on the ESP module (and as PWM if you like). | + | These are connected to the D1-D3 and D2-D4 pins, which will need to be set up as outputs on the ESP module (and as PWM if you like).\\ |
- | + | ||
+ | ---- | ||
However please note that the 293 on the shield is NOT connected as four independent half bridges, but as a " | However please note that the 293 on the shield is NOT connected as four independent half bridges, but as a " | ||
- | This means that the board can drive **only** two motors or two lights, and not four lights that would be possible if it did not include these inverters. | + | This means that the board can drive **only** two motors or two lights, and not four lights that would be possible if it did not include these inverters. |
+ | |||
+ | ---- | ||
+ | A note on NodeMCU Modules: Most NodeMCU modules are 26mm wide and fit the Motor Shield perfectly. However, the " | ||
===== Mobile Decoder and Sound ===== | ===== Mobile Decoder and Sound ===== | ||
Line 48: | Line 57: | ||
There are two options to get sound. | There are two options to get sound. | ||
- | The first uses the AdaFruit MAX98357 which provides | + | The simplest is to use the definition **_AudioNODAC**. |
+ | |||
+ | This creates a Class D amplifier output stage that uses " | ||
+ | * I2SDAC_DIN drives the transistor base | ||
+ | * I2SDAC_LRC is LRC or i2s clock (?). | ||
+ | |||
+ | In this configuration I2SDAC_LRC is initially set as a clock output, but it can be re-used once the DAC has been setup.\\ | ||
+ | I recommend placing | ||
+ | This ensues that the serial programming is still possible. | ||
+ | The transistor collector is connected to the loudspeaker and the emitter to ground. The Loudspeaker is connected to the collector and V+. An electrolytic across V+ to Gnd is recommended to support | ||
- | This board needs the _AudioDAC definition set, and then uses these connections : | + | The "high quality" |
+ | This board needs | ||
* I2SDAC_DIN 9 D9(/rx) Data | * I2SDAC_DIN 9 D9(/rx) Data | ||
Line 56: | Line 75: | ||
* I2SDAC_CLK 8 D8 used by DAC as clock. | * I2SDAC_CLK 8 D8 used by DAC as clock. | ||
- | The alternative is to use the definition _AudioNODAC. | ||
- | |||
- | This creates a Class D amplifier output stage that uses D9/RX to drive a transistor base that then drives the loudspeaker. | ||
- | * I2SDAC_DIN 9 D9/rx (data) used to drive transistor base | ||
- | * I2SDAC_LRC 4 D4 used as LRC or i2s clock (?) | ||
- | In this configuration D4 is initially set as a clock output, but it can be resused once the DAC has been setup although my code currently does not do this. | ||
- | I recommend placing | ||
- | The transistor collector is connected to the loudspeaker and the emitter to ground. The Loudpseaker is connected to the collector and V+. An electrolytic across V+ to Gnd is recommended to support the high pulse currents. | ||
- | The " | ||
===== MOBILE DECODER -WEMOS MINI ===== | ===== MOBILE DECODER -WEMOS MINI ===== | ||
- | One mobile sound decoder configuration is to use the WEMOS mini with a RC servo dc motor controller and the Adafruit DAC. | + | {{: |
- | + | ||
- | {{: | + | |
- | In this configuration, | + | ---- |
- | The Code can also be used to drive a PWM motor control directly, in which case the RC DC motor controller is replaced by a motor shield with the 293 chip or (much better!) a TB6612FNG Dual DC Stepper Motor Drive Controller Board Module. | + | {{: |
The TB6612 has MOS drivers so does not have the losses of the bipolar 293, and I found it runs cool driving my loco motors, where the 293 gets hot. BUT!. | The TB6612 has MOS drivers so does not have the losses of the bipolar 293, and I found it runs cool driving my loco motors, where the 293 gets hot. BUT!. | ||
Line 87: | Line 95: | ||
- | The illustration | + | The illustration shows a 6612 board with the PWM Channel A driving to the motor, and one half of Channel B to drive the loudspeaker via the electrolytic, |
- | {{: | ||