Skip to main content

Reply to "IR or Optical Sensors"

ken's trains posted:

Don't want to be lazy so looked up NPN operation. If I understand, when beam is detected, most current flows to GRD through sensor. Therefore, transistor is off and emitter would be floating. So maybe a resistor from E to GRD would solve problem?

Correct.  When beam is detected, NPN is off, emitter is "floating" so a resistor from E to GRD would solve the problem  In this case you should use the regular pinMode (x, INPUT) instead of INPUT_PULLUP.  Someone correct me if I'm wrong, but there is no Arduino that supports pinMode (x, INPUT_PULLDOWN).

HI when beam broken

I realize the NPN circuit is all wired up, but couldn't you just run a jumper wire as shown in purple above?  It's OK to leave the NPN as-is with the E disconnected.

 

Attachments

Images (1)
  • HI when beam broken
Last edited by stan2004

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×