I've been doing quite a bit of reading, but I'm struggling to grasp how and when to add resistors, and how to size them. As a basic example, I'd like setup a PIR to switch a transistor / relay, which in turn would power a servo. I know resistors will play a key role in both circuits, but I'm not really sure where to start. I see all sorts of LED resistor calculators, but can't seem to find anything else relating to sensors, or other types of circuits. I've been trying to decipher the PIR datasheet, but am not sure which specs I'd use to do this.
Any help would be greatly appreciated, and links are also welcome. Not afraid to read up more, maybe my understanding of things is just a bit skewed, and I'd love some clarification.
So you want to drive a transistor with a PIR data output.
You then want this transistor to drive a relay.
Well....
First things first..
Which relay and how much current does the coil require and at what voltage?
Answering that helps choose a transistor. When you have chosen a transistor you can choose a base resistor. (Which will be anything from say 220 ohms to 2K2)
That's not easy to answer... There hundreds of resistors in any typical electronic device, and "it depends"...
Look at the datasheet for the PIR. What's the relay doing? You don't usually need a relay to control a servo. (You may need a relay, or transistor or something, to control a DC motor, and you definitely need transistors or MOSFETs to drive a stepper motor).
If you were taking electronics in school, you'd learn about resistors and Ohm's Law first. Then, you'd learn Kirchhoff's Laws. Then, you'd learn about capacitors & inductors and how they are used with resistors in passive circuits. By the 2nd year, you'd probably start learning about diodes, transistors, and transistor circuits and how passive components (resistors, capacitors, and inductors) are used with transistors and other active devices.
You might never study PIRs or servos in school... You might have to get the specs, datasheets, and application notes and figure it out yourself, after learning some electronics.