Open sarusso opened 2 years ago
Hi. This is possible, but I don't fully understand to what extent you need the schematic. There are no ready-made LocoNet boards that can be hooked like an L298 board. So you can either:
Also, the readme contains the link to PCB project on oshwlab, it contains full schematic, not just PCB layout. Does it help?
Yes, it does help, thank you. I was hoping to be able to stick together with some jumper wires an ESP32 evaluation board, a L298 board, and have a WiFi+DCC control station without needing any extra component at all.
So it was more around point number 2, but it probably requires too much work to strip LocoNet from the code, introduces too many things that can go wrong in the process and it is not the purpose for this project in any case.
I still cannot find an entry-level project which can give me a DCC command station running on an ESP32 with little hardware setup to get started, and I found this one along the way which I did not frame correctly.
Thanks for your support :)
Well, I've tried to make code modular, so stripping physical loconet shouldn't be very difficult. I may try it at the weekend or so.
Also, what WiFi do you need? You might want to try Arduino with Dcc++ firmware, an l298 board and a esp8266 module with withrottle firmware. That will give you wiThrottle protocol for DCC.
Thank you for the hint, but at the moment I don't have an Arduino.
I am not sure why people keep using Arduino for this stuff while an ESP8266 could easily do everything by itself and it is way more powerful and even cheaper to some extent, not to mention the ESP32.
My intention would be to build a set of REST APIs around some implementation of a command station, which I can then in turn use from another system, and the idea would be to use a single micro (i.e. an ESP32).
So, you can try this branch: https://github.com/positron96/LocoNetControlStation/tree/no-loconet-phy
I've removed literally 4 lines of code and the firmware will now work without LocoNet hardware (hopefully).
Also, I don't know if it's ready for use, but this project might also be of interest: https://github.com/atanisoft/ESP32CommandStation
Thank you @positron96!
I will give a try to the branch over the next couple of weeks. Is the Sense - 36 pin mandatory or just to detect shorts? Also, should I just be able to connect the a motor shield directly to the Data - 25 and Enable - 32 pins, respectively to "PWM" and "enable" pins on the motor shield, and that's it? no extra HW components?
Thank you very much!
p.s. yes https://github.com/atanisoft/ESP32CommandStation is very interesting as well!
Sense pins are for load and short detection on main track and for reading CVs on programming track. If you don't want to bother or your motor shield does not have them, just connect them to ground.
I'd assume that a motor shield has 3 input pins for an output - PWM (En), IN1 and IN2. For DCC IN1 and IN2 must always be of opposite polarity, and so only one signal is output from ESP32 (data). The other one needs to be created via extra circuit, e.g an inverter IC or a simple transistor like this:
(image from ESP32CommandStation project)
I have two motor "boards" actually, one is in the configuration you assumed, the other one is the standard Arduino motor shield which has no IN1 and IN2 but just IN. I'll try a few things and let you know. Thanks!
If it has a DIR and a PWM pin, then you don't need an inverter and just connect DCC DATA and DCC EN to them
Yesterday I changed for my project the main code and keeped only dccmain with D1 mini ESP32 and L298N chip on small PCB. I put the schematic soon. main.txt
Here is the schematic Schematic_DCC ESP32.pdf
Thanks for sharing that! Was it nesessary to add a low-pass filter on current sense?
Not really, but I had some overcurrent spikes when turning power on. I think bad ground on my prototype.
Is there a way to build a basic version of the circuit on a breadboard using an ESP32 board (e.g. ESP32-DevKitC) and a L298N board without (much) extra components?
If so, would it be possible to add a schematic to the README? I am not expert enough in electronics to extrapolate it from the PCB layout...