(Opto) Photo Interrupter – working properly as DIGITAL input to Arduino DUE

The z1670 photo interrupter from altronics is actually a BPI-3C1-13 by bright led electronics corp. This is how you connect it to an Arduino digital input at +5V.

Arduino5vOptoPhotoInterrupterBPI-3C1-13
I’m using an Arduino DUE so I used an external +5v power supply (from my model aeroplanes) always remembering to connect earth to common ground – arduino GND and the GND of my circuit.

*Note: this simplified circuit diagram does not quite match the physical layout of the pins. If you look closely at the ‘Top View’ schematic in the datasheet you will notice that the Collector (3) and Emitter (4) are physically located the other way around – which makes the wiring a little more messy.

The 220 ohm resistor between the +5V and Anode drives the IR LED input’s Forward Voltage in the range 1.2 – 1.5V at around 20mA. The 4.7K ohm resistor between the +5V and (3) Collector gives us a nice wide voltage change when an object is placed in the gap between the IR LED (1) (2) and the Detector (3) (4). I measured 96.5mV open and 5.31V closed. This gives a very sharp and reliable OFF/ON, LOW/HIGH, 0/1 digital input. Hooking up to an ANALOG input (A0) on my Arduino DUE showed values from the low 20’s open to 1023 closed – perfect!

So, how did I get that circuit diagram and those resistor values? I have to admit, I phoned a friend. My mate Ashley who actually understands this stuff explained the calculations like this:

  • Look at the ‘Forward Voltage’ Vf on data sheet which shows 1.2V typical to 1.5V max at 20mA. (5V-1.2V)/.02A = 190Ohm. 220Ohm is close enough.
  • Look at the ‘Light Current’ Il on datasheet 1.0 – 10 Ma. To get a nice strong voltage change across (3) Collector and (4) emmitter calculate the resistance required to leave about .5V with gap open. At 1mA the calculation is (5V-.5V)/.001A = 4500 Ohm.

Creative Commons License

Fang – Mike Seyfang

TriBeardLesBones

About these ads
This entry was posted in Hobbies, phd, science and tagged , . Bookmark the permalink.

2 Responses to (Opto) Photo Interrupter – working properly as DIGITAL input to Arduino DUE

  1. Pingback: LoLa Prototype v1.1 = SUCCESS | a blog by Mike Seyfang

  2. Pingback: (Opto) Photo Interrupter – pushing the limits | a blog by Mike Seyfang

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s