# Momentary (light activated) occupancy detector



## tankist (Jun 11, 2009)

looking at what is available, or rather unavailable i started designing my own subj . over the weekend i bread-boarded a working prototype circuit, expanding on Rob Paisley's voltage comparator concept somewhat. while perf board might be fun and all from the volume of connectors it seems it will be much easier to just etch a PCB. so this evening i worked on PCB layout for a 4 channel device. local indication LEDs are mounted on board. to prevent any issues with current leakages and/or grounding the circuit has opto-isolated outputs (that will connect directly into digitrax or team digital device inputs). to save space on PCB all the connectors aside of power are headers and high density ICs are used. as modeled so far it fits on 3x1 inch footprint (quick 3D model attached).










wondering if there might be interest on part of others in either the PCB or the ready circuit. i don't intend to make it a business but while i'm etching my 4 PCBs (or two doubled up ones) i might as well do couple more.


----------



## gunrunnerjohn (Nov 10, 2010)

Can you describe the overall operation? Exactly what is the input sensors and what characteristics for the outputs?

I'm thinking of occupancy sensors for signals on the layout I'm working on. Of course, this is O-scale and AC, so that might affect the PCB design.


----------



## tankist (Jun 11, 2009)

inputs on right (2x4 header) are 4 photo-transistors to be installed between the rails (3mm ones can be included). header on left is the output, drived by opto-coupler 4 collectors and common emitter. this is a momentary detector - when given photo-transistor is covered by car passing over it corresponding output goes high, lighting a led and opening the coupling . if need be this can be modified to drive heavy loads such as turnout coils.

whether layout is AC DC doesn't matter. as drawn the device is powered separately by a 5V supply (old cellphone charger). i'm trying to squeeze a universal rectifier to make it work regardless of power input or polarity.


----------



## gunrunnerjohn (Nov 10, 2010)

I was more interested in the input and output characteristics, I have a box of wall warts, so powering things separately isn't an issue. 

Have you given any though to a delay after actuation before the output opens again? I'm thinking of a train going over the sensor keeping it on until it's truly passed.


----------



## tankist (Jun 11, 2009)

i'm shooting for about second delay between the moment sensor goes bright and output shuts off. will be achieved with small capacitor. it is needed anyways to prevent jitter on the output not to drive the decoder inputs mad.

as drawn the input is via photo-transistor connected to headers, output is via TLP504A−2 (sheet) opto-coupler, sufficient to drive a LED or two. upon request can be augmented with darlington to drive higher loads (i have a bunch leftover form my CDU project)


----------



## gunrunnerjohn (Nov 10, 2010)

I guess in that case, you could simply increase the size of the cap to allow longer turn-off delays, right?

10MA out of the opto-coupler, sounds like an LED is about it. That would certainly need help for any serious non-indicator work.  Looks like you're already using some of that current capability driving the on-board indicators. I like the idea of some indicators on the board, makes setup and troubleshooting so much easier. 

I have several of the Lionel SC-1 and SC-2 controllers, the SC-2 has relays for each of it's outputs, drives 15A loads, enough for almost anything. Obviously, they don't serve the function this board does, but I like the flexibility of relay contacts.


----------



## tankist (Jun 11, 2009)

yes, the capacitance will be one of the factors determining the delay time.

onboard indicators together with optocoupler inputs are driven by the comparator. 10mA? strange, i'm reading "Collector Current" as 50mA, which is 2 LEDs. this is perfect for logical level device , ie SIC24AD (5V with negative ground, 4.7Kohm pullup resistors on each input). for anything higher you will obviously need to use appropriate part, ie transistor, darlington (which i can install) or a solid state relay (its 2011 today). 

you never voiced what is it that you intend to drive . 15A? train activated circular saw?


----------



## gunrunnerjohn (Nov 10, 2010)

The recommend operating current is a maximum of 20MA, the 50MA is absolute maximum rating, not something you want to plan on.

I just noted that the relays in the SC-2 are rated at 15A, however the little connectors to it probably would melt if you tried to use that 

As far as the real capability of those opto couplers...


----------



## tankist (Jun 11, 2009)

i'm planning on ~ 1mA (5v/4.7Kohm). and just to be entirely correct not from, but through  the coupler, the source here is the decoder. could be driven directly by the comparator but OC is a cheap protection from all kinds of unexpected grounding and such.


you never voiced what is it that you intend to drive .


----------



## gunrunnerjohn (Nov 10, 2010)

I love the idea of the opto isolation, I do that for lots of things. It simply insures that you don't have some sort of nasty interaction. 

Good point on the drive for the LED, I forgot that you might have separate ground/supply for it.


----------



## tankist (Jun 11, 2009)

version of the PCB is ready. 
board handles 8 photo-transistor detectors. there is about a second signal release delay after detector goes inactive (accomplished with 555 timer ICs). output is via 8 LEDs and optically isolated 10pin header connector. coincidentally layout of the 8 output pins matches perfectly the layout of 8 inputs on Team digital SIC24AD devices that i have on order. the size is 4x4 which will match the long side of the signal decoder.

