users:dagnall53:hardware
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
users:dagnall53:hardware [2019/02/17 12:28] – [WiRocs HARDWARE] dagnall53 | users:dagnall53:hardware [2019/03/20 12:48] – [Different NodeMCU Modules] dagnall53 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
- | | ||
- | **ESP8266 Rocnet Nodes** | ||
* [[: | * [[: | ||
- | * [[https:// | + | |
- | * [[: | + | |
- | * [[: | + | |
- | * [[: | + | |
- | \\ | + | |
- | ** RocClient Experiments ** \\ | + | |
- | Rocrail Client experiments using the Wemos Oled Battery board. | + | |
- | * [[: | + | |
- | * [[: | + | |
- | + | ||
- | ---- | + | |
- | ====== WiRocs HARDWARE ====== | + | |
- | 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 " | ||
- | Also shown are some optins | + | Also shown are some options |
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:// | ||
- | ===== Stationary Decoder ===== | + | |
+ | ---- | ||
+ | |||
+ | ====== Stationary Decoder ====== | ||
+ | |||
+ | {{: | ||
+ | On an ESP32, there are 16 General purpose I/O. | ||
+ | |||
+ | Deciding what functionality each General Purpose I/O has is set up in RocView using the PI02 and PIO3 programming interfaces. | ||
+ | |||
+ | There is an inbuilt memory drive (" | ||
+ | |||
+ | WiRocS can also interface with inexpensive OLEDs to display messages, and the illustration shows a typical timetable example. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Using a ESP8266 NodeMCU Motor Shield ====== | ||
+ | |||
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. |
- | ===== Mobile Decoder and Sound ===== | + | ===== Different NodeMCU Modules |
+ | Most NodeMCU modules are 26mm wide and fit the Motor Shield perfectly. However, the " | ||
- | There are two options to get sound. | ||
- | The first uses the AdaFruit MAX98357 which provides high quality sound and onboard amplifier. | + | ---- |
+ | ===== ESP32 Motor Shield ===== | ||
+ | Unfortunately there is no standard ESP32 motor shield equivalent to the ESP8266 version. Different ESP32 boards seem to have different pin-outs, making it difficult to suggest a " | ||
- | This board needs the _AudioDAC definition set, and then uses these connections : | + | ---- |
+ | ====== WiRocS Sound ====== | ||
- | * I2SDAC_DIN 9 D9(/rx) Data | + | There are two options to get sound. You can hear how it works on the Mobile variant here [[https://www.youtube.com/ |
- | * I2SDAC_LRC 4 D4 used as Left Right Control | + | |
- | * I2SDAC_CLK 8 D8 used by DAC as clock. | + | |
- | The alternative | + | The simplest |
- | This creates a Class D amplifier output stage that uses D9/RX to drive a transistor base that then drives the loudspeaker. | + | This creates a Class D amplifier output stage that uses " |
- | * I2SDAC_DIN | + | * I2SDAC_DIN |
- | * I2SDAC_LRC | + | * I2SDAC_LRC |
- | In this configuration | + | |
- | I recommend placing | + | In this configuration |
- | 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 " | + | The resistor in the transistor base ensures that the serial programming is still possible!. THe speaker will make squeaks whilst being programmed, but I find this useful to show something is happening. |
+ | |||
+ | 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 the high pulse currents. | ||
- | ===== 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. | ||
- | {{:users: | + | There is a "high quality" |
+ | If this option is used, the board needs these connections | ||
- | In this configuration, | + | * I2SDAC_DIN 9 D9(/rx) Data |
+ | * I2SDAC_LRC 4 D4 used as Left Right Control | ||
+ | * I2SDAC_CLK 8 D8 used by DAC as clock. | ||
- | The Code can also be used to drive a PWM motor control directly, in which case the RC DC motor controller | + | This mode is not compatible |
- | 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!. | ||
- | NOTE that the WEMOS Mini input voltage is limited to 6.5V, so must not be connected directly to a 2S LIPO. A small 5V regulator must therefore be added for this purpose. | ||
- | (The NodeMCU module | + | ====== MOBILE DECODER |
+ | WiRocS | ||
- | If you use the 6612, you can use one set of drivers to replace the single transistor AudioNODAC drive. Connect RX to one of the PWM inputs, and the loudspeaker (via a 10uf electrolytic) to the output. | + | {{: |
+ | |||
+ | The WiRocS 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! | ||
+ | NOTE that the WEMOS Mini input voltage is limited to 6.5V, so must not be connected directly to a 2S LIPO. A small 5V regulator must therefore be added for this purpose. - Also, to complicate matters, the NodeMCU motor shield has some additional and not well documented circuitry. This makes pins D3 and D4 " | ||
+ | |||
+ | {{: | ||
I also connected a 100k resistor from 3V3 to the Standby pin, with 10uf from standby to Gnd. This provides a very short delay before the drivers are turned on. Without this, the wheels do a powerful spin on turn on that can be disconcerting or damaging. | I also connected a 100k resistor from 3V3 to the Standby pin, with 10uf from standby to Gnd. This provides a very short delay before the drivers are turned on. Without this, the wheels do a powerful spin on turn on that can be disconcerting or damaging. | ||
+ | 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, | ||
- | The illustration below 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, | + | There are examples |
- | {{: | ||