Philip

F1p Train Optical Detection

32 posts in this topic

Hello everyone,

Some of you may of seen my little project in the Workbench topic, but here is the official topic for my new product, Train Optical Detection.

 

gallery_162_62_37355.png


F1p Train Optical Detection is a cheap alternative to Infra-Red train detectors, in locations where there is light.

Where Infra-Red detectors can work in any light conditions, they are much more expensive, at £20+ for one detector!


How does it work?

gallery_162_62_3073.png
As the train passes over, the detector notices the change in light.



How easy is it to set up?

Each detector needs to be placed between the sleepers, then connected up


gallery_162_62_269453.jpg
A detector between the sleepers, each detector is 5mm in diameter and fits between "00" Gauge sleepers


gallery_162_62_1893.png
Cable diagram shows for 2 detectors, and how they can be chained together. Soldering to the PCB at the "Pin" end is required.



http://mrlforum.co.uk/forums/uploads/gallery/album_62/gallery_162_62_396018.jpg
An example of the PCB and mounted microcontroller, cabled soldiered through the holes.


gallery_162_62_4181.png
The diagram for an LED on a control panel, where the LED will light when a train is detected.


gallery_162_49_893551.jpg
The small block of wood over the track simulates a train, and the LED lights up.


Up to 8 detectors can be used with one Microcontroller.


Advanced Features?

Yes!
The main feature is computer control, where connecting it to a computer, the information can be sent back to display on the screen.

gallery_162_62_24767.pngA graphic display, where a box on the line indicates a train is over the sensor. White when a train is overhead.





How much and what do you get?

  • Ready to use Circuit Board and mounted (removable) Arduino Nano microcontroller
  • USB Power Cable
  • 8 Optical Detectors

gallery_162_62_456748.jpg


Prices: £20 + £2 Postage = £22


FIRST 9 UNITS AVAILABLE VERY SOON.


 


gallery_162_62_483732.jpg

gallery_162_62_231595.jpg

CrownStreetTMD and Jack like this

Share this post


Link to post
Share on other sites

I am certainly wanting one :) Is there a simple wiring diagram that comes with it? 8 detectors is perfect for what I need.

Excellent work Phil. Hope they sell well. If you make a video for it, im sure we can shove it on YouTube.

MRLm.png

Share this post


Link to post
Share on other sites

Updated the installation guide above, forgot to include some vital parts.

Please also note i have one PCB & Microcontroller with an unreliable USB data connection after an accident!

The power connection works fine though and all other functions, but advise it as a LED/Control Panel version only, unless you have a fiddle and try and get the USB connection stably for computer control. Because of damage: £15 + £2 p&p.

Share this post


Link to post
Share on other sites

Ahhhh! Exams finished!

That means i am ready to dispatch these as of tomorrow!!

Drop me a PM :)

Jack likes this

Share this post


Link to post
Share on other sites

gallery_162_62_603397.jpg

Spot the Detector!!

gallery_162_62_28568.jpg

PCB Mounted on my control panel

gallery_162_62_957321.jpg

gallery_162_62_1836710.jpg

gallery_162_62_2140902.jpg

Mounted and powered

Going to make a video for YouTube as a demonstration as well.

Jack likes this

Share this post


Link to post
Share on other sites

gallery_162_62_603397.jpg

Spot the Detector!!

Found it! Just to the right of the frog on the point :) Not very visible though, which is a good thing!

Can't wait to get my hands on it. When I feel happy about how to wire it all up with your video, then I may have to order myself a set :)

Share this post


Link to post
Share on other sites

Seem to get to around 6 minutes then the video freezes. Not sure whether it's me. Sorry :P

Share this post


Link to post
Share on other sites

it happens to me aswell

Share this post


Link to post
Share on other sites

Same... think it's YouTube's problem, the original works fine, just YouTube get's stuck.

Re-Uploading.

Share this post


Link to post
Share on other sites

Works now. Great video!

Does it come with software so you can put on your own track plans and can you have more than one connected to the same computer software?

Share this post


Link to post
Share on other sites

I drew my trackplans in powerpoint, then saved them as an image file - which makes the background.

It's written in Processing (http://processing.org) and interfaces easily with the microcontroller.

The fiddly bit is placing the detector dots ontop of the trackplan and lining them up.

Happy to help you get started with some computer feedback if you are interested.

I haven't tried multiple connections myself, it may be possible though.

Philip

CrownStreetTMD likes this

Share this post


Link to post
Share on other sites

post-162-13416504441542_thumb.jpg

Modified mine here, changed the "output" side (grey) to power LEDs all over the layout.

It does mean that any track inputs (blue) have to be read on a laptop.

MRLm.png

Share this post


Link to post
Share on other sites

We have fixed a major problem we had in our original Kernel, and have expanded the capability of our computer control system greatly for users & developers.

Users on the old Kernel can still use the system perfectly well, but if your looking to develop, we advise upgrading once the new release is available.

We are testing the new code as of tonight, but we have added & changed the following:

  • Added "Heartbeat" LED on the Microcontroller to indicate that it is fully up and running.
  • Kernel includes Firmata 2.3.2
  • Kernel & Computer Control now allows: Servo Motor Control, PWM, Digital I/O, I2C (For connection to devices such as the Raspberry Pi) and much more :)

Jack likes this

Share this post


Link to post
Share on other sites

I have been testing out my signal control system in my fueling depot tonight quite successfully!

gallery_162_12_2809338.jpg

Between the fueling depot there is a "Halt" light, which now has 3 functions depending on what detectors are detecting trains in the depot.

For example, parked at the end of the siding, the LED will Flash - notifying any incoming trains that they can proceed no further than the second fueling depot point.

And if there is a train in the second fueling depot point, the LED will stay solid - notifying incoming trains that they must stop.

post-162-0-84070400-1343507658_thumb.png

I also updated my processing control panel, with a live clock and control of other lights around the layout (individual control)

Jack likes this

Share this post


Link to post
Share on other sites

Oooh very clever! Flashes when the next block is occupied, then solid light when that block is occupied. Very good Phil! Am liking the little screen shot too :)

Share this post


Link to post
Share on other sites

Oooh very clever! Flashes when the next block is occupied, then solid light when that block is occupied. Very good Phil! Am liking the little screen shot too :)

I was trying to explain it above but it wasn't going well haha, so yeah, the video demonstrates it much better.

Jack likes this

Share this post


Link to post
Share on other sites

I am currently working on a way to fit the biggest flaw with this system, changing light conditions and sensors in very light and dark area's.

Currently, the system has a standard threshold, that when a train sits above, the light drops below the threshold and it "detects" a train.

But i very light, or very dark conditions this threshold doesn't work very well.

So to solve it, when you first turn the system on, it will read all the sensors individually once - and decide how bright the light is on each one, then create a threshold for each individual sensor, solving the problem.

Share this post


Link to post
Share on other sites

Ordered a Raspberry Pi, the £30 computer to run the computer interface and a 7" TFT monitor to fit to my control panel.

Share this post


Link to post
Share on other sites

Jack was asking about running ToD directly from the Rasp Pi,

I have looked and the Pi only has Digital General Purpose I/O pins (GPIO).

You would need to make a new circuit board with a few more components to change the detectors into a digital response, and then they wouldn't work in changing light conditions only at a value you set when you buy components.

So really the best thing is you require the Arduino and can't substitute the Pi for it.

Jack likes this

Share this post


Link to post
Share on other sites

Hi Philip how do I share this thread with Paul_l ? It's right up his street  !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now