Past few weeks progress on the layout hardware has been minimal due to the work on the Traincontroller videos. The past few days though, I picked up preparing the wiring for the S88 bus and this afternoon the first 2 sensors have been mounted on the track. Time for a test drive!
The images show how the reed switches look when mounted between the rails and when painted black. They could have been mounted 90 degrees rotated, sunk between the sleepers, but tests showed that when mounted parallel to the track the time during which they are switched on by a passing train is a bit longer. This may have a better reliability for the sofware readout of the switch.
OK, they are in view, but actually it is not that bad a sight. In reality there also are devices between the rails here and there.
The Arduino with the s88 software is mounted under the table. The S88 clock, PS, 5V, GND and Data are connected to the ESU ECoS via 2m cat5 cable.
The locomotive has a small magnet attached under its NEM362 coupler with a small piece of sticky foam.
The video shows how the signal on the ECoS lights up when the loc runs over the sensor. The reed switch pulls an Arduino input to GND. The Arduino gathers 16 inputs and shifts them to the DATA output one by one based on the S88 clock. The Arduino sketch can be found on the Software page.
…
Hi Rudy,
Coming to all this with a DR5000 in 2021.
Thanks for all your amazing work on the project.
I am having problems with interference between the S88-N over an rj 45 cable and the arduino.
When I turn on the track power I get some interference, but when I start to drive the locos it gets really bad.
I have been trying so many solutions on different forums including this one, but none seem to work.
One suggestion I saw was to put a 100ms delay into the code before reporting the result of the sensor to the S88 bus.
I am afraid I am not a scripter so I am unable to do that myself…Is there any chance, you could explain how to adjust your code to put in a delay before reporting?
Thanks,
Antony
LikeLike
It’s been a while (multiple years) since I wrote that code … I’ll have to look into it. I’m rather busy … maybe in the course of next week I might have a look into it.
LikeLike
Thanks Rudy,
I know I am very late to the party and it’s been literally years…
Thanks so much
Antony
LikeLike
Hi Rudy,
I’ve tried your code on Arduino pro mini connected to the Ecos controller. All works fine as long as the Loco is moving slow (G-scale). At moderate speeds then the Ecos stop sensing the change. In my effort to degug, after minor modifications using (DDR, PIN, PORT) I have noticed that the code will sense the change at max speed but I’m still having issues with Ecos so Im guessing it is related to timing (which above my prog. skills). Any insight would be great.
LikeLike
It could simply be that the EcOS display latency is fooling you. The display update software in the EcOS runs slow because all the other software parts that have critical timing get priority. Eventhough the EcOS screen sometimes does not show the sensor on the display, the signal is correctly sent to the PC, at least that is the situation here with Me.
LikeLike
Hi
Is there someone that has tried this with hallsansors? i would like to us this for an dc car track. Because normal glass read sensors are very weak and brak fast.
Casper
LikeLike
Hello Rudy,
After many months all 12 mini pros are connected to our push buttons via the S88 on the Ecos. They operate 108 turnouts.
Would it be ok for us to change the Inputs from GND to +5v ?
There has been the odd “turn out change over” as we turn the fluorescent strip lights on/off (we have 12!) so there is some interference going on somewhere.
We have purchase a good quality Mains filter for the Ecos but the problem remains.
LikeLike
It is possible to change the S88 inputs to 5V, nit of course this requires a change in logic lebels in the software … when you’d look into the code it is not difficult to figure out where. It is also needed to take care that the inputs switches between 5V and 0V, not between 5V and floating, since floating will render unpredictable results. I don’t know how you plan to do this? The way it is desgned is that the input is 5V thanks tomthe internal pull upmresistor and switches to 0V with a reed switch. I can not imagine this is very susceptible to electrcal interference.
LikeLike
Hello Rudy,
I have been looking at the code for the Arduino DCC S88 and note that Arduino pin 2 is connected to S88 pin 3 Clock and the output pin 6 of the optocoupler also goes to pin 2 of the arduino. Could you confirm that both connections go to pin 2. I assume it has something to do with reading from the DCC track
Thanks again
Bernie
LikeLike
Bernie, for S88 you do not need a connection to DCC. It is a separate bus, connections are on the back of the ECoS according to the schematics on the blog. Hence there is no double use of pin 2, it is correct that the S88 clock is connected to it. Also the 5V power for these Arduino’s comes fron the ECoS S88 connector.
LikeLike
Hi, good work, is the arduino S88 similar to the Märklin S88 feedback modules. My command station is compatible with these. I would love to use them with it if possible. Any info appreciated.
LikeLike
I can’t tell with 100% certainty. If your command station sends out the S88 signals with the S88 standard specified timing (and why shouldn’t it?), it should work.
LikeLike
My command station is DIY built to Paco Canada(google The Pows) design DCC_Gen. In Train Controller it is recognised as a Lenz Digital Plus/LI100(F). I’m wondering if there are any different timings with this regard. Any help greatly appreciated.
LikeLike
It’s difficult to diagnose Alex. The Arduino S88 sketch works according to the timing diagram as shown on the software page. And that timing is not even that critical, it is the sequence of clock and PS signals that shift the sensor bits out. All I can say is that it works well with my ECoS, with 3 S88 Arsuino’s in chain.
LikeLike
Thanks Rudy i’ll keep trying different settings in software.
LikeLike
Would the fact that the command station can only accept 128 inputs make a difference?
LikeLike
In that case it should send a PS pulse after 128 clock pulses, he Arduino’s will tyen load their new sensor statuses to be sent to the CS. You could try to make a sketch that counts clock pulses between PS pulses to know for sure.
LikeLike
a bit frustrated at the moment with this, will maybe try that later. Thanks for the help anyway!
LikeLike
Enabled serial monitor in your sketch which you marked as for test purposes. the output results with no shorts to GND was sensors=0 then 128, on shorting A0 to GND sensors=0 then 129. Might this cast any light on the subject. On my command station the feedback indication shows 5,6,7,8 flickering on address 65.
LikeLike
What helped with me when ever I had some flicker was to put pin 12, the input pin for the next Arduino in chain, to GND.
LikeLike
Hi Rudy,
Put the Arduino back in the S88 chain at the end, placed wire between 12 – GND flickering now on 67- 5,6,7,8
LikeLike
Does the values on the serial monitor seem correct?
LikeLike
I can’t tell Alex, it is difficult to diagnose from a distance. Flickering says signals do reach your CS though … that is positive. Can you play a bit with the clock / PS time delay that is built in?
LikeLike
No its not possible to alter these settings. The current detectors already installed on the S88 bus are giving me correct outputs, perhaps its just not going to work for me. Still i’ll play around some more with it all and who knows. Anyway i’ll not keep you back any longer thanks for the help. Will let you know if I have any luck!!!
LikeLike
One last thing though, when the arduino is connected in it seems to prevent Train Controller from connecting to the CS when the arduino is removed connection is established.
LikeLike
Hi Rudy,
Got some info about timing of my CS.
The DCC_Gen is faster, pulses of 6us high, and 6us-8us low, to read the 128 inputs takes about 1,8ms.
Works right with 4014 chips but maybe is too fast for a microcontroller based solution
Don’t know if this helps.
regards
Alex.
LikeLike
Hi Rudy
how did you tie in the reed switch to the arduino reed switch with 1 wire in 1 out
what pins did you use
thanks
Roger
LikeLike
Hi Roger. The Arduino inputs are configured with the internal pullup, which makes them HIGH. The reeds are connected with one side to GND and the other side to one of the Arduino inputs. The input becomes LOW (connected to GND) when the reed switches. Which inputs are used can be seen in the code, it can be downloaded from the software page.
LikeLike
Thank you Rudy
works well
Roger
LikeLike
Very nice work. I will use your system on my own layout soon. I am waiting for arduinos. Thanks for your job and your blog.
LikeLike