Skip to main content

Reply to "Layout Automation Using Layout Command Control, LCC, and ESP32"

Alright, heres a couple more things,

First, when you say each module will control 20 LEDs I'm taking that to mean 20 channels that can be individually turned on and off.  How many individual LEDs are being controlled by each channel?  is it just 1 or 2 as indicators and track-side markers, or are some of these going to be large lighting districts and the like?  Keep in mind that the ESP 32 can only sink about 12mA per GPIO so you'll get an led at about half brightness if you connect directly to the uP.  Additionally, the esp32 can likely only sink/source a total current that is much less than all of it's IO at once, so you'll need an output buffer of some sort in any case.  If you're running less than 20 LEDs from each channel a 2 cent transistor will do the job just fine.  

Another thing to keep in mind is that CAN bus is a proprietary system owned and licensed by BOSCH.  If you want to put the name "CAN" on something, you have to pay the fee, just like 'BlueTooth'.  If it's used entirely internally, the chip maker has already paid the fees for actually making the chip with CAN bus protocols, however these legitimate chips are expensive compared to the knock-offs sourced from China for 75 cents.  Point in this is, if you're looking for an open source solution you may want to look at RS485 which is inexpensive an open protocol, and preforms well over long distances.  Or just use the WIFi from the start.  

Using the WiFi leads into the last point for the moment, if you're not using it, there is still no point of using the ESP module.  While the ESP32 is much faster and has more program space, it's sort of like saying a NASCAR car is much faster than a station wagon, when the race is against an old man walking with a cane... It's overkill for what's needed.  A $2 pro-mini will handle the task just fine if you're not making use of the WiFi anyway.  There are even much cheaper uP's out there that are up for the task of turning on and off LEDs and driving PWM signals.  For a good example, look up Dave at EEVBlog's series on the 3 cent micro-controller on YouTube.  ESP32 is wonderful, but it's overkill if not using the radio.  Also, keep in mind if you are already dealing with custom boards and SMT parts anyway, I2C port expanders and LED drivers can be had pretty cheap if you hunt them down.  

As for the difficulty being in the programing, that's mostly going to be in translating between your control software and the hardware.  that actual code to make LED's turn on and off and the like is really simple.  Mostly it depends what role the computer is taking on in your system, for example does it take in all data and send out all signals, or is it just riding piggy back onto of a system that runs it's self with the computer switched off?  

As far as a protocol, I've not looked into LCC as TMCC's standard is usually plenty. It's major limits being 'only' 128 turn-outs and 128 accessories can be controlled.  though there are hacks around this that a computer could take advantage of, such as using one of the accessory addresses to turn on and off banks of switches, so for example, you turn on accessory 1 to control switches 1-128, and turn off accessory 1 to control switches 129-256.  It would be annoying for control from the CAB remote, but would at least still allow full control of the layout from that remote... (well, only 99 switches/accessories per block). and the computer system wouldn't even care about having to do it.  

Guess thats all for now.  

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×