This feels like a very basic question that I can't quite find the answer to. I've got my laser set up with a transistor and it was working as I programmed it while hooked onto the arduino. But now I need to get it set up on it's power source through a buck converter.
When I have everything hooked up on my breadboard without converter, the negative wire for the laser is connected to the drain and doesn't connect to the source. The source ran into the ground on my arduino board. Should I hook the source up to the negative terminal on the buck converter and to the arduino ground? Because I want to wire all the grounds together?
And if I have a second buck converter with a servo, I would connect the servo positive and negative wires to the buck converter and then run from that negative line to my other ground line, correct?
This is my potential wire hookup. I don't know if the source of the N mosfet should go to negative terminal on that buck converter. And if the servos grounds need to hook into the other grounds. Hopefully that is readable.
That looks right - negative side of all power supplies tied to eachother and to Arduino ground. Note that as buck converters are not isolated, you don't need to explicitly connect each one's negative side to ground as long as the negative side of the battery is tied to Arduino ground. The negative side of of input and output of buck converter is internally connected.
That looks right - negative side of all power supplies tied to eachother and to Arduino ground. Note that as buck converters are not isolated, you don't need to explicitly connect each one's negative side to ground as long as the negative side of the battery is tied to Arduino ground. The negative side of of input and output of buck converter is internally connected.
Okay, thank you very much! I'll keep the servos negatives to themselves, it will make the wiring less complicated.
You need at least 7 volts into the barrel jack due to the drop of one diode and the dropout voltage of the 5 volt regulator. 8 or 9 volts would be fine and insure some supply headroom since you have no load on the uno’s 5 volt rail.
You should have about 100-150 ohm in series with the mosfet gate to limit the output pin current to under 40 ma at turn on, the mosfet needs to be a logic level device for full current output to the laser.
FYI, here's an example of how to draw your schematic
so that it is easier to understand and follows schematic convention:
FYI, in regards to wiring convention,
You don't see connections from the 12V battery GND to anything because the GND symbol denotes
common circuit GND. It makes the drawing cleaner.
Also, you might want to consider changing the output of the buck converter for the arduino to the Vin
pin and increasing the voltage to 9V so the buck converter does not have drop the voltage all the
way from 12V to 5V because the arduino onboard regulator can drop it from 9V to 5V.
You need at least 7 volts into the barrel jack due to the drop of one diode and the dropout voltage of the 5 volt regulator. 8 or 9 volts would be fine and insure some supply headroom since you have no load on the uno's 5 volt rail.
Also, you might want to consider changing the output of the buck converter for the arduino to the Vin
pin and increasing the voltage to 9V so the buck converter does not have drop the voltage all the
way from 12V to 5V because the arduino onboard regulator can drop it from 9V to 5V.
I will do that! I thought there something about that wasn't right. I'll bump it up to 9.
I'm curious about running it through the Vin pin, is there a difference between running it through the DC jack and the Vin pin? I was trying to reduce the number of wires running over the arduino and simplify my physical layout.
You should have about 100-150 ohm in series with the mosfet gate to limit the output pin current to under 40 ma at turn on, the mosfet needs to be a logic level device for full current output to the laser.
Ah, I just did some reading up on this since you recommended it. So I should have two resistors on my gate, one to ground (1k) and one between the Arduino pin and the gate (100 since that's what I've got). Wish I'd known that before I started soldering everything so I could test it on my breadboard. Oh well. I think this might have been mitigated by the laser, which draws 300mA.
FYI, here's an example of how to draw your schematic
so that it is easier to understand and follows schematic convention:
Thank you for that example! It does make a lot more sense. I always have trouble going from circuit diagram to wiring so that style of schematic is much easier to understand.
You can drop the 9V buck converter, and instead power the Arduino from the 5V buck converter. Saves one converter, saves risking overheating the regulator. 5V to the 5V pin and you're done. That Vin/barrel jack is only for convenience when prototyping, the moment you go to a semi-permanent installation you don't use it any more. And you should consider a Nano instead of an Uno for easier soldering.
Do make sure the 5V buck converter can produce the rated current of the servos several times over (stall current!), and add a big decoupling capacitor.
If that #3 is also a 5V converter, better use that for the Arduino, and leave the motors on the separate one.
You can drop the 9V buck converter, and instead power the Arduino from the 5V buck converter. Saves one converter, saves risking overheating the regulator. 5V to the 5V pin and you're done. That Vin/barrel jack is only for convenience when prototyping, the moment you go to a semi-permanent installation you don't use it any more. And you should consider a Nano instead of an Uno for easier soldering.
Do make sure the 5V buck converter can produce the rated current of the servos several times over (stall current!), and add a big decoupling capacitor.
If that #3 is also a 5V converter, better use that for the Arduino, and leave the motors on the separate one.
No the 5V pin is not the the proper way.
The OP is correct about that.
If the OP has a 9V buck converter plugged into the Barrel Jack the arduino regulator will supply the
5V. A 5V regulator is always preferred over a buck converter.
Besides , the arduino doesn't have a "5V" pin.
It has a "Vcc" pin that is the OUTPUT of the onboard 5V regulator. You can't connect an external supply to the output of the onboard regulator because the external supply and the onboard regulator will fight each other.
And don't refer to it as a "5V buck converter" because that's not what it is. It's an ADJUSTABLE buck converter and it is not as stable as thr onboard 5V regulator.
Nomenclature of the pins varies between boards & manufacturers; and I can confirm from lots of experience that an external 5V power supply works perfectly. There is no fight with the regulator as the regulator doesn't get used in the first place (of course you don't connect the Vin to anything in this situation). I don't think I've even ever used the Vin pin on my Pro Mini and Nano boards, it's just so much easier to use a mobile phone charger (which produces 5V) or when I'm connecting to a 12V source a buck converter (the ones I use have a fixed output of 5V).
The exact voltage you power it with is actually not that important, really - as long as it's 4.5-5.5V you're perfectly fine, a bit lower than that even will not cause any issues for the Arduino or most external sensors. A typical USB powered Arduino gets a voltage at the low end of that range and they work just fine.
I've found it necessary to use an external 5V supply and I have built several hundred arduino circuits. The only reason to use an external 5V
supply is if your load draws more than 800mA.