Geoff Bunza geoffb
Model railroaders running JMRI have the capability of connecting  their cell phone or wireless tablets as a remote throttle for DCC control. I have often heard modelers who would like newcomers to operate their layouts with a simplified throttle, with a speed control knob.  Also reducing the possibility of inadvertently changing things visitors know nothing about. This article describes the construction of a simple WiFi throttle that connects directly to the JMRI WiFi server. It is not dependent on your DCC base station connected to JMRI. It will support loco address selection, six (or more) function switches, speed and direction control, running on a standard nine volt battery. While providing basic throttle functions, it can be customized and expanded by the inventive modeler to perform multiple functions at the touch of a button. You can also limit its functionality as you wish. It uses simple readily available parts for a one or two evening project. Throttle sketch updated 7 May 2019 to V5.2 minor bug fix.
_Opening.jpg 

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 6
Geoff Bunza geoffb

@kboy_1

Bonjour kboy_1 (nom?),

Je vous remercie pour vos aimables paroles!
Bonne chance avec votre modélisation. Si vous avez des questions, n'hésitez pas à demander.
S'amuser!
Meilleures salutations,
Geoff Bunza
 
Thank you for your kind words!
Good luck with your modeling. If you have any questions, please ask.
Have fun!
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Michael Tondee

I haven't looked lately but I

I haven't looked lately but I think you can still get "slider"  style potentiometers. Like the style on graphic equalizers. When I get around to building this, I'm going with one in a vertical orientation. I like the idea of that better than a rotary knob.

Michael, A.R.S. W4HIJ

Model Rail and "mad scientist" for over 50 years.

Member of "The Amigos", Co-Inventor of the A.O.S.T.

I call what I do "An artistic impression of reality" and the Island is "lost" somewhere in the Pacific Northwest, see it here...

The Blackwater Island Logging & Mining Co.

Reply 1
mstevetodd

Michael, I also like the idea

Michael, I also like the idea of a slider for setting the speed of the throttle. Notched would be ideal.

Reply 1
Michael Tondee

How many notches?

Someone on this forum, whose name escapes me at the moment, was using what I believe is a five position guitar switch. If memory serves from my rock n roll guitarist days, it's from a Fender Stratocaster. I think it was for the brake. Anyway, one could switch in and out various levels of fixed resistance that way. Trimmer pots could be used to fine tune and tailor each notch. Just a thought. Also, though it's probably beyond the scope of this project, it's not beyond the realm of possibility to design some sort of mechanical lightly spring loaded detente that works in concert with the slider pot to provide notches.

Michael, A.R.S. W4HIJ

Model Rail and "mad scientist" for over 50 years.

Member of "The Amigos", Co-Inventor of the A.O.S.T.

I call what I do "An artistic impression of reality" and the Island is "lost" somewhere in the Pacific Northwest, see it here...

The Blackwater Island Logging & Mining Co.

Reply 1
Neil Erickson NeilEr

Guitar selector switch

Yup a five position switch is easy to find. I would use it for a Johnson bar / reverser but it certainly could emulate a notched throttle as well. It is just a switch, however, and not a potentiometer so each pin would need a place to be read. 

Neil Erickson, Hawai’i 

My Blogs

Reply 0
Michael Tondee

@Neal

There you are. Sorry but your name escaped me at the time of the post. I was thinking that the switch would be used to bring fixed resistors in and out of the circuit with maybe the addition of trimmer pots for fine tuning of notches. I must confess that I've not yet looked at the details of Geoff's throttle that close other than knowing it's based around an Arduino. I keep thinking I'm going to get some of the little buggers to play around with but I haven't yet. Another item on my long to do list. I have the switchable resistance circuit diagram in my head. I'd have to put it on paper and take a much closer look at this throttle to see if what I envision would even work. I think much more in terms of hardware solutions than software solutions.

It's an avenue I might pursue in making a "proto like" DIY steam throttle. I just don't have the money that it's apparently going to take to go "all in" on the type of steam proto-throttle that's being discussed elsewhere on this forum. Apparently I'm in the minority but I find the price of the Diesel proto-throttle outrageous. At any rate, it would be insurmountable for someone like me so I just soldier on in the DIY world. Heck I don't even know if a steam throttle would need notches, it was just mentioned and it made me think of your guitar switch.

