Working on a project that will have a marble run encased in a fence so my young children can play with it (via electronics) while my youngest is kept safely away from the marbles.
I was getting ready to start building the parts that involve relays and became confused when looking at the specs; I suspect that there is a key idea I'm missing about how the Arduino (Uno in my case) operates but after a few hours of digging I don't have a solid 'why' and arguably no 'what'. [edit, I think I put two and two together while writing this, but would like confirmation before I get too deep into the build]
I found this topic:
And I happen to have purchased the same relay. So if I'm reading that thread correctly, then the pin will only have a few mA of load as it activates a transistor acting as a switch by voltage from IN to GND. The coil needs to be connected to Arduino ground and 5V pins through Dupont wires, and by doing this the USB cable is going to be energizing the coil, the ATMega will only be flipping the proverbial switch. Is all of this correct?
As a bonus question, if I have a PD20W supply and USB-C to B as a power supply for my setup, then my GND and 5V pins on the Arduino board are going to be able to load up a total of 4 amps, assuming the individual loads can handle their portion of the current, correct? I'm still trying to get my arms around the best way to power the servo, motor, and batteries of LEDs involved with the project.
It doesn't have to be connected to the 5V pin, you could use a separate 5V PSU if desired (which could also power the Uno through it's 5V pin). If using a separate 5V PSU and USB power, you must connect the grounds.
If you go through the arduino regulator to power the coil (70 to 100mA are frequent) then you put lots of burden on thin tracks of your arduino and if you power the arduino through USB you wont be able to draw more than 500mA.
If you have only one good relay (ie protected when driving the coil and load) then that might be fine but it’s usually better to have power going directly from the source to the power hungry components rather than using your arduino as a power supply.
Regarding the signal pin, yes this one does not draw much, as you said there is a transistor driving the relay.
Some USB-C power supplies can output different voltages like 9V, 19V as well as 5V. These higher voltages are only output by negotiation between the power supply and the device being powered.
Check the detailed specs of this power supply to find out what the maximum power at 5V output is. Arduino cannot negotiate for a higher voltage, so you may not be able to get that maximum 20W power.
Are you sure that relays are the best option? What is their purpose in your circuit? Could transistors be a better option? Relays were invented almost 200 years ago and there are much more modern and efficient alternatives available.
Man, that is a huge number of responses for a half hour old post; thank you all so much.
Regarding my 500mA limit though USB; that is only when my computer is powering the Uno, no? Once the sketch is downloaded and I plug into the wall via 120->5V power supply, my current limits are improved, correct?
I am not sure relays are the best option, but possessed and viable. I looked at solid state stuff while trying to figure this all out a few hours ago, and didn't get an answer (that I was able to digest without effort). Admittedly, I am tired and a little annoyed with myself because I've taken some more advanced electrical theory classes, comms and LT applications and such, so I feel like this should all be obvious, but up till now it has largely been in a classroom, but running the equations a few years ago and selecting components for my children to interact with have different levels of vested interest and by extension, hesitation. I think a FET of some sort (if memory serves, BJTs are typically for amplification rather than switching?) would be ideal, conceptually, but I already had the relays and don't want to get hung up on a detail like that. If you have a recommendation for a 5V trigger to 'close' a solid state device that can handle a couple of amps (to be safe, I don't think anything is going to be more than around an amp) I'm all ears. What I read earlier kept mentioning 10-15V and as we know I'm building a 5V system.
I did learn recently about the high level concept of the USB-C PD where there are electronics that tell the supply to up the voltage. I thought that was cool. I see on the bottom that it gives an amperage limit for each voltage, so my 5V @ 3A rating means I don't get 20W at the 5V level. That is good to know, thanks.
it's indeed improved up to the limit of the power supply and the arduino regulator if you power through the Jack.
You also mention 5V, so you would not be able to power through the Jack with such a voltage (7V min required), so I'm assuming you are talking about a phone charger with an USB outlet connected to the USB port of the UNO ➜ in that case USB A rules apply and you would not get more than 500mA.
If you power an Arduino Uno through the barrel jack, say with 9V, the onboard voltage regulator can safely supply up to ~500 mA on the 5V pin. However, this limit depends on the regulator's ability to dissipate heat.
With 9V input, the regulator must drop 4V (from 9V to 5V), and the power dissipation is proportional to the current drawn. For example, at 500 mA, it would dissipate 2W (4V × 0.5A), which will cause overheating if no additional cooling is provided.
➜ To avoid overheating and ensure stability, you should aim to draw significantly less than 500 mA, typically 250-300 mA, from the 5V pin — leaving ~200mA for the UNO (needs about 50) and driving the pins.
That's why we don't recommend using the ARDUINO UNO as a power supply. connect your 5V source directly to the USB to power the logic function of the arduino and in parallel power also the other components, without going through the Arduino regulator / board.
That all makes a ton of sense aside from having a C/B USB cable be restricted to A protocol limits.
It sounds like we want to get as close to 7V without going over if using the barrel jack, because the regulator will eat the excess voltage and that is a waste of heat? I never have before and I'm not sure I see a clear reason I would want to in the future, but it may be good knowledge for someone else who reads this down the road.
Not using the Uno as a power supply I understand as a rule of thumb; better to let it be fed information from sensors and send commands to servos, etc., and I do have enough cables that I grabbed for this project to make sure that my heavy stuff (primarily the two motors I'm using) aren't frying my chipset.