Jump to content
 

Dingleberry, a N Gauge test track


aleopardstail
 Share

Recommended Posts

Have been pondering this for some time, I'm planning a 2mm Finescale layout, however before I can do much with it I need something in N gauge - specifically for testing locomotives, running in, servicing etc prior to conversion and to test DCC installation. Additionally I want to experiment with some of the controls and sensors the main layout will have - stuff like block detection, automation and point location infrared sensors and similar. 

 

In effect a test track, it is desired to meet the following requirements:

  • use Code 80 set track, as I already have some and would like to re-use it
  • allow for DC and DCC operation, so will require the ability to engage or isolate individual sections of track from a control bus
  • provide a continuous run that can be used to let a locomotive circle for a while
  • be no more than 4'x2' in size, and able to be hung on a wall when not required - hence only a single level with no overly tall structures
  • be electrically self contained and able to run without requiring a PC, but to be able to be connected to a PC for testing
  • provide scope to experiment with scenic areas, buildings and platforms

 

The "theme" picked is one of an actual test track, a disused branchline converted for train testing and proving, think Old Dalby and you are on the right track if you excuse the bad pun.

 

This theme allows for a larger than otherwise justified locomotive stabling point as well as providing a reason for an oddball mixture of stock without going down the "heritage railway" route, the theme will be late 1970s/ early 1980s BR blue in general, with a mix of diesel and electric stock planned.

 

so far I have the following a a rough concept, opinions on which are most welcome, this is 3'6" long and 2' wide, the remaining 6" will be allocated to control hardware.

 

