Shop OBEX P1 Docs P2 Docs Learn Events
Model Railroad Application - Page 2 — Parallax Forums

Model Railroad Application

2»

Comments

  • BillHBillH Posts: 14
    edited 2004-12-17 01:42
    Don, I tried your program but it still has a problem. I hooked up LEDs to the three relays to monitor what was going on. Trying to listen to relay "clicks" was hard to follow. When I ran the program, relay 1 turned on and stayed on, relay 2 did not come on and relay 3 came on and stayed on and nothing else happened. What I anticipated was a smooth motion through the three relay/LED sets; green LED on, then red on and green off, then yellow on red off, and loop through over and over. I think we are on the right track but have a piece missing. The logic sounds right but the stamp has other ideas. I am going to try to tweak your program to see if I can get it to cycle through. If I can get it to do that then I can use the inputs to change from high to low and move everything along at the pace that the trains move.

    Sid, I do not have Express PCB and am not familiar with it. But I am using Circuitron DT-1 track detection boards that use PR's to detect the train movement. When a train shades a PR the board, which is a comparator circuit, provides a ground at that PR's terminal. The stamp inputs will watch for those grounds as the train moves along and will output to the associated relay which will energize the speakers. All this has been in place most of this year and works great. All I have to do is get the stamp to interface for me. That for me, has definitely been the tough part. I have a digital heart feeding oxygen to an analog brain!! To say that I deeply appreciate everyones input is an understatement. I need the help. I will keep you all informed of progress. Any other ideas are very welcome.
  • JoltnjoeJoltnjoe Posts: 12
    edited 2004-12-17 03:34
    I was working on my trains when I thought of your problem

    Can you offset the detector and reciever not straight accross the tracks

    so that the gaps between the cars will not affect the signal
  • BillHBillH Posts: 14
    edited 2004-12-17 23:32
    Joltnjoe, That would be a great idea and one that I would not have thought of, but I am not using an infrared system which uses a detector and a receiver. Mine is a Circuitron system that uses a photo resistor only between the tracks. The resistance is read by a comparator circuit and provides a ground to the stamp. Thanks for the input. That is really thinking "outside the box" as they say.

    Bill Herbert
  • BillHBillH Posts: 14
    edited 2005-01-29 16:54
    Hi guys, I finally got the system working! It took a lot of trial and error but finally came up with code that worked. It was long and cumbersome but it worked. I have a niece whose husband is an electrical engineer. They came in for Thanksgiving and I explained to him what I was doing. He went home, bought a Parallax Basic Stamp 2, breadboarded a test system and wrote some code, which he brought when they came back for Christmas. We hooked up his laptop to my detection system and with a couple of tweaks it was perfect. His code was very short and concise, basically 3 subroutines with the added advantage that it works in both directions. My code only allowed for forward motion; no backup feature. So I bought another Stamp 2 and another super carrier board and spent a couple of weeks soldering everything together and now have an eastbound and a westbound sound system. I would like to thank all of you on the forum who contributed ideas and suggestions on how to make this work. Without your input I would never have been able to come up with even my crude attempt to write a workable code.
  • steve_bsteve_b Posts: 1,563
    edited 2005-01-29 21:11
    BillH,

    parallax has just started a 'PROJECTS'·Forum on this board.·

    May you'd like to post your project with some images!!· there's a few really neat ones in there already!





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Sign In or Register to comment.