Is it correct to connect the gnd of the Arduino to the negative terminal of other supplies, like batteries

  • Say we have a controller that the GPIO max is 40mA.
    It would be reasonable to derate this to say 20-30mA.

  • For a BJT, we will design for GPIO current is 20mA when it is sitting at a HIGH (5V).
    5V - .7(Vbe) / 20mA = 215Ω (for a BJT base resistor) . A standard resistor is 220Ω.
    5v -.7(Vbe) / 220R = 19.5mA (GPIO current = base current)

1 Like

OK, thank you. I was also considering making sure I did not wreck the power transistor (PN2222) as well. I will endeavor to do better math, in more detail, for future projects.

Oh right, yes. I was going to mention that my UNO R4 wifi is actually 8ma maximum on the GPIO pins, but you are actually giving an example, so it is all fine.

  • 8mA derated to 6mA.
    ~680 to 750ohms for a base resistor.

Remember to always confirm, with a DMM, your transistor fully turns ON.

2 Likes

By the way, this forum and community is soooo good. I do not feel anything but completely welcomed. So many people around, and quick responses. This is exceptional!

Oh, actually with what you just said about fully on, I have a nice little variable resistor to work with. I could use that with my DMM to fine tune it. Although it probably does not need to be that finely tuned.

  • Shouldn’t need tuning. :thinking:

  • If you do this, add a fixed resistor (say 680R) in series so the GPIO doesn’t get damaged if you accidentally turn the potentiometer to 0Ω. :face_with_spiral_eyes:

  • Optionally, when we use a logic level MOSFET (which is a voltage controlled device), the GPIO 5v output turns on the transistor when the GPIO goes HIGH.

1 Like

Yes, good point. I have limited components at the moment. I bought a breadboard kit from Amazon. I have also ordered a set of better quality transistors to compliment it (I had ordered a bunch of power relays already, and have them now). Oh, and also I have some strip-board/ vero-board. I will probably make some consistent circuits with what I have, to avoid having to mess around.

  • This post, discussing making a soldered prototype PCB (with 2 PDFs), might be interesting to you.

1 Like

Sweet! Yes, for example, you should always, have that diode across the relay activation coil. You save some time with it, if it is already set on a strip-board. But also, Yes, I would need to check the current rating of the strip-board of course (or maybe look at watts). If I am running high currents, the strip-board may not be rated high enough. So I am aware of that.

That's a yes.

And although the Arduino datasheet gives an absolute maximum of 8 mA per GPIO pin, if I'm reading the Renesas RA4M1 datasheet correctly, then a safer upper bound may be 4 mA (see Table 2.6 on pp. 32–33).

2 Likes

Yes but as I stated there is no protection circuit. If you draw more current that the micro can handle you will destroy it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.