Michael, A.R.S. W4HIJ

Model Rail and "mad scientist" for over 50 years.

Member of "The Amigos", Co-Inventor of the A.O.S.T.

I call what I do "An artistic impression of reality" and the Island is "lost" somewhere in the Pacific Northwest, see it here...

The Blackwater Island Logging & Mining Co.

Reply 0
Neil Erickson NeilEr

Good idea

@Michael - Using the selector with resistors from each teminal would be an easy way to “notch” the throttle in place of the pot. The actual motion to of the engine would be determined by the software and inertia/momentum settings. Now how can I use this idea with a Johnson bar? 

Dont give up on your own Proto Throttle as this WiFi Throttle has a lot of potential and can be built quite inexpensively. My parts are due on the 28th & 29th! 

Neil Erickson, Hawai’i 

My Blogs

Reply 0
Michael Tondee

I don't want to clutter up Geoff's thread

I think I may start a new one in the morning about a more DIY steam throttle that is less involved than what was discussed elsewhere. My idea for a water gauge is just a charged capacitor circuit that bleeds off at a slow rate and is read by a voltmeter.

Michael, A.R.S. W4HIJ

Model Rail and "mad scientist" for over 50 years.

Member of "The Amigos", Co-Inventor of the A.O.S.T.

I call what I do "An artistic impression of reality" and the Island is "lost" somewhere in the Pacific Northwest, see it here...

The Blackwater Island Logging & Mining Co.

Reply 0
RichCini

This is a great project

This is a great project Geoff! Thanks for making it available. I just built my controller (using a Hammond 1593 handheld case -- kind of tight, but fits better in my hand). A few quick things:

  1. I just re-downloaded the ZIP file from 1/23/19 with the sketches in them, but it doesn't have the display library. I'm using the one referenced earlier in the postings, and it seems to work, but I would like to get the "approved" version. {UPDATE: this has been fixed}
  2. When setting the WiFi info in the header of the sketch, is that the SSID and password of the WiFi network that the JMRI server sits on? I have a separate wireless router with its own SSID and IP range separate from the regular house network. {UPDATE: it is the system WiFi}
  3. Regarding the SiLabs drivers, I know you are using a later version of Windows, but I've had a lot of trouble in the past with SiLabs on Vista, even with legacy drivers (I have a PC in the "shop" that I use for all sorts of random things on my workbench). SiLabs/Arduino works fine on the Mac for anyone looking into it.
  4. Nice looking push button (i.e., domed) switches for the horn are more easily found as NO type, rather than NC. Not sure what would be involved in inverting the horn input in the code; I might look at that at some point.

Thanks again for a great project!

Rich

Reply 0
Paelgin

Entering Loco Address?

Awesome project!  Thanks for your work developing and publishing. 

I am unsure of how the loco address is entered.  It sounds like the pushbutton increments (FWD selected) or decrements (REV chosen) the displayed number, which can be chosen when done incrementing or decrementing.  I hope I am missing something, because I really do not want to push that button 5,415 times to get to loco 5418 (from default of 3).  I am waiting for the remainder of the parts (I have received the ESP board), and am learning the programming language to research how the address is selected. 