the use of space and layout of parts might be not efficient, but so far only few connections have to be added as jumper wires.
























so i finalize the board layout and then stumble on simplified circuit using 2 less ICs 
will breadboard the concept and then back to drawing board... hwell:


----------



## gunrunnerjohn (Nov 10, 2010)

Are you doing single sided boards? What are the skinny yellow lines? What board layout package are you using?


----------



## tankist (Jun 11, 2009)

skiny yellow lines is the connections i failed to create traces for. these will be jumped with additional wires. well, thats my very first attempt at creating a PCB so i can't do better just yet. it is single sided to keep from mask alignment issues.
these were done with NI Utiliboard, i'm lucky to have an acquaintance in the industry who provided me with that.


----------



## gunrunnerjohn (Nov 10, 2010)

I use OrCAD, after the placement it does automatic routing. I've never fabricated the boards, once I have the layout done I send them out.


----------



## tankist (Jun 11, 2009)

well, i didn't really had a choice. i started with open source kiCad, asked for help and was given this tool. I'm sure i'm not using it properly and there is obviously much functionality i'm not tapping into. but i never done this before like that  i will be using toner transfer to mask the blank PCB for etching. 

looked up orCad. seems elaborate. i'm sure this is several grand worth of software.


----------



## gunrunnerjohn (Nov 10, 2010)

Yep, I bought it when we had an active project using it. Truthfully, one of the guys working for me on the project is the real expert, but I can manage to lay out small boards with it. We were doing 8 and 10 layer boards, no way I'm going to do those by hand! I'm also sure in the few years since I acquired this version that it's marched on.

The small place I used to send my boards to is gone, so if I do another one, I'll have to find a new place.

I'd be tempted to use a PIC processor to do all the logic...


----------



## steve_locher25 (Oct 6, 2010)

go to youtube.com

search:

Block Occupancy Detector

before anyone starts emailing me questions: (and I get alot from time to time)

No, I cannot tell you how it works, it is still being developed for market. I have worked on this problem off and on since 1996 and I am now $2500 invested into it for research and developement. I am trying to find ways to bring the cost per block down to $10 and to ease the pain of installation (which, IMHO isn't really that hard to do to begin with). I am not trying to make a million dollars doing this. Some sales would be nice, to cover expenses.

I am trying to show that the method of "current sensing" is not the way to go. If each car has resistorized wheelsets (in order to be detected), then you would have multitudes of resistors in parrellel with the track power. The more you have, the closer and closer you get to having "a dead short". (Ohm's Law). True, there are ways to get around this, but it is not needed.

The video clearly says "there is no power on the rails" which means it works with or without any power to the rails (because it has nothing to do with track power), thus, it doesn't matter if you use an old tyco transformer, or any kind of DCC, or any other way to power the engines on your layout.

It is in fact using infrared, which means it works in absolute total darkness, but no, I am not flooding the room with infrared either.

No, it is not, nor has anything to do with IRDOT. I did try that concept of bouncing infrared off the bottom of the rolling stock (in 1998) but didn't have much success and so gave up on that.

No, it is not a typical infrared "check in/check out" circuit. The video shows that by "leaving equipment in the block". If it "was" a check in/check out circuit, it would have cleared the block while stuff was still occupying that block.....the check in/check out circuit would have seen the movement "leave" the block and then cleared....even with equipment left behind (giving a false clear).

Yes, I did say it was "bi-directional signaling" in the video. I have an additonal circuit for APB signaling. This video was not wired that way. The video showing APB signaling I have here, but I never did post it on youtube.

Yes, at the end of the video, with one plastic wheeled axle, it still works, with no power on the rails. That was the whole point in trying to figure out a better detector.

I welcome your input because even after all this, no one seems interested......I am thinking about dropping the entire project and moving on to others.

I already did the HO scale Adlake Kerosene Lantern (and posted it here in this forum).

I am thinking about doing:

2 and 3 headed semaphores in HO scale.

Multi head semaphores mounted on top of signal bridges (or cantilevers).

Scale model Safetran Predictors (crossing warning systems) in HO. (maybe N scale too).

Re-designing my talking dragging equipment detector (which I already did in 1996)

HO scale rail grinder, track cleaner.

Remote controll HO scale 250 ton crane (lifts 3 pounds, has working outriggers).

others...........


----------



## gunrunnerjohn (Nov 10, 2010)

Perhaps if you started your own thread you'd get better response?


----------



## Big Ed (Jun 16, 2009)

gunrunnerjohn said:


> Perhaps if you started your own thread you'd get better response?



He posted the same thing in this thread.
Today, http://www.modeltrainforum.com/showthread.php?t=8559


----------



## gunrunnerjohn (Nov 10, 2010)

Yep, I saw that as well. Not sure what he's trying to accomplish, but it's not getting done.


----------



## steve_locher25 (Oct 6, 2010)

my appologies


----------

