Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Why are these resistors present in these schematics?

  1. Jul 28, 2013 #1
    The images represents circuits interfaced with an Arduino microcontroller.



    The first image is a controller circuit for running a piezo buzzer. I understand the application of the transistor here, but am not sure why the resistor is present in parallel with the speaker.

    The second schematic is a circuit that lights LEDs based on the voltage read at the analog pin A0. I thought that arduino's input impedance was very high? What is the application of this resistor?

    And finally, the second image is a controlling circuit that I do not understand. The device on the left is suppose to represent a 12V relay. The diode is present to prevent voltage spikes from the relay after it has been switched off. My concern is that, given the transistor is an an NPN (BC548), the current would flow from collector to emitter (i.e. to ground in this schematic). The data sheet, and the article, write that the pin orientation is collector, base, emitter. With the diode reverse biased (the cathode is at the relays positive terminal), how does this circuit work?
  2. jcsd
  3. Jul 28, 2013 #2
    In #1 it may be that the parallel resistor allows some constant current to flow when the transistor is on, since the piezo is basically a capacitor. Without actually trying it I won't assert that it's unnecessary, but an experiment should show.

    For #2 my opinion is that the resistor is superflous. It may be an attempt to limit "static shock" if the lead is open and roaming around, as it might be for an actual voltmeter application. Again, IMHO, this is the wrong way to go about it, but arduinistos seem to use this for static protection on touch plates and the like. I think it should be a high value resistor to ground which would also pull the "reading" down when the lead is open. I'd like to hear argument pro-con this from the knowledgeable though.

    For #3 I wish you'd post a schematic because I can't follow the breadboard very well. It should look basically like the #1 piezo circuit with a reversed diode in place of the mystery parallel resistor, however on your breadboard it appears that both ends of the relay will be connected to the same power buss when/if the transistor is turned on.
  4. Jul 28, 2013 #3
    The last image was simply taken from the book, there was no schematic for it. The design is nothing more than a transistor with the diode's anode connected to the collector. The diode's cathode is connected to the positive terminal of the relay. The emitter is grounded and the base is connected to a digital output pin on the arduino.

    My concern was that, given the transistor is of type NPN, the current would flow from collector to emitter. This would mean that when the transistor is conducting, the current would be flowing backwards through the diode.
  5. Jul 28, 2013 #4
    OKokOK You have released my inner pedant... Here's what I believe to be the schematics:


    On the left is my reverse engineering of the breadboard. The diode is wrong and the relay power is also wrong. So. I would throw out that book and start over -- BTW what book is it? I hope I don't know the author...hmm...actually I hope I DO so I can razz them -- On the right is my view of how things should work, which indicates that you are on the right track with your work.
  6. Jul 28, 2013 #5
    It just seemed strange how the circuit was illustrated. The author states the diode protects the circuit by blocking the return path and forcing the current to circulate in the coil to be released as heat. None of it made sense.

    The second schematic (right) appears to make much more sense to me than the other.

    The book is actually this one:
  7. Jul 30, 2013 #6


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    The resistors in the second drawing are very much needed. Those are current limiting resistors. When conducting the LEDs are essentially a short. The ports of the Arduino are rated at 40ma max current draw. The current limiting resistor guarantees that you do not exceed this and serve to control the brightness of the LED. You can pick any resistance in a range with the minimum determined by the 40ma max of the port.
    Last edited: Jul 30, 2013
  8. Jul 30, 2013 #7


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    yes the ones in the LED lines are for current limiting but they are not the ones he was asking about.
    its the one resistor with the red underline on the A0 input :)

    which I would still expect to have a current limiting function for the input to the chip

    Last edited: Jul 30, 2013
  9. Jul 31, 2013 #8


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    In order to know the purpose of R4 we need to see the program. Since it is connected to an analog port the arduino could be monitoring that voltage and setting a LED depending upon the value. Without the code we can only guess.
  10. Jul 31, 2013 #9
    Well, yes, that is very likely what the program is doing. However the relatively small resistance of R4 will have no effect on the net input voltage because the input impedance of the ATmega is on the order of 10Mohms.

    So I return to my original answer/question: Is this for static discharge protection? And if so, my assertion is the same as above, it should have no net effect whereas a large resistance to ground might serve the purpose by shunting discharges. In this simple setup for a capacitive touch sensor:
    the resistor to an output pin might serve the same purpose... My somewhat limited experience with the circuit indicates that most of it is superfluous as well however...

    Also, Moderator? How come this thread was "closed due to mis-information" earlier this morning?
  11. Jul 31, 2013 #10


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Again, to know what R4 does we need to see the code. What is the purpose of that configuration? Without more information, we can only guess.

    Question for you, what is the meaning of the port name A1? What is its purpose?

    If you cannot answer these questions then I doubt your qualifications for speculating about the purpose of R4.

    I am pretty sure that your guess about static protection is wrong.
  12. Jul 31, 2013 #11


    User Avatar
    Science Advisor

    The inputs on micros are usually protected against negative voltages and voltages greater than 5 volts by diodes to ground and 5 V respectively.

    These diodes do not normally conduct, but when they do, it is worth having a current limiting resistor in circuit to avoid damaging the internal diodes.

    Also, with some micros, it is possible to program the same pins as inputs or outputs.
    So, a pin that is normally an input and grounded could suddenly output a lot of current if it produced a high level output.

    So it is worth having a small resistor there, just in case.
  13. Aug 4, 2013 #12


    User Avatar
    Gold Member

    The load resistor is part of the piezo operation. when the transistor turns off the piezo capacitance discharges through the resistor. (it's being driven at the audio frequency)

    The resistor on the A0 analog input is an over/under voltage protection resistor to prevent latchup or at the least, excessive currents for out of range input voltages. There are generally clamping diodes in the pad.
    Last edited: Aug 4, 2013
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook