D. R. Chicotel wrote: > > How about something less serious and more fun. I want to use PICs to > control my model railroad. In particular, I want to detect when there is a > car on the rails in a designated block so that the PIC can drive the > signalling system (LEDs). One rail is a continuous +12V DC and the other is > ground. All cars have metal wheels and draw varying amounts of current. > Locomotives have DC motors, passenger cars have lights, and cars without > motors or lights have a resistor across the wheels (to insure that they draw > some current). What would be the best way for a PIC to detect when this > current flow is present? Maybe a voltage comparator or something like that? > That might work, but I think it might be simpler to put reed relay contacts between the rails and magnets on the cars you want to detect. At least that worked for me. It is simple and robust. > Another question. I want to place a PIC in every locomotive and then > superimpose digital commands signals on the rails so that the locomotives > sitting on the rails can listen for the commands addressed to them and > respond accordingly. This will allow multiple locomotives to be controlled > independently of each other on the same section of track. The problem is > that a model railroad is an electrically noisy environment. Anyone who has > seen the occasional sparks that fly between wheels and dirty track would > visually see this problem area. What would be the best data transmission > method to use to minimize the effects of all this noise. RS232? Frequency > Shift Keying? Tone Link? > There was a thread on the list on something very similar a few months ago. An organization called NMRA (National Model Railroad Association) has defined a standard for a digital train control system designated DCC. Check out http://www.tttrains.com/dcc/ Basicly it defines a data encoding standard for a +/- 12V PWM power signal, ensuring a 0 volt DC value. > Another question. Will transmitting digital signals like this over the > rails cause RF interference. Won't the rails act like a huge antenna. I > don't want neighbors complaining about their TV going nuts or worse yet, > having the FCC get involved. > That may be a problem. I suppose that it has been considered in the DCC standard. Some sort of bandwith limitation may be required. Do we have any RF gurus with model railroad experience out there? > Thanks alot. DRC -- Lars Haven aka "You need tiny little eyes to read tiny litte print, like you need tiny little hands for milking mice."