In my mind, I had decided that I would probably see how to change the program (sorry, sketch I think it's called) so that if the 1st switch was active while selecting (incrementing or decementing) the loco, the change would be by 1000; if the 2nd switch was active, the address would change by 100; if the 3rd switch was active, the address would change by 10 each push of the button.  I like the idea of the roster being listed and being able to select from that too, but I have too many unknowns in how to do that. 

Phil in gorgeous Young Harris, Georgia, USA.

Tri-state Model Railroaders: http://www.TSMRI.org

Reply 0
Geoff Bunza geoffb

@Rich re: Questions

Hi Rich,

Thanks!!

1. -- Done before I saw this!! How about that?
Quote:
2. -- When setting the WiFi info in the header of the sketch, is that the SSID and password of the WiFi network that the JMRI server sits on? I have a separate wireless router with its own SSID and IP range separate from the regular house network. {UPDATE: it is the system WiFi}
Yes, correct. This is the ssid and password for the WIFi that the JMRI Wifi server is on.
Regarding the SiLabs drivers,
 
Quote:
3. -- Regarding the SiLabs drivers,
The SiLabs drivers I included are the latest ones available. Depending on your version of Windows you may have varying degrees of pain to install them. I avoid Windows VISTA like the plague -- personal preference.
Here is the page for the Silabs drivers: https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers  if you need more info.
Quote:
4. -- Nice looking push button (i.e., domed) switches for the horn are more easily found as NO type, rather than NC. Not sure what would be involved in inverting the horn input in the code
At line 309 you will find:
    for (i=0; i< num_functions; i++)  {
      ftn_temp= digitalRead( function_pin );
      if (ftn_temp != function_value)  {
        function_value=ftn_temp;
        set_function ( function_map );    // TOGGLE FUNCTION
 
This is the scan of all the function switches (and the pushbutton). You will have to single out the pushbutton usually function 2) and invert the sense of the switch, like
 
for (i=0; i< num_functions; i++)  {
      ftn_temp= digitalRead( function_pin );
      if (function_map==2) {                              // find function 2 The Pushbutton
          if (ftn_temp == LOW) ftn_temp =HIGH;   // Invert the sense low-> high , high-> low
            else ftn_temp = LOW:
      if (ftn_temp != function_value)  {
        function_value=ftn_temp;
        set_function ( function_map );    // TOGGLE FUNCTION
 
Please NOTE Well: This shows how to invert the sense of the pushbutton for the functions, NOT for setting the address and power ON sequences. That is a more messy problem. I'll leave that the you, the reader!
'Hope this helps. Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Geoff Bunza geoffb

@Phil re: Entering Loco Address

Hi Phil,

Thanks for your kind words!
Quote:
I am unsure of how the loco address is entered.
When you are changing the loco address via the startup sequence, you set the counting direction via the Direction switch (FWD-- UP,  REV -- Down) and hold the pushbutton down to change the address count. You can increase the counting speed by changing line 145:        delay(1000);  to a lower delay number.
 
Note also:
You can set the default address for the throttle by changing line 129:      DCC_address= 3;
which  is used only when the stored address in EEPROM is < 0 or> 4000, You can force the default always by setting the address to 0 manually and turning the power off then on to the throttle.
 
Your idea for changing the rate is a good one too.
You could also time the button down and change the rate the longer you held it down, because you can always release the button to stop the count in either direction.
 
'Hope this helps. Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
KHaus41369

More questions.

Can we use a pushbutton instead of toggle for the function switches?? What would happen if we used a 20K 2-element slide pot. All-electronics CAT # SLP-20KAX2B

Kevin

Modeling something to do with the Grand Trunk Western.

Reply 0
Geoff Bunza geoffb

@Kevin re :Questions

Hi Kevin,
Quote:
Can we use a pushbutton instead of toggle for the function switches?
Yes. You can use any switch you want -- open will be "ON" or 1, and connected to ground (GND) will be "OFF" or 0.
Quote:
What would happen if we used a 20K 2-element slide pot. All-electronics CAT # SLP-20KAX2B
This should work just fine. You would only need to use one of the two advertised "elements" which I take to mean there are 2 "ganged" 20K potentiometers in the unit. Be a little bit careful though... they list it with "Pot is prepped with a 5-pin connector" and 2 separate pots would usually have 6 independent connecting pins.
 
I think it is well worth experienting with different pots anything in the 10K-30K Ohm range will do, but you need the 3 pins for it to work. It is amazing how much the "feel" of the slide or turn can affect your interaction with it!
Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Paelgin

Trying to think ahead...

Geoff, thanks for soaking up all my spare time with this!!!  Something I had tried to envision but failed to be able to get the big picture to work. 

I had an Arloco (for 16 inputs) and Arduino talking to LocoNet, and built a JMRI script that took inputs and translated them to control a loco, but the resulting throttle always had to be connected with a Loconet cable.

A friend and I will be building throttles (OK, I'll be building two, but he's the instigator, I mean friend, with the suggestion), and I am going to meet with him tomorrow on some of the various questions I have come up with.  Since others are building this, I figured I should share my thoughts, some of which may be helpful, some of which may be leading down a rabbit hole.

1. If I put the OFF/ON switch on top, this might fit in a throttle pocket. Or maybe a smaller, slide switch on the side...

2. I was considering the various functions to be controlled by the throttle. In addition to the speed setting and direction, I definitely want headlights, bell, and horn/whistle, What about 1. Dim?  2. Short horn? (maybe), 3. Fans?, 4. Dynamic brakes?, 5. Mute? 6. Shutdown?, 7. Crossing cadence?, 8. Brakes?, 9. Coupler sound?, 10. Notch Up & 11. notch down manual?, 12. Emergency stop?

3. Location of the controls: one-hand operation is one feature some people really like about the simple Digitrax throttles (direction control on top, big knob for speed).  I took a scrap piece of plastic (ok, I sacrificed an Ikea plastic container) and made a mock-up of the top.  If my horn button were in the middle just above the battery, my thumb could rest on it while my thumb and 1st finger could easily reach the speed knob when needed. Holding the throttle in my left hand (I'm right handed) lets me fiddle with uncoupling or throw turnouts with my right hand, and I don't have to look at the throttle to be able to find all the normal functions while driving a loco. I am waiting for parts, including one inch diameter knurled aluminum knobs which should be easy to manipulate.  Of course, once I get all the parts, I will be dry fitting to verify spacing before I drill.

4. If I primarily use just one loco, I figured I would put that in as a default.  I would program the decoder therein to match the functions I put in the throttle.  However, if I had several that I might use, I had toyed with the idea of a rotary switch which would select one of several specific pre-programmed locos that I would add to the code.

5. I am learning Arduino coding so I may be way off base here.  I was thinking, if I code it right, the change in speed could be "throttled" in addition to any momentum built in the the decoder.  That is, if I have Neutral, but change the knob (for example, to full speed or off), I think that as coded now, nothing reacts until I select Fwd or Rev.  But I figured if the difference between the actual speed being sent to the loco and the new setting of the knob were too different, or if direction was changed at speed, the throttle could know that and react accordingly.  I've heard people talk about "Neutral drops" in rental cars, but a loco shouldn't be abused like that (not that cars should either, but...).

6. Roster selection as a feature is way above my pay grade.  But, I had planned to look at the open source code for Engine Driver to see if I might get a clue as to how JMRI WiThrottle broadcasts that info. Hmm, I wonder what a plain communications program (is there such a thing anymore?  ProComm was my go to tool with the 300/1200/2400 baud modems I started with) would show if connected to the IP and port of WiThrottle.

7. Wifi settings (SSID, password) and IP numbers are hard coded.  I figured I would load the IDE on my laptop to allow me to re-code when I was off-site (visiting to operate on someone else's layout for example).

Thanks again for your time, and your continued contribution to the world's greatest hobby.

Phil in gorgeous Young Harris, Georgia, USA

Reply 0
Geoff Bunza geoffb

@Phil (Paelgin) re: Comments

Hi Phil,
Quote:
Roster selection as a feature is way above my pay grade.  ... to see if I might get a clue as to how JMRI WiThrottle broadcasts that info
You don't have to look far, JMRI documents all the specifics here:
JMRI: WiFi Throttle Communications Protocol
 
You will have everything you need and then some. Good luck.
Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Logger01

Antenna Range Testing

Had to rush this before the snow, but I managed to get a copy of your setup running and do a little testing on the range with the external Antennas. All tests on flat range with no obstructions and antennas mounted ~35" above ground. Need to get back out to test the ESP32 boards with the builtin PCB antennas.

Throttle Antenna   –   Engine Antenna     Distance Meter (Feet)    [With two sheets of ½” Sheetrock interposed]

Monopole (Vertical) - Monopole (Vertical) 50 m (~155') [33 m (~108')]

Monopole (Vertical w Al ground plane) - Monopole (Vertical) ~60 m (~155') [38 m (~125')]

Adafruit.com PCB Antenna https://www.adafruit.com/product/2308

Monopole (Vertical) - PCB Antenna - Perpendicular to long axis) 33 m (~108') [21 m (~69')]

Monopole (Vertical) - PCB Antenna - Inline with long axis) 20 m (~65') [12 m (~39')]

Monopole (Vertical) - PCB Antenna - 45° to long axis) 10 m (~32') [6 m (~20')]