the idea is each platform road is set for a single direction but the rest is bi-directional, with each loop split in to effectively three blocks (platform, left hand and right hand). blocks likely switched, either via toggles between DC and DCC (or one and "off" when the other isn't connected), with current sensing that will likely only really work in DCC mode properly. I went with three sections really because four won't fit and three should allow some limited automated running with two trains chasing each other.

 

so far all I have is a 1st radius loop and some straight track, plus a basic PWM based DC controller made from an L298N and an Arduino, the first proper job being to design, procure the materials and build the baseboard, likely from thin plywood to keep the weight down

 

the rough track plan is still up in the air but this seems to have a better feel than trying to run a twin track loop then lacking the space to get extra trains out of the way - its odds on eventually this will have a few bits of rolling stock allocated and typically see a limited number of locomotives once the fine scale track gets going. this isn't specifically designed for long term operational interest as such, more just fiddling.

 

thoughts and comments very welcome, aware 1st radius is a bit tight, with the space I'm accepting that as it uses track I already have.

Dingleberry Test Track.png

Link to post
Share on other sites

Hi 

 

Don't forget that there are no plans to develop another UK test track in South Wales. This will be several loops of track, a high speed one for 125mph running and a slower loop for suburban trains.

 

The actual track plan would be similar to that shown, but no existing station, perhaps a staff halt to allow visitors to board the trains.

 

Nick 

Link to post
Share on other sites

2 minutes ago, stivesnick said:

Hi 

 

Don't forget that there are no plans to develop another UK test track in South Wales. This will be several loops of track, a high speed one for 125mph running and a slower loop for suburban trains.

 

The actual track plan would be similar to that shown, but no existing station, perhaps a staff halt to allow visitors to board the trains.

 

Nick 

 

about time the UK got a decent test track with high speed running ability.

 

note on the plan, while its sown as an island and a side platform it may end up with the inner road being flexi track and more "normal", the above is just what fits with set track

Link to post
Share on other sites

ok, slightly updated plans. I have realised where I want to go after this layout is going to take more time and there are various bits of technology I want to actually experiment with more in operation.

 

Also gradually realising that the two Lima Class 86 I have are not exactly finescale suitable.

 

As such I set about revising the plan slightly, what can I do to it to get a more interesting layout in its own right - while sticking to the basic principles, which in effect are:

 

- must be able to hang on a wall to get it out of the way when not using it (limits both weight and size)

- must be able to operate independently of a computer, but eventually be able to take advantage of one

- must be able to set up on my desk for operating and working on as well as elsewhere

 

I iterated the basic design somewhat within the 4'x2' space and ended up here, the "Mk5a" design (the Mk5 lacked the small fuel tanker siding). As can be seen the basics of a layout built around a locomotive depot are still present but now a twin track loop all round instead of only partial.

 

this was not something I was happy with though, as a pure test facility it works but not really as a layout, the storage sidings mean either 2 coach trains or a single train split between them, in effect where do the trains go to clear the track? 

 

I pondered for a bit, what if I add 6" to the depth of the layout? it will still hang on a wall, it will fit on the desk, just overhang by 6" which I can live with as its not going to fall off, its also still small enough to pick up and carry about.

 

this adds actually a hell of a lot of space, which resulted in the 6th iteration which I suspect may be what gets built

 

Here the two storage sidings are a sensible length to take a train each (with a locomotive if desired) or a fair few vehicles just stored to make trains from. the central depot has a slightly more sensible headshunt but it otherwise unchanged - incidentally the yellow bits are the PECO inspection pits, each "1.5 units" long to comfortably take a locomotive, the shed is a pair of the PECO manyways sheds end on end - I've worked on depots and the idea of the locos only just fitting in triggers me, so here something like a Cl47 can be centred over the pit, or a pair of smaller locomotives put in place, should just look better.

 

the inner mainline gains a loop at the station, which itself gains two more sidings to form a parcels depot (the eventual layout features a parcels depot as an overly long Inglenook so this gives space to accumulate stock for it)

 

ok its still all C80 set track but with curves this tight is always going to have a "trainset" feel so I can live with it as this is somewhere I can set up and populate with a decent amount of stock. I can experiment with DCC and some automation, two trains can run while a locomotive does a bit of shunting around in the depot too.

 

I did think of changing the sidings at the bottom to give them a head shunt, however this is 16 turnouts (+/- my inability to count) which fits the servo driver I have nicely, plus I don't want every single inch with track on it.

 

planned road access to the centre is via an over bridge in the top left, however I may consider changing this to be a road under just because its a bit different and one bridge isn't really a scenic break in the loop anyway.

 

plan is to sit on this now for a week, and unless anything significant occurs, get the plywood sheet ordered later this week as part of a Wickes order for some bits for the office anyway.

 

I've got most of the track to at least make the inner loop, just need a few more turnouts which are like rocking horse doo at the moment

 

Dingleberry mk5a.png

Dingleberry mk6.png

Link to post
Share on other sites

  • 2 weeks later...

in the sleepy town of Dingleberry things begin to stir, rumours abound of a delivery of plywood, though locals claim not to yet have witnessed it, there have also been curious noises, the sounds of ancient electric motors being tortured into life, the smells of ancient lubricants warming up, the curious sight of a pair of class 86 moving under their own power without any OLE, strange piles of track are appearing...

 

Both of the class 86 now have digital decoders installed, I think pretty much all the required track is assembled or arriving this week, I have managed to get JMRI talking to the DCC++EX base station without causing too many explosions, even got both the ancient Lima locomotives working - the two Poole era Farish diesels look on and hope they will get a turn too.

 

with luck baseboard construction starts at the weekend, a way to go before track is fixed down as I need to get some surface mounted IR sensors assembled so they can be tested prior to starting to drill too many holes (think the 5mm IR LED detection things you can get on eBay, but using much smaller sensors and emitters that will fit between sleepers in N gauge), likewise some current transformers to assemble and test.

 

However if the board goes ok, with luck some time next week there will be track at least resting upon it while some testing goes on

IMG_2150.JPG

IMG_2166.JPG

IMG_2183.JPG

Link to post
Share on other sites

Basic shell of the baseboard is done, "just" need to add the cross bracing (after working out exactly how to secure it at the ends.

IMG_2202.JPG.29629d146d35d305ddb69928607a4db5.JPG

 

9mm ply frame, with stripwood blocks to screw down into from the deck.

 

IMG_2203.JPG.969533208fbf90efeafdeec5fc197c29.JPG

 

glue drying overnight now, but a 4'x2'6" board taking shape. Not amazingly rigid but then as noted it lacks the bracing currently.

 

thinking of some temp wooden posts to stick up places the screw holes won't matter once the upper surface has some sound deadening added - point being to protect the track while I'm working on it when the board is upside down.

 

Nice to finally be making a bit of progress from a paper plan

Link to post
Share on other sites

more progress, the baseboard is now assembled!

 

IMG_2215.JPG.a69c2e667c119dca4c900c4d92c14ff5.JPG

 

shown in the home it will have when working on it. 9mm ply construction, 4" deep sides and 2'6" x 4' overall.

 

IMG_2210.JPG.6477e4e3d3543e818429c677654c8514.JPG

 

simple "X" crossbrace, thanks to those on the forum who helped with the design, its very rigid and can be easily lifted with one hand - though it is bulky due to the size.

 

I can see fitting a couple of handles on the front edge and a bit more bracing to allow it to hang on a wall.

 

the holes are for allowing electrickry to be performed, the X is also only 3.5" deep so will be some space under it if needed. Its likely to get a few short legs (as in about an inch) which can have felt added to suit and protect the desk.

 

naturally I had to have a go at laying the track out just to see how it fitted.

 

IMG_2216.JPG.e03390537470dc963dedb9f6331c08c5.JPG

 

the lengths of flexi obviously need cutting and some shuffling will be done, may need a few more lengths of either flexi or the double & standard straights which may be cheaper due to postage on flexi track..

 

on the plus side the design does actually fit, which is nice.

 

next step is to get something to cover it to act as a sound barrier as boy gork this is one hell of a sound amplifier board, then a few tests on some sensors etc and can start to actually fix the track down and then run things.

  • Like 2
Link to post
Share on other sites

more progress, some XPS floor covering is due tomorrow which will be the sound insulation, in a lovely shade of pink so there may be a bit of painting to be done soon.

 

made a start cutting flexi track to length, none of this is powered up yet as the electrical schematic has yet to be finalised.

 

IMG_2217.JPG.fc0ef8dac3f43eff41bd06b8b9badf7d.JPG

 

two train storage sidings along what will be the front of the layout, each able to take four Mk1 coaches and a locomotive, which is more than I'd normally be running here - expecting closer to two or three coaches to fit within the planned signalling blocks (which are unrealistically short but this layout is as much about testing design ideas as testing stock, get it right and will be able to have a pair of smaller trains on each loop chasing each other through the signals.

 

IMG_2218.JPG.b84dabd3c9c9c24befb3d2b8cb7dfcf1.JPG

 

station area has gained the inner loop road able to manage push through running and the flexi for the two main loops is cut but not yet installed, can also see the start of the parcels depot area, though the siding will be replaced with flexi to get the length right - three Mk1 coaches on each road and since an extra 17th turnout has been found I'm considering a further siding alongside here, the curved road on the middle right of the picture being the headshunt for this area as well as the loop platform road

 

probably not "safe" working practice but its a 4' long board, so shoot me.

 

its all just sitting there for now, to be removed when the XPS goes down and the glue sets.

 

 

Also had a number of IR sensors arrive,  the ones using the 5mm IR LED & Phototransistor. Quick experiment showed they will pick up N gauge stock reasonably looking up through the sleepers, however the plan is to remove the LED & Phototransistor and replace with short wires to a small circuit board holding a pair of surface mount devices that will actually fit between the N gauge sleepers and likely work a lot better.

 

all good fun.

 

Plan is to get the outer of the two loops properly installed first as electrically this is the most simple - needs four power feeds (with occupancy current transducers) and four IR sensors, likely a couple of weeks before the stars align and thigs can be glued down properly while I fiddle with the various bits to go between the track and the board it is however likely the track will be added and not glued for some testing so should be able to make things moooooove

Link to post
Share on other sites

Flooring didn't arrive, rescheduled for tomorrow apparently, can live with it. However some wire to make droppers from did turn up so could hardly resist soldering a couple of power feeds and seeing if it worked

 

IMG_2224.JPG.7de8febaf689242c31462a3614ab17fe.JPG

 

First powered movements at Dingleberry

 

a few issues with some of the points have been discovered, e.g. none of the sidings get power, suspect the second hand points are not switching right, should be solved with a bit of cleaning, destined for individual power feeds anyway so not too bothered.

 

I do suspect the economic viability of the two trains shown is somewhat questionable though

  • Like 1
Link to post
Share on other sites

foam to clad the board in arrived today, so cleared all the track off and dusted a bit, then stuck it down, leading to two interesting discoveries

 

1. copydex stinks every bit as much as I remember

2. moggies stay out of the room, this is useful information

 

IMG_2225.JPG.34b5a15249a60c431ae5e44342efdbc7.JPG

 

lilac colour and not bright pink, which is a sort of bonus

 

printed the track plan off and stuck that down, line in red is where an additional siding may end up, storage road for the parcels depot.

 

IMG_2226.JPG.93a85908a8ed1e6754b2cf59f912c9c5.JPG

 

rest of the track is now here, though not all the rail joiners yet, however once the glue has all dried I can start marking out the electrickery bits and drilling holes for the wire droppers and point servo motor actuators, plus the planned location for the infra-red position sensors - the parts to actually make the sensor heads may be late May though - I can at least get the track assembled and droppers added in the mean time, just can't really fix it down or wire it up properly

  • Like 1
Link to post
Share on other sites

Everyone needs a shed, and two are better than one, these arrived earlier

 

IMG_2229.JPG.5460235b3ba8d3db9fb2a0d6b67f6f7e.JPG

 

the exterior looks decent, needs a brush taking to it to weather it and stop it looking like and unpainted plastic kits, the inside is less impressive, it will do for now, will be given some lighting but I can see making my own to have a bit more internal detail at some point - I want some offices along the side facing the camera as well, or portacabins at least.

 

that said they look the part.

 

also starting to prepare for some experimentation around mounting servos and sensors, so the test layout has gained its own test layout, a hellishly impressive one

 

IMG_2230.JPG.501596dacab99ca83bde199d30ae8443.JPG

 

spring removed from the turnout, waiting on the piano wire arriving and will have a go at mounting a point servo, can attach bits of track with power feeds via current sensors but leave them unsecured pending the IR sensors going in at a later stage.

 

for the main layout the turnouts can be installed prior to the sensors being finalised so thats the plan, I just want an experiment for the mounting first.

  • Like 1
Link to post
Share on other sites

a bit of progress, first up four points went down, with servos attached

 

IMG_2232.JPG.ed22bb025398862cc31ff508034bca37.JPG

 

and from below

 

IMG_2231.JPG.6ad5fa1e09f763b121d79c861a81e732.JPG

 

simple, not terribly original but it works, the driver at that point looked thus:

 

IMG_2234.JPG.0532e5e8f691e4749f53cf61e932aa3b.JPG

 

its crude but it works, its since gained an EEPROM chip which has been tested but isn't yet used - it will store the default settings and power on positions when I get it coded. The screen and keypad are likely to end up on wires mounted elsewhere to plug in as this will end up on stripboard under the layout.

 

after this the track to support these two electrical blocks went in to experiment with current monitoring

 

IMG_2233.JPG.1dead0a65668b87e5e464afeb552fd50.JPG

 

the current sensors need more work but the droppers are in place.

 

that was over the last few days, today a bit more went down

 

IMG_2237.JPG.f08f968ed3243d7dd2176be939c79e31.JPG

 

the two storage sidings went in first, the gap in the sleepers is where the droppers are, each siding being its own electrical block.

 

then two further blocks were added completing the outer loop, again droppers in place, though these have yet to be electrically tested

 

IMG_2238.JPG.e10d991526fddb45efe1f8c025842539.JPG

 

the current monitoring can be seen bottom left, it works, almost, the 10 bit ADC on the Arduino Nano not being quite enough, picks up moving locomotives easily and will pick up two stationary ones but can't see a single one.

 

have some 16 bit ADC boards arriving later this week which should nail it.

 

it is possible there will be a further electrical block added, for signalling it will be a sub block but may as well hook it and monitor it individually.

 

Jobs up for the next few weeks are creating the Infrared point sensors, which means making some small custom circuit boards to hold the 0805 SMD devices (LED & phototransistor), once they are assembled, tested, working and installed this loop can be fully glued down. prior to that it will be getting powered up to be tested

  • Like 1
Link to post
Share on other sites

Dunno who this project is torturing more, myself of both viewers..

 

regardless! progress!

 

the sensors are working reasonably well, at least well enough to fit them and worry about making them work better with a bit of signal processing later.. so this afternoon I removed the cat, tidied the board up, put the stock on the shelf, after removing the cat again (seriously I'm buying a water pistol) and flipped to board on its end - oh the benefits of a portable board - as and when a larger layout is built, it *is* being made in sections.

 

and while on its end I added the current transformers and generally tidied up the dropper wires then added the DCC bus wires - not fixed as they will end up cut to add more sections (hence the slack)

 

IMG_2241.JPG.0452a7050fb32d79c111367050168380.JPG

 

its a mess, none of it is labelled, what could possibly go wrong?

 

then some very temporary wires from the sensors were added - these will eventually terminate "somewhere" on the underside, but for now go to the top in one corner

 

IMG_2242.JPG.7103fd60e617cb725ddbd838bd38849b.JPG

 

servo controller not yet installed as I want to do a bit more with it first.

 

board flipped back round, no cat related trouble as the furry terrorists had taken the hint

 

IMG_2243.JPG.6da4b9b60d319f54ead06316b60c042e.JPG

 

its worked! no short circuits or wires the wrong way round - test train went round quite merrily - though the ancient traction tyres on the Class 86 are long age hardened so three coaches becomes an issue with the fact the board isn't quite level on the shelf.

 

Glad I didn't add a deliberate gradient really.

 

ok, thats the DCC wiring to the blocks, what of the sensors?

 

IMG_2245.JPG.0752ef69536d2f98738a31a527da3acc.JPG

 

well the monitoring block is to the right, so far five blocks, only four monitored as I need to assemble another board, but these are the results so far:

 

screengrab.png.4fc82505ff51609b89bd804e60eae72b.png

 

you can see the train starting in the first column, vanishing into the unmonitored block, then reappearing in the second column and finally the 4th column.

 

issue so far is the spurious readings when no train is present - cut the power and they all show nothing, a train stationary and it reads around 0.9-1.3, with then other blocks then around 0.01-0.05.. the sensors appear to be picking up a lot of noise or stray magnetic fields - I suspect its electrical noise in the wires though - may have to have a look at some filtering techniques.

 

but, hey a train can run, so progress :)

  • Like 2
Link to post
Share on other sites

a bit more progress

 

have now hooked up both the long sidings, have also nailed the current detection so it works and works reliably

 

Block-detection-circuit.png.c08d642f7c676b15349d8e1d51d1a13a.png

 

basic circuit, but it works, will pick up a 10k resistor, which is sensitive enough for me.

 

Also had a play with JMRI & C/MRI, adapted the Arduino to speak "C/MRI", resulting in:

 

Panel-01.png.216a9714a918706f0d5400b6d20874b6.png

 

yes, not that impressive I admit, not sure why the block at the top is black, anyway this is reading the seven block occupancy detectors, showing the locomotives sitting in the two white blocks, and it updates nicely as they shuffle around.

 

minor problem, the servo controller I have for the points isn't an Arduino, nor does it talk DCC.. Its a Raspberry Pi Pico RP2040 board... which doesn't speak C/MRI.

 

Hmm.. so into the C/MRI arduino library, which actually isn't using anything special in the hardware so I had a go at a modification...

 

IMG_2251.JPG.d621592ccd1b77f9b5c66a5e31025d7c.JPG

 

the first prototype of a Raspberry Pi Pico RP2040 MCU communicating with JMRI over the C/MRI protocol, ok again not that impressive, it just controls one LED - however the fact it worked at all amazed me, next up is bi-directional stuff but then critically, controlling the PCA9685 board to start driving servos, and eventually to take over the world.

 

the code is very much a bodge currently, I want to clean it up a bit so its a compatible version of the main library not a hacked separate file - to be honest its nothing special, the only bits that needed changing relate to the serial port comms code

  • Like 1
Link to post
Share on other sites

Bit more progress, I combined the C/MRI & RS485 code and hardware with my previous servo controller, added it all up and got this gork awful mess

 

IMG_2254.JPG.737143c0629314c742bd7964effe098b.JPG

 

however while ugly, and in dire need to be fitted to stripboard and nailed on the underside of the board eventually it works, sensors still need some calibration but they work.

 

Panel-02.png.df19c4e0197e003155559ff270c86e06.png

 

can now drive what there is of the layout from the computer. the next step really is work on the infrared position sensors and to add some position feedback for the turnouts.

 

there is another PCA9685 board on order which will become the early stages of some colour light signals, probably oversized mock up ones initially to get used to how they work, the layout isn't in a suitable state to add actual scale ones as yet which would be way too fragile

  • Like 3
Link to post
Share on other sites

Um, wish I'd seen this topic before I built the board for Locksley & Lower Ruston....  your method of cross bracing might have saved some weight. It's starting to get a little heavy and bulky at 4' x 3' and desk/table mounted. Still more woodwork to go on it as well yet....

 

Edited by harryw2806
Link to post
Share on other sites

10 hours ago, harryw2806 said:

Um, wish I'd seen this topic before I built the board for Locksley & Lower Ruston....  your method of cross bracing might have saved some weight. It's starting to get a little heavy and bulky at 4' x 3' and desk/table mounted. Still more woodwork to go on it as well yet....

 

 

It would (wood?) have been a lot heavier if not for the good denizens of this site providing some much needed advice on what would (ply?) actually work without being overkill.

 

its 9mm ply, it could probably have been 6mm and still worked.

 

have not tried to move it too far but on and off the desk it sits on isn't too bad, basically kneel down, slide it forwards and can get a hand on the centre of the "X" which makes a very good handle.

 

lesson so far though: it needs handles on the sides just to make stablishing it easier, also a bit more thought about where the electrickery bits will go would have been useful - specifically how to access them during this build stage - wondering on cutting out some of the side at one end to make an access point - eventually covered by a removable metal plate that can have things like USB ports and a power connector added.

 

there is quite a bit more to go on here as well (needs at least a low backscene on three sides and a facia on the front, indeed one end likely needs to be lower as well - but this needed to protect the scenic bits) so a few concerns about weight here, in retrospect  actually going 4'x4' or 4'x3' but in two halves would have been a lot better, the design seems made for it really and would have made working on it a lot easier.

 

still the point was to be a learning exercise.

 

Before more track goes down (and I do actually have the rest of the track) I need to get some experiments with printed circuit board manufacturing completed

Link to post
Share on other sites

today has seen some initial experimentation with preparing the sensor PCBs, not quite successful enough to etch, but learnt a fair bit, will have another go tomorrow

 

IMG_2267.JPG.27e586c9439879efa64993583a5052d4.JPG

 

second attempt, better than the first but didn't quite transfer correctly. rectangles are pads for 0805 components, then circular pads for connecting wires. the four pads in a row fit between N gauge sleepers nicely

Link to post
Share on other sites

managed to sort the PCB issue out, went with a wet chemical transfer method that worked pretty much spot on

 

IMG_2268.JPG.1ca55984c259a84f4fa8f930d6d2b16d.JPG

 

8:3 mix of Ethyl Alcohol and Acetone, pattern printed on a bit of a magazine (thin glossy paper), pattern placed over the cleaned board and the chemical mix drizzled over the back. left for a few seconds (long enough to recap the bottle really), then pressed down through a bit of kitchen roll, came out as above, nit perfect round the edges but the important bits worked.

 

when the weather cleared up Saturday I had a go at etching it

IMG_2274.JPG.32829a8eff9450eb370627f9a8a98f4e.JPG

 

came out very nicely, better than my accuracy with the drill at least *hangs head in shame*, will get there though.

 

for scale with a bit of N gauge track

IMG_2275.JPG.3d46b461932aa5e9351f7beffa5027ee.JPG

 

will be ordering some bits later this week to assemble them, planning to try the HW-201 infra red proximity module boards but also a custom circuit as I want to add a bit of hysteresis into the response to save having to debounce the output before using it.

 

have also made a (small) start with some scenery, nothing fixed in place and done mostly to get a handle on the scale and size of it

 

 

IMG_2273.JPG.e9e07363edb41d15173bc0ff0eea19f2.JPG

 

Metcalfeville strikes again, picked up some paints for the exposed edges to experiment with as well

Link to post
Share on other sites

Experimentation updates, parts arrived earlier to assemble the IR sensors, so the first prototype have been assembled and tested.

 

IMG_2279.JPG.984e73b7617560717a745a8f140e1a06.JPG

 

here it is post assembly but before painting, the two 0805 SMD components in place (both from Kingbright, a KP-1202F3C 0805 infrared emitter LED and a KP-2012P3C 0805 infrared phototransistor - the two being designed to work together).

 

they are meant to face each other to act as a photo-interrupter however here being used to project a cone and catch a reflection.

 

initial testing showed light bleed between the two, so the head was painted (it was going to be painted anyway)

 

IMG_2282.JPG.464eafcd3f4aca3fa8587371ce442149.JPG

 

this left just a small window exposed, when tested with an arduino and a couple of resistors (a 180 ohm for the LED and a 10k pull down on the phototransistor - limits current flow nicely and the extra response speed isn't needed here for a lower resistor), this works, could see a bit of paper up close.

 

IMG_2281.JPG.9920f82a3bf787855bedec2b1f20335e.JPG

 

this is the basic test setup, the arduino is set to measure the analogue input for the sensor voltage, 0-5v, this to provide an idea of the range we will get - eventually this will go via a comparator and a reference voltage for each sensor, of which more below.

 

IMG_2283.JPG.dc3f68ee1529d296d9e5334332d46d54.JPG

 

initial test, the Arduino on board LED is set to illuminate at about 0.75v (found by experimentation). the 0.5v reading is essentially ambient light being picked up as the sensor is pointing directly upwards.

 

sliding the coach along a little

 

IMG_2284.JPG.a94d378c13dd31e2d14dd2ff62e68f38.JPG

 

reading goes up as the coach underbody reflects a bit of light - the issue is the underbody is black, which absorbs the infrared light, so the underside of the coupler housing has been painted white, also tried a bit of the actual underframe, which while it can be seen is a bit too far to be easily distinguished from ambient light levels, I suspect it will work better in darkness.

 

so it works, mostly, I was going to give each sensor a fixed reference voltage (well a potentiometer but designed to set & forget between 5v and 0v). I think I may consider a reference voltage that includes a second sensor for ambient light, hence we check for a threshold as a percentage of the ambient light level, not hard to do, just means having a few ambient sensors dotted about, then hooking the potentiometer to the output of them, will have to experiment.

 

anyway, a bit more work with this one and will install it into the actual track to test it in more detail. Not too bothered if I end up putting a bit of white paint on the bottom of coupler housings to make it work reliably.

Link to post
Share on other sites

Second version of the sensor head assembled today, this one moves the LED current limiting resistor and photodiode pull down resistor to the head itself, simplifying using it considerably, have also added a second phototransistor that sits adjacent to the track - this one to pick up an ambient light level. Idea being to use the different between them to detect a train.

 

Still feeds into an arduino, results are mixed, this design puts the emitter and detector with a sleeper between them which I don't think is a good idea now.

 

measured voltages back are lower (the sensor isn't getting enough of the light bouncing back)

 

room ambient light and the sensor head (between sleepers) picks up 0.01v, basically its seeing nothing, the ambient sensor seeing 0.03v.

 

move the white painted part of the train into view and as expected ambient doesn't really change, the sensor head is now seeing 0.11v

 

so the delta between them changes nicely.

 

the difference now is when the light is brighter, bringing a desk lamp near and ambient reads 0.13v, with the sensor reading 0.11v

 

being the white bit of the train in and again the sensor sees the same 0.11v, hmmm.. however, as the shadow of the rest of the coach passes the sensor now drops to about 0.04v, so now the readings are the other way around but the variation between them is still enough to detect a train

 

the first version couldn't cope with brighter ambient lighting as it would see a higher voltage and register a train.

 

ok, more work needed on the sensor design to get the emitter and detector closer together in the same sleeper gap, I want the voltages back to where they were before up to about 1.5v, or maybe slightly higher, will also move the ambient sensor to be slightly further out to avoid some of the shadow falling over it.

 

ironically the surface mount stuff may actually be a bit too small, as in shallow profile, could do with being nearer the top of the sleeper than the bottom - may be worth adapting the sleepers with a file to reduce the profile where the circuit board will end up.

 

 

basic concept works though and once ballasted would be essentially invisible unless you knew where to look

Link to post
Share on other sites

Sensor V3 prototype board ready for etching

 

IMG_2286.JPG.b127a33ea71d47172ab683fe0e8ba8ec.JPG

 

easy enough to change it and make another one, so I did, etch likely tomorrow (I hope), build next week, need more 0805 resistors. note the design now has the pull down resistors and the current limiter for the LED on board. 

 

Ambient sensor (two sets of squares along the bottom) is a bit further from the rails, the four circle are between sleepers outside the rails, sensor and emitter back adjacent in the same sleeper gap - will also be angling the emitter and sensor slightly to try to get a better reflection

Link to post
Share on other sites

  • 2 weeks later...

slight delay, waiting for some bits. 

 

anyway, first sensor head was built and tested, it worked, so a second was built for a bit more testing in situ this time, looks thus

 

IMG_2291.jpg.3848cc9c5a37aad798dbab543c741b7e.jpg

 

the black painted circuit board is flat with the bottom of the track, wires down through the board, needs painting grey before the track gets actually stuck down properly.

 

have to remember to cover them when painting the track and ballasting.

 

hopefully this shows why I'm avoiding the ebay "IR position sensor" modules with the 5mm LED form factor devices, these should be invisible once ballasted and painted up.

 

testing!

IMG_2292.jpg.92c1dc2cf1b47caf5db396df5655012f.jpg

 

1.48v output without a train over the sensor head.

 

IMG_2293.jpg.97759e40406df9989c2274b35e16167b.jpg

 

2.46v with a train.

 

the head has a second ambient light sensor, it feeds into the analogue inputs on an Arduino (Uno currently but will be a Nano with three connected and the I2C pins clear), this means if the light is brighter I can use the ambient to provide a differential sensor spotting either the reflection or the shadow the vehicle casts.

 

only mode to the coach is a bit of white paint under the coupler housing, it will "see" a train without that but the delta is much less so this is a bit more reliable.

 

if this was OO I'd use a PCB sleeper with the sensor and emitter mounted directly to it

 

now I know the sensor head works I can build & install others, the below board gubbins can come later, this has been the hold up for track laying

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
 Share

×
×
  • Create New...