i know it's possible to mix AC with DC... that's how old tube radios work. my question is this: i'm a model railroader and i was hoping that it would be possible to simply power each 36" section of track individually using separate DCC buss lines and use insulators between the track sections then use the 5vt out of the arduino to connect to one side of the insulated rail and on the other side have the lead go to a digital pin so that when the steel wheel of the locomotive completes the circuit it will send the 5vts to the arduino just like a momentary switch.
so... does anyone here know if i can put the 5vtDC across the open rail without effecting the DCC Bi-Polar signal(digital full wave signal) being sent to the locomotive or the arduino... if i use a cap across the track gap and diodes on the 5vt arduino leads?
You would be feeding the full DCC track voltage into the Arduino input. I don't think that will work. If that doesn't represent your proposal, please supply a schematic diagram to make it clearer, what you are trying to do.
A DCC signal is nominally AC, but a locomotive or accessory decoder can't handle any DC offset that might be applied to it.
If you're trying to do occupancy detection, there are lots of other time tested and proven ways. The "steel wheel" statement above reflects a simpler situation where the wheels are electrically joined through the axle, just as on a real train. 3 rail systems like Lionel do that, but 2 rail has the electronics wired between the 2 wheels. So you can't just ohm across it to get occupancy status. For that you need current threshold detection with diodes or current measurement transformers.
There are ready made systems for occupancy detectors. I use stuff I bought from Littfinzky in Germany. I think You can find descriptions there how that technic works. My railroad has some 150 sections, varying from a few fett up to 10,15, 20 feet.
I'll see if I can find any installation exsamples.
dwmen:
so... does anyone here know if i can put the 5vtDC across the open rail without effecting the DCC Bi-Polar signal(digital full wave signal) being sent to the locomotive or the arduino... if i use a cap across the track gap and diodes on the 5vt arduino leads?
What are you trying to achieve - if we know that it makes it much easier to make useful suggestions.
You cannot connect an Arduino to the rails at the same time that the rails have DCC power - the DCC voltages will damage the Arduino.
If you are trying to detect whether a section on a DCC layout is occupied by a locomotive then that is something that is commonly done by detecting when current flows in the section. I don't know the technical details of how that is done as I don't use DCC.
Another option is to use optical sensors that are covered by the train - either active IR reflective sensors or passive Light Dependent Resistors (LDRs).
i am well aware of all the "time tested" methods... unfortunately they are expensive(except the ugly reed switch method) and archaic and way too bulky. plus for complete automation of every 36" track section i need something super simple and basically free. there are over 100 flex track sections 60 switches and over 150 signals ranging from single target(RGB) to three target(RGB)...where do i find .75mm RGB's... i'll never tell.
this is a big, never before attempted layout... NScale. this is the last piece of the puzzle. i was thinking of a way to try and use optocouplers but i can't see how that would work... it's a shame i have lots of those...perhaps opamps? i need that switch action at the gaps between the track sections. i was also thinking of ac current detection boards but then we're back at the price point again.
Write the diagram of Your theory, 5 vot circuitry and the DCC circuitry. You will apply the 5 volt into the output of the DCC unit. It does not look good to me.
Anyway, You will need some device detecting the status of each section. The Littfinski device is RM-88-N-O-G. There are examples for both 2 rail and 3 rail systems.
I run MFM (Maerklin coding, ECoS calls it "M4"), and one loco uses DCC coding!
this may just work... it's a tiny hall sensor that's about the same size as an Nscale tie.
A1301EUA-T SIP3 TO-92 Linear Hall Effect Sensor you can get 100 of them for $25. these are tiny enough you would see them buried between the track. one 10k resistor is all you need and it's strait into the shift register/arduino
Please explain to me how the current transformer method is "archaic" (or bulky for that matter). The devices are dirt cheap, perhaps you could interface one directly to an Arduino somehow, it would meet your need to be economical. It wasn't an option before DCC was introduced because it can't detect DC.
Point sensors like Hall effect and LDR don't offer block detection.
As unpalatable as it may seem to you, you haven't really got any chance to make this work as you have described it. The diagram you posted does not show enough wiring to demonstrate how it might work.
aarg:
Point sensors like Hall effect and LDR don't offer block detection.
Agreed, but in all likelihood proper block detection is not needed - it's a model railway and no lives are at risk.
It seems to me reasonable to assume that a train is in a block if it has been detected entering a block and has not been detected entering the following block.
Most likely what the OP wants is to create a system in which the signals reflect the presence of trains or trains respect the aspect of signals by refusing to enter a block when the signal is red.
Of course it would be nice if the OP takes the trouble to respond to my earlier request to describe what he wants to achieve. At the moment it is a typical XY problem.
@Robin2
How would OP start up after a pwr down? Ok, remembering the last status could work. How to solve the situation when a train has been removed from the tracks, or the opposit?
Sure no lives are at risc but I assure You that You don't want, say a 50 or 100 car train colliding and the rear part of the train is free running downhills. It can take days to pick up, repair or adjust the cars from the floor… I've seen the disaster when a doulbe heading BigBoy train of 120 cars was involved.
Running fine, delicate, modells calls for safety. Running toys, ok, less important what happends.
Point sensors have inherent problems - for example:
A sensor at a block boundary becomes active.
Was the train going east or west? Big difference as far as block occupancy.
as long as you have a sensor on every entrance, and exit of a section direction and speed is easy. at 100 sensors for $25 it's certainly doable. also with Train Controller it can easily operate with less then that because you can literally program the actual "real" length of every block to easily control speed and when and how your train comes to a stop. it's pretty accurate give or take a few mm. you build trains which include actual length of each loco and piece of rolling stock programmed into the automation. as long as your trains are where the computer says they should be your in business. as long as you put your loco back on the same block your good... you don't need to put it exactly to the mm where you took it off. you do not need to run resistors on every car. just program your trains and rolling stock, once, into the program. it will calculate as you add or remove cars. building trains is super easy once programmed. i'm not using the arduino as a DCC++ base station... i'm using my NCE for that connected to a PC running Train Controller Gold. i'm using the arduinos as decoders for turnout, signaling, track sensing...ect. the micro arduino's make excellent decoders with just a few extra, super cheap parts. each one can control 10 servos and up to 500 signals.although i don't usually control more than 30 or 40 at one time. with all the analog inputs still available to you. i tried the JMRI thing and it was, pretty horrible. if you've got the extra bucks Train Controller is the ass of the cat.
you guys have to be getting suspicious by now...lol.
aarg:
Point sensors have inherent problems - for example:
A sensor at a block boundary becomes active.
Was the train going east or west? Big difference as far as block occupancy.
my point exactly... at the price of "block sensors" you can only afford to use the bare minimum... which is usually not as many as you'd like. but at less than 25 cents for a hall sensor you can put as many as you want. the way it works is by passing any two sensors you now have the direction and speed. if your running Train Controller that is.
Imagine sensors at every block boundary. Suppose two trains approach a block from different directions and the eastbound reaches a sensor first. Now it's primed. Then a second train hits the second sensor from the west. The system must now choose between:
-it was the same train. The speed and direction are easily calculated. The home block is marked occupied, entry signals can be set to "stop".
-two different trains. There are two trains running at full authorized speed toward one another in the same block. Signals don't really matter anymore, as there will be a strong probability of collision.
There is no way the system can know the difference - both cases look identical from the sensor point of view.
Railroader:
You obviously have quite some model railroad knowledge. Why not just set up a test section, free from the railroad and try Your theory?
as i stated early on i have figured out everything else... but i didn't want to hook the arduino pin up to the track the way i was thinking because i didn't want to waste a perfectly good board... and risk damaging the base station or decoders. im glad i did this before that. i never even thought of hall sensors... i didn't know they were so cheap. the ones on my CNC cost quite a bit. i've built industrial CNC machines and do all right with a bit of programming but mostly i'm an idea guy... for some reason i never have the same ideas as the other guys...lol. this is my first run in with DCC... i had a large DC layout for years. the technology that's available now has definitely sent my brain into overload...lol
Hey, hey, army of helpers, including me. Shouldn't we g"ive the f-k" about train safety and leave that for OP to handle? OP shows a quite high level of modell train knowledge.
The question was pure electrical. Can that work?