How to Read Data Sheets?

I'm a complete newbie to Arduino.

When trying to incorporate components to the Arduino, how do I read these components' data sheet so that I know what to do with them? Particularly, it seems like a lot of the schematics I see include a resistor between the component and the Arduino. How are the values of these resistors determined? Is it based on something in the data sheet?

A link explaining this would help, if anyone can provide one. Thanks.

First of all please learn how not to post the same thing three times. Can you go and delete the other two.

Second a data sheet is like an encyclopaedia, you don't normally read it cover to cover but you look things up in them. They tell you how a specific component will behave. They don't (normally) tell you how to use that component, those are called application notes. In some cases of a complex IC there might be an element of application note in the data sheet.

So a data sheet answers your questions BUT you have to know the questions first before hand.

What you are asking is "How does electronics work" and that is another questio0n. There are lots of good tutorials on line and there are some bad ones.
One that you might find useful on transistors is:- Transistor Circuits
on LEDs:-

Hi Mike,

The multiple post was caused by the site acting up earlier. Every time I submitted, I got an error 500. So, I submitted again.

I have a basic understanding of electronics (did it a lot about 10 years ago), but I am realizing that I need to brush up on it again.

Right now, I want to use a phototransistor (see: to control an LED. What pins connect to what on the Arduino? Do I need any other parts (e.g. resistors)?

Any help is appreciated. Thanks.

It depends on if you want the light sensor to give a reading proportional to the light, in which case you want an analogue input. Or just a signal if light is present or not then you can use any digital input.

have a look at this link

I want it to act as an analogue input, but should probably try it out as digital as well. I've been to the link you provided. None of them apply specifically to the phototransitor that I have. That is why I am trying to figure out how to design the circuit myself -- otherwise I will continue to be left in the dark with every new part I get.

None of them apply specifically to the phototransitor that I have.

Photo transistors are much of a much ness. That is there are pretty much the same so what goes for one goes for all. What part number do you have? Look up the data sheet for that for anything specific.

Try this:-

That brings me back to the original question: how to ready data sheets?

This is the item that I have: Is there anything there that tells me how to build my simple circuit?

Pin 2 & 4 to ground.

Pin 3 to one end of an 82R resistor (for 40mA current), other end of the resistor to +5V.

Pin 1 to any arduino Pin (except Pins 0 & 1) say Pin3.
The Arduino input pin you use, put a 100K from that pin to +5V.

The bits in the data sheet I used is:-
Emitter continuous forward current 50mA so I decided to make it use 40mA. With a forward voltage of 1.7V this gave 5 - 1.7 = 3V3 to drop across a resistor with 40mA current flowing. Using ohms law this gives a resistor value of 82.5 ohms.

The collector resistor well, that's the sort of value they are I didn't bother to calculate it. But if I had I would look at the coupled current 0.3mA, that's the current that the light puts into the collector flowing through a 100K resistor would give a drop of 30V. We don't need so much as we are only connected to 5v, so to drop 5V across 100K you only need 0.05mA (ohms law) so that gives you a bit of margin on the reflective light.

Hope that helps

Thanks. I will try out your suggestion as well as study how you came up with the circuit.

Hi Mike,

I'm slowly trying to go through your explanation and doing some research along with it.

For the first resistor you computed, I believe the formula is the following:

R1 = (Vs - Ev) / If

Vs = supply voltage, which is 5V on Arduino board
Ev = emitter forward voltage, which the data sheet states as 1.7V
If = emitter continuous forward current in Amperes, which the data sheet states as 50mA (so that converts to 0.05A)

Applying the formula, we get the following:

R1 = (5V - 1.7V) / 0.05A
R1 = 3.3V / 0.05A
R1 = 66 ohms

You came up with 82.5 ohms because you decided to use 40mA. What was the rationale behind this? Why 40 and not 35 or 45? What's the difference with using 50mA versus 40mA?

As for the collector resistor, I'm still doing some research on how you came up with that.

Thanks for all the help so far!

What's the difference with using 50mA versus 40mA?

That's the "art" bit in the art of electronics. The data sheet says 50mA is the "Absolute limit" so you don't want to go their. A value of 40mA is 20% down on the maximum which is a good margin of de-rating.

Why 40 and not 35

Well the more current through the LED the more light you get out and so the more there is to bounce back and so either:-

  1. the better your detection range.
  2. the more you can wind down the sensitivity in the detector to solve any stray light problems.

It takes more current, if that is an issue and de rating it more might also increase the reliability (susceptibility to early life failures)

Most design decisions like this are a bit subtle and come with experience rather than from a book. :wink:

Since I plan to connect this to the analogue pin, should I go for something lower than 40mA? The DC Current per I/O pin for the Arduino board I have is 40mA:

Shouldn't 40mA be my max -- and I should de-rate from that value?

Since I plan to connect this to the analogue pin, should I go for something lower than 40mA?

No this is the emitter not the detector, it is connected to the 5V line and has no connection into the Arduino.

If, for some reason, you want to turn the LED on and off (I can't see why) then yes I would not drive 40mA through it I would either go for 20mA or if that was not bright enough go with 40mA and use a transistor to switch it.