Momentary (light activated) occupancy detector - Model Train Forum - the complete model train resource
Model Train Forum - the complete model train resource  

Go Back   Model Train Forum - the complete model train resource > Model Train Workshop > DCC Forum (Digital Command Control)
Forgotten your password?


Reply
 
Thread Tools Display Modes
Old 04-12-2011, 01:26 AM   #1
tankist
פעם שריונר
 
tankist's Avatar
 
Join Date: Jun 2009
Location: NW Chicago burbs
Posts: 2,733
Scales Modeled: HO
Momentary (light activated) occupancy detector

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.
Attached Images
File Type: jpg ProjectV01.jpg (52.5 KB, 62 views)

Last edited by tankist; 04-12-2011 at 11:02 AM. Reason: link added
tankist is offline   Reply With Quote
Old 04-12-2011, 08:00 AM   #2
gunrunnerjohn
Admin
 
gunrunnerjohn's Avatar
 
Join Date: Nov 2010
Location: SE-PA, USA
Posts: 21,400
Scales Modeled: O-gauge 3-rail
Images: 4
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.
gunrunnerjohn is offline   Reply With Quote
Old 04-12-2011, 08:58 AM   #3
tankist
פעם שריונר
 
tankist's Avatar
 
Join Date: Jun 2009
Location: NW Chicago burbs
Posts: 2,733
Scales Modeled: HO
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.

Last edited by tankist; 04-12-2011 at 09:10 AM.
tankist is offline   Reply With Quote
Old 04-12-2011, 10:02 AM   #4
gunrunnerjohn
Admin
 
gunrunnerjohn's Avatar
 
Join Date: Nov 2010
Location: SE-PA, USA
Posts: 21,400
Scales Modeled: O-gauge 3-rail
Images: 4
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.
gunrunnerjohn is offline   Reply With Quote
Old 04-12-2011, 11:00 AM   #5
tankist
פעם שריונר
 
tankist's Avatar
 
Join Date: Jun 2009
Location: NW Chicago burbs
Posts: 2,733
Scales Modeled: HO
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)
tankist is offline   Reply With Quote
Old 04-12-2011, 12:30 PM   #6
gunrunnerjohn
Admin
 
gunrunnerjohn's Avatar
 
Join Date: Nov 2010
Location: SE-PA, USA
Posts: 21,400
Scales Modeled: O-gauge 3-rail
Images: 4
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.
gunrunnerjohn is offline   Reply With Quote
Old 04-12-2011, 01:29 PM   #7
tankist
פעם שריונר
 
tankist's Avatar
 
Join Date: Jun 2009
Location: NW Chicago burbs
Posts: 2,733
Scales Modeled: HO
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?
tankist is offline   Reply With Quote
Old 04-12-2011, 01:38 PM   #8
gunrunnerjohn
Admin
 
gunrunnerjohn's Avatar
 
Join Date: Nov 2010
Location: SE-PA, USA
Posts: 21,400
Scales Modeled: O-gauge 3-rail
Images: 4
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...

Attached Images
File Type: jpg opto.jpg (45.3 KB, 55 views)
gunrunnerjohn is offline   Reply With Quote
Old 04-12-2011, 01:52 PM   #9
tankist
פעם שריונר
 
tankist's Avatar
 
Join Date: Jun 2009
Location: NW Chicago burbs
Posts: 2,733
Scales Modeled: HO
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 .
tankist is offline   Reply With Quote
Old 04-12-2011, 03:42 PM   #10
gunrunnerjohn
Admin
 
gunrunnerjohn's Avatar
 
Join Date: Nov 2010
Location: SE-PA, USA
Posts: 21,400
Scales Modeled: O-gauge 3-rail
Images: 4
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.
gunrunnerjohn is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


» Visit These Sites:
LGB World

Or Our European Train Website ModelRailForum




All times are GMT -5. The time now is 05:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2008-2013 Model Train Forum