Jump to content




How to sense trains?

arduino trains sensing

  • Please log in to reply
5 replies to this topic

#1 Sporech

Sporech

    Member

  • PipPip
  • 28 posts

Posted 06 August 2016 - 11:43 AM

Hello, I'm new to this forum!

 

I have a knex roller coaster, and i have an arduino board. The arduino will control the trains by turning on/off the chains. So my question is how would you sense that a car has passed through a certain area of track?

 

Somebody recommended to me using magnetic reed switches, which is a good idea, but i can't find a practical way of doing this.

 

Can anybody share any tips?




#2 KirbyCoast

KirbyCoast

    Newbie

  • 340 posts

Posted 06 August 2016 - 11:23 PM

Welcome to SSC! I haven't worked with automating my rides all that much, but I would guess that the easiest way to sense the cars moving through certain areas is to do it all with timing. I don't know if that's possible with Arduino boards, but if I were programming it on a computer I would record the time it took for the car to go through the track a few times (certain sections of track individually if you want to make something happen in the middle of the ride) and then average the time recorded on those few runs. Then you would have to make it so it starts in the same place every time. If that doesn't work with Arduino, you could use motion sensors on the parts of the track you want to automate and attach them to the Arduino board. I'm sort of curious to how this would work, I've always wanted to try automation but NXT is really expensive. I think if Arduino does work it could be a good alternative.




#3 Sporech

Sporech

    Member

  • PipPip
  • 28 posts

Posted 06 August 2016 - 11:42 PM

Welcome to SSC! I haven't worked with automating my rides all that much, but I would guess that the easiest way to sense the cars moving through certain areas is to do it all with timing. I don't know if that's possible with Arduino boards, but if I were programming it on a computer I would record the time it took for the car to go through the track a few times (certain sections of track individually if you want to make something happen in the middle of the ride) and then average the time recorded on those few runs. Then you would have to make it so it starts in the same place every time. If that doesn't work with Arduino, you could use motion sensors on the parts of the track you want to automate and attach them to the Arduino board. I'm sort of curious to how this would work, I've always wanted to try automation but NXT is really expensive. I think if Arduino does work it could be a good alternative.

Timing sadly is unreliable :(

The speed my trains run round the track is highly dependant on their oiling, which rubs off over time. I have to control 3 trains you see- they can't run into each other. Also, i can't have more than one on the same lift.




#4 Britfag

Britfag

    Everybody's Russian!

  • 3818 posts

Posted 07 August 2016 - 03:03 AM

I used magnetic reed switches in the middle tubing of the ride, and magnets in the nose of the train.

 

The switches I had (1mm diameter) fit perfectly in there, but broke upon removal, so had to be replaced. I think you can but plastic ones though?




#5 ~stεεlspectrum~

~stεεlspectrum~

    You ready to ride the Fist O' Pain?

  • 7526 posts

Posted 07 August 2016 - 09:40 AM

Hey, welcome to SSC! Gump has used magnetic reed switches before. I found a thread where he describes how he attaches them to the track: http://www.sscoaster...em/#entry322997


#6 Sporech

Sporech

    Member

  • PipPip
  • 28 posts

Posted 24 November 2016 - 04:30 AM

Hello! I'm extremely late but your tips really helped, and now my ride is finished. I will upload it some time :)








Also tagged with one or more of these keywords: arduino, trains, sensing