Yagi - Monopole ~90 m (~295') [NA]

Circularly Polarized - Circularly Polarized ~105 m (~350') [NA]

Interesting to note that the sheet rock can reduce the range by ~ 40%. Note that some of these distances are significantly shorter than what we are seeing with drone First Person Video (FPV). Especially for the Yagi and CP setup, but even for those running outdoors these antennas would probably find few applications for model railroaders. 

Really wishing I still had access to the 5 m anechoic chamber or even the 30 m range, but retirement happens.

Ken K

gSkidder.GIF 

Reply 0
Geoff Bunza geoffb

@Ken re:Antenna Experiments

Hi Ken,

Thanks for sharing the results of you experiments!

As an Amateur Radio operator I (as is typical) enjoy seeing empirical measurements and real results! The little ESP32's seem great for layout use, but I have garden railroaders interested too and I am always on the lookout for longer range approaches.
Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Paelgin

Success!

Geoff, thanks again for your time and effort. Cool stuff each time. I got mine working.

I started to put one together and broke the display tightening it down in the case, and then couldn't get the board to communicate: it may be just some pins I screwed up ( overheated with my soldering iron, and put the pot leads in wrong).  I had two of everything, so I proceeded to be more careful, and got it all to work (with new display and new ESP board). I crammed everything into the little case with a cut-out for the USB connection and battery door in the back.

My friend and I decided that our 1st prototype would be simple: the lights ON/OFF, the bell ON/OFF, a pushbutton for the horn, the direction switch (center-off), and potentiometer with 1" knurled aluminum knob.

We decided to put two switches at the top for lights (on the right) and bell (on the left), put the display mid-case, and on the bottom of the control area (leaving the battery compartment alone on the very bottom), the speed control far right, horn pushbutton center, and direction switch left.  We found that in a mock-up that I made before building this, we could hold the throttle in our left hand, and control the speed knob with our finger and thumb (blocking the display which we decided was not needed during operation). The horn would fall under our thumb when needed.  Oh, the on-off is on the top. 

I drilled/filed a hole in the case for the USB connection so that I can re-program the board without dissassembling anything.

The picture is my throttle leaning against loco 8517 which I just finished running on my test track.  I did add code to change the address (increment or decrement) by 100 if the light switch was on, and by 1 if not.

Is there a way to dispatch the loco used?  Is there a better way to shutdown than merely killing power?

Thanks again. I thought I'd share to let others know it can be done!  If we like this at the club, we will probably make 2 or 3 more instead of buying UT4D throttles.

Phil in gorgeous Young Harris, Georgia, USA.   http://www.tsmri.org1192024a.jpg 

Reply 0
KHaus41369

Got my parts and found IoTt - internet of toy trains on youtube

I got all my parts in...with with the pot Geoff suggested instead of the slider I posted.. wont fit into the case I bought. That's where I am not. Case layout since mine is slightly smaller. But I found this on YouTube. IOTT. Internet of toy trains. Gentleman named Hans is using the internet of things idea combining it with model railroad...some of it is beyond me but hes talking to loconet wirelessly... built a wireless touchscreen controller based on the UT4 and other neat things. I cant get a link posted...but look up IOTT on YouTube

Kevin

Modeling something to do with the Grand Trunk Western.

Reply 0
Geoff Bunza geoffb

@Phil Congrats!

Hi Phil,

1. Congrats on your success!

2. Geoff is spelled G e o f f -- not George (fixed). (Third time)

3. There is a command to dispatch/release the throttle in the WiFi protocol. Review the link I posted in the article. You will have to add a switch or button or something to activate the command.

Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Geoff Bunza geoffb

Steam and Water Gauges for the Throttle

Hi All,

As some of you know, I sometimes follow strange random thoughts down rat holes, into swamps, and sometimes off cliffs. This time the path went here:

I wanted to explore what could be done in the throttle, as opposed to in the decoder. The idea came from what is essential to running a steam loco, and among the answers to that  was watching "steam pressure" and watching the water level. The steam gauge is always found in a steam loco as well as the water/sight glass -- like this one here:
terGlass.jpg As far as I was concerned the sight glass was easy-- fill the glass with a level(draw a bar) and you are almost done (with adjustments of course). The steam gauge was not. I started with a full color rendition of a gauge to start and quickly realized 24 bit color was out, 64x64 resolution was unreadable, and I could not draw a line to "move the needle" on the dial with simple, low cost displays. I'll leave the rest for another article. The "gauge" in the video is rendered by a simple Arduino doing screen refreshes. Yes, there are faster processors. The ESP32 is about 8 times faster. But the display (I2C full color) is operating near its max speed -- yes, there are other displays.

Nonetheless -- I kind of like it!! (actually surprised). The thought occurred to me that one could "time out" the boiler steam as a function of running time and engine speed (remember the throttle knows time and speed exactly-- barring momentum effects interference). So over time, pressure could drop, and water level could drop too.
 
Also, consider the possibility of a center-off switch with top side in a momentary position and the bottom off-center position in a static switched on position. It could act as the "shovel" for coal each time it was raised, or turn on the "stoker" in the lower switched position. Thus building up steam, as the throttle simulated use in operation.

The bezel I used for the pressure gauge was the real gauge printed on paper, with hole cut for the display. I think it looks better in person than in the video: Here's a pic for you:
1280x720.JPG 

The original gauge face I copied is real, but may not be a steam gauge. Westinghouse after all made a great deal of air equipment! This is not relevant for this experiment. Also the general operating pressure for US steam locos was 175-240 PSI or so. I have read that many of the pop valves were set for 220 PSI. High pressure steam might have operated over 300. That is why I went for a gauge with this range.

I think a machined brass bezel would be impressive. Anyone have any ideas how to make a simple, but effective one?
 
The gauge face needs a re-do. Note this is 128x128 pixels, monochrome 1 bit. This was created by taking a pic of the real gauge, cleaning up the numbers and shadows, removing the pointer, converting to black and white, sharpening it, and converting to the new format. It took hours to get to this result photographically (with Corel Paintshop Pro). I think starting with another face, might give a better result.
 
With a sight glass and a steam pressure gauge, the layout of the throttle becomes a new canvas.

It occurs to me that experimenting with coal shoveling, fuel stokers, blowers, pumps, cab rattle, and steam hiss is another open line needing investigation, and I think the power for this will need to go to an "AA" battery pack or some rechargeable one.
 
Last, I think we can do away with the display for DCC address and functions. We can use the pressure gauge display do double duty, the revert to pressure for operation. A large enough display (rectangular) could also handle the sight glass. I think the sight glass "bezel" could also be constructed with brass sheet, screws and nuts, but 3D printing might actually give a better result. Lots more to think about and do.
Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Paelgin

Update on success...

Howdy Geoff.  First and foremost, please accept my most humble apologies for incorrectly calling you George.  You can call me Mud if you'd like.

Second, while I do not know as much about programming Arduinos as I'd like, I have learned tons from working with the sketches that you have provided.  I also am appreciative of the excellent and detailed instructions on getting the Arduino programming program to talk to the ESP32.

Regarding my own throttle, my friend who encouraged me into this project shared my vision for a simple-to-use throttle with minimum controls.  That would allow visitors, as well as the member who is an occasional Digitrax user, to operate trains. Our Open Houses (4th Saturday of each month) are great opportunities to put a throttle into a newbies hand and allow him (with coaching) to run a train! With that goal in mind, our version only has Bell, Lights, Horn, Direction/Neutral and speed knob.

In addition to the included capability to turn track power on when booting up, I added code to turn track power off while running (allowing this throttle to kill track power before unplugging the layout).  I also added code to Dispatch the current acquired loco, to set the throttle range to 1/2 (or back to full), to send an F8 (Mute) toggle to the loco, and to acquire a new loco after Dispatching. 

Without adding any additional controls (in keeping with our simple to use concept), I used the speed knob as a trigger while in Neutral (I know, I know...making it hard to keep track of all the options; however, no added features are needed to just run, I just wanted them available).  F8 is toggled, if both the Lights and Bell are on with the Direction as Neutral, by twisting the knob full on then back to zero. 1/2 throttle range is triggered by Lights on, Bell off, Neutral then twisting the speed knob full on.  Full throttle range is reinstated by Bell on, Lights off, Neutral and twisting the speed knob full on.  Dispatch is triggered with speed=0, Neutral and all functions off then twisting the knob full on.  Track Power Off is triggered when Dispatched, Bell and Lights both on and twisting the knob full on.  Set new address is triggered when Dispatched by holding the horn on for about 2 seconds.  Phew. I've been busy messing up what was good programming with my hammer and crowbar approach... Well, may not be the most elegant programming, but it mostly works (having problems with functions being reversed such as the horn blowing when I select a new loco, and turning off when I press the horn button...I have some theories).

SWIFT #2 (Simple WIFi Throttle) is being built now, and will include a battery level sensing input that can stop a train and warn the user if the battery is too low (the runaway train when my SWIFT #1 dropped off during our Op Session was acquired by someone else with a Digitrax throttle and stopped).  I am also planning to include another input to allow the lights to be controlled by a center off SPDT switch for Off/Dim/On.

Geoff, I have to say that your imagination has provided amazing additions to the hobby.  I hope others can be inspired to work with some of the cool ideas that you have brought to us.  Thanks again for all your work and continued sharing of ideas.

Phil in gorgeous Young Harris, Georgia. Tri-State Model Railroaders, Inc (www.tsmri.org)hDisplay.jpg 

Reply 0
Geoff Bunza geoffb

@Phil Congrats !

Hi Phil,

While I have no hope of remembering all those options you added, I am absolutely thrilled to see you try new things out and build a better throttle for your own use. Congrats on your success!
 
Another option to set up options is to hide a small/tiny slide switch (maybe even in the battery compartment. When you engage the hidden switch before turn on, you could enter a configuration mode to enable/disable hidden functions not normally accessible. After reconfiguration, power off and reset the hidden switch.
 
Also remember, the ESP32 has more unused pins that could read more switches too. ...and I like that name... SWiFiT !  Cool!!  May I use that?
'Glad to see you have fun! 
Best regards,
Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Paelgin

Configuration for SWIFT

Howdy Geoff (see, I remembered this time).  By all means, use the acronym, or any version of it as desired.  I called it "SWIFT", and will number each SWIFT with a serial number (SWIFT#1, SWIFT#2, etc).

In the sketch for each throttle I am making (one is complete, another is almost done, and another four are on the horizon), I am providing a unique name for each throttle.  This is needed of course for WiThrottle connection to the Digitrax system.  Hmmm, maybe I should name each one by owner (Phils SWIFT, Rons SWIFT, etc).  Now I am thinking that I should get different color handles for each one too.

Regarding added functions, I did write up an instruction sheet for the added functions provided in the sketch (over and above the labeled train functions on the front).  Even though I wrote them, I cannot always remember. I figured I might type up a condensed cheat-sheet and tape it to the back.  A hidden switch for pre-operation configuration (by a qualified hacker) might be ideal for some people to allow changes to the basic setting if needed due to different location, or change in server, or other changes.  We had considered a front-mounted rotary switch for location assignment if owners take their throttles to different locations (home, or maybe to a friend's layout), but so far we have not seen the need.

I was temporarily set back when my router at the club decided to use a different IP for my train computer once.  It assigned xxxxxxx.3 instead of the normal xxxx.1 so SWIFT wouldn't connect.  I had my laptop and made the edit to the sketch and uploaded that to solve the immediate problem. Now I have a section of code that tries to connect at xxx.1, then xxxx.2, then xxxx.3 then if failing that, falls through to an input screen allowing building of the IP to be used.  I use a string "1234567890..." and move between characters in the string by rotating the speed knob and select each character by locking with FWD (too many times the raw data from the knob was fluctuating and would present different characters), then accepting by pressing the Horn button. When the IP was complete, I used the Bell to accept the new character array and use that for trying the IP to find the server.  I have the same type of code for the SSID and password.  Figuring out how to change a string to a character array was another Google moment.

So many awesome ideas from you that my head is spinning.  Thanks for the impetus to branch out into DIY.  For an idea of cost, with my current build, I am collecting $60 from each friend that wants me to build one (for cost and to help cover the R&D mistakes, oops, I mean trials.  So far, I have cooked one ESP32 board, and broken one display). The USB port broke off one ESP32 board, but that was replaced under warranty (laudable customer service).

Phil in gorgeous Young Harris, Georgia, USA. http://www.TSMRI.org

Reply 0
Reply