Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Looking for a light sensor?

3211 views
14 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Looking for a light sensor?
Posted by RR_Mel on Friday, December 23, 2016 9:51 AM

For anyone interested in a low cost photocell light operated switch I found one on eBay for $2.77 free S&H.  It is fully adjustable, operates on 12 VDC, draws 8ma with light and 46ma (relay activated) with no light, relay: form 1C with 10 amp contact rating.
There is a berg plug to allow switching the detector 12VDC power through the relay contacts or dry relay contacts with the berg plug removed.  The 12 VDC input and sensor connectors are male Arduino type pins.
 

1.97” long X 1.02” wide X .74” high, sensor .198” diameter X .58” long (including heart shrink) with a 19” zip cord wire and connector.

 
It is very compact with high quality parts and incely packaged.  I’m very pleased with it, I see more of them in my future.
 
  
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    August 2003
  • From: Collinwood, Ohio, USA
  • 16,367 posts
Posted by gmpullman on Friday, December 23, 2016 11:40 AM

That looks neat, Mel. The photocell looks like the one that LogicRail uses for it's signal animator. This could be handy for staging yards and to trigger animation by passing trains.

Do you have a link to the ebay seller??? When I search photocell light sensor I get about 700 choices.

Thanks, Ed

  • Member since
    January 2001
  • From: SE Minnesota
  • 6,845 posts
Posted by jrbernier on Friday, December 23, 2016 11:44 AM

  Does he offer an IR version?

Jim

 

Modeling BNSF  and Milwaukee Road in SW Wisconsin

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Friday, December 23, 2016 11:46 AM

Sorry about that Ed, I normally include links.
 

http://www.ebay.com/itm/252592538946?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Friday, December 23, 2016 11:54 AM

I don’t know Jim, you might search their site but it doesn’t have an internal search and they have thousands of listings.
 
 I tried substituting an IR receiver with bios and couldn’t get it to work.  That was my plan when I ordered it.
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
 
  • Member since
    January 2001
  • From: SE Minnesota
  • 6,845 posts
Posted by jrbernier on Friday, December 23, 2016 11:57 AM

Wow,

  This guy has all kinds of neat parts, including IR sensors for around the same $3.00 price.  Thanks for the link, Mel!

Jim

Modeling BNSF  and Milwaukee Road in SW Wisconsin

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Friday, December 23, 2016 1:16 PM

Jim:

Can you provide a link to the IR sensor? I could only find one on the seller's website and I don't think it came with a relay.

Thanks

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    January 2001
  • From: SE Minnesota
  • 6,845 posts
Posted by jrbernier on Friday, December 23, 2016 1:31 PM

Modeling BNSF  and Milwaukee Road in SW Wisconsin

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Friday, December 23, 2016 2:26 PM

Thanks Jim!

According to the listings the detectors that come with the units are sensitive to IR body heat, not motion (one detector does not mention body heat but I suspect the technology is the same). I wonder if you could substitute separate IR emitter and detector diodes for the single sensors? There are three wires connected to the the single piece sensors that come with the units so I'm wondering if you could feed the emitter with one wire, pick up the signal from the detector with the second wire, and use the third as a common? 

I might buy a couple to play with.

Dave

Edit: I just ordered a couple. For the price, why not?

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Friday, December 23, 2016 2:49 PM

I played around with the one I bought and wasn’t successful at converting it to IR.  I tried three different IR sensors and a IR receiver LED.  The comparator is setup for changing resistance, when I applied a bios voltage to the sensor it wouldn’t work.  I measured the photocell and it’s 900Ω to 1.4MΩ, light to dark.
The IR receivers decode a 38k modulated IR and I could see the switching at the board but it wouldn’t activate.  I built a 5 volt 3 amp 38k IR driver to power all of my IR emitters and nothing worked with this module, modulated or unmodulated IR.
 
 EDIT:
I haven’t given up yet but my experimenting mode is temporarily on hold, Grandpa Clause and Grandma Clause have some preparations for the big day.
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
  • Member since
    August 2003
  • From: Collinwood, Ohio, USA
  • 16,367 posts
Posted by gmpullman on Friday, December 23, 2016 3:31 PM

hon30critter
I wonder if you could substitute separate IR emitter and detector diodes for the single sensors?

This detector has IR sensors similar, again, to the LogicRail signal animator.

http://stores.ebay.co.uk/WEHONEST/WiringOf3AspectsSignal.html

(Good old WeHonest)

I bought five but have not tested the IR sensitivity.

As a signal controller they are pretty much worthless for my use because when the input is closed, i.e. to trip the signal to red, it then goes to yellow, then to green (they have the sequence wrong, but all you have to do is swap red & yellow) even if the input stays grounded.

So you can have a clear signal even if the train is still sitting in the block.

Maybe it is OK for other applications you might want?

http://www.ebay.com/itm/Control-the-Signals-etc-automatically-by-trains-Delay-Switches-Circuit-Board-/150756095487?hash=item2319c375ff:m:mgjgmc9so9Zvxk8nHzNUmWw

Of the five I bought, one came without a chip Whistling but wasn't worth trying to get a replacement.

Good Luck, Ed

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Friday, December 23, 2016 4:34 PM

Hi Ed:

Thanks for the links.

I had seen the WEHONEST signal controllers before, but if and when I do signals most of them will be used as simple turnout direction indicators. I don't have the knowledge to modify the sensors to do what I want.

What I'm looking for are simple occupancy detectors. I have a very inexpense IR circuit that detects quite well (at least in tests) but I haven't figured out how to do the relays etc. I'm quite happy to let the Chinese engineers do the work for me. I'll have to spend some time searching the WEHONEST site.

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Friday, December 23, 2016 5:28 PM

OK Guys, I ran one last test with an old stock pair of IRs and it does work pretty good.  The older IR sensor works with a non modulated IR LED at 6’.  I’ll have to do some research on the older detector to determine what it is, I did not mark the drawer with the part number.  The type emitter doesn’t make any difference (both are 940nm), it’s a blue sensor that works with the eBay detector.
 
A clear pair of 940nm sensor and emitter work with my Arduino UNO at 30’.
 
 
 
I’ll refine it later when Grandma Clause isn’t threatening me with a rolling pin.
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Saturday, December 24, 2016 9:39 AM

I did my research and found the eBay order for the working IR pair.  I purchased them May 19, 2014 on eBay for $3.99.  The link below is the same seller's current listing, it is the exact same listing with the same picture as the 2014 purchase with a lower cost.

 

http://www.ebay.com/itm/152337220328?_trksid=p2060353.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT

 
I connected the blue sensor directly to the Arduino looking pins on the Photoelectric Switch Sensor Relay Module.  I used a 5 volt unmodulated source with a 270Ω resistor in series with the emitter, current was 29.6ma (.096 watt).  The unit operated the same as it did with the photocell and a fluorescent lamp, fully adjustable.  The maximum range in IR mode using the matching emitter was 10” to 12").   With a 1 watt emitter the range was increased to 10’, could be more but my hobby/work room is only 12’ wide.  Moving my hand through the beam it counted my fingers at 1 foot in front of the sensor.
 
Sorry for the delay but my better half carries a much higher priority than train stuff.
 

 

Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   

http://melvineperry.blogspot.com/

Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

 

 

 

 

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Tuesday, December 27, 2016 9:07 PM

The eBay light switch does work very good with the blue sensor but I have decided to go with an Arduino UNO to drive my signal system.
 
I received some Vishay TSOP1738 IR Receivers today (49¢ ea) that I ordered off eBay.  THEY ARE GREAT!!!!  They power up on 5 volts and have a switched output.  They only respond to a IR beam with a 38k carrier.  The TSOP1738 will only sink 5ma max but that is more than enough to drive an Arduino input.  They have a 90' range from a 100mw 38k carrier IR emitter.

I built a 5 volt 3 amp 38k power supply using a IRF510 N Channel MOSFET and a LM555 to drive all of my IR emitters so I'm set to go all IR detection on my layout.  The TSOP1738 has a built in pull up and I can see it drop from 3.3 volts to millivolts using my DVD remote control at 12 feet.

The leads are spaced at .1" so they will plug into a standard micro connector.  The ground is pin 1, +5 volts is pin 2 and the switched output is pin 3 actually double spaced to pin 4 on the micro connector.  I removed and filled pin 3 in the micro connector to prevent the ability to reverse it.
 
  
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

There are no community member online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!