Hi I'm making a circuit where I need my Arduino Leonardo to power a 24VDC Buzzer and I need to turn on and off the positive electricity so I bought some P Channel transistors and I saw that P Channel transistors could do that now my only problem is that the electricity flows through even when there is no arduino input! I saw online that you need to be a resistor between the positive electricity and the arduino but I dont want to damage my arduino unless I'm sure which resistor I need. So I would like some help on how to wire it.
Is it a p channel (mos)fet?
Because p channel transistors do not exist....( their are two types (npn and pnp) only...
Mosfets do not have input and output. They have source, drain and gate...
Yes sorry Im not good with technical names yes its a mosfet.
Arduino should share ground with buzzer.
Which pin is source gate drain?
What exact type of mosfet?
Then you need two transistors.
A P-channel mosfet as high-side switch, and a small NPN bjt as low-side level converter.
Diagram #4 on this page will work.
A relay module is another option, and needed if grounds can't be shared.
Leo..
What does the NPN bjt do exactly as I would like to know.
FET = Field Effect Transistor. P channel transistor implies P channel FET. They DO exist.
@ OP: why do you need to switch the positive supply? Maybe low side switching would be easier? What transistor(s) do you have? Do you have a link to datasheet or at least a part number?
Source of the P-channel fet is connected to 24volt.
The gate must also be 24volt to turn the fet off.
An Arduino pin can't supply 24volt.
The small transistor converts 5volt (or 3.3volt) logic of the Arduino pin to 24volt.
This is called "level shifting".
You should read all of the article I linked too.
Leo..
If you are referring to the diagram I linked to, then you missed the point.
Diagram #4 is using that bjt as a (5 - 0.7) / 330 = 13mA current source .
That limits voltage across the 1k source/gate resistor to 13volt.
Nick has added a 10volt zener across, for extra safety.
When a 3.3volt-logic Arduino is used, gate voltage will drop to ~8volt.
Still ok to drive most P-channel fets.
Leo..
It was just a general warning a lot of people often fail to observe.
And yes, what you describe says it all for that schematic.
Im going to do what that circuit shows but replace the motor with my 24VDC buzzer.
I have tested the circuit in a circuit simulation program and it works.
I can not as the buzzer im using has two buzzer modes both I need to use so there are 2 positive wires and 1 shared ground wire so switching the ground is not an option.
So would that Circuit work ok for me because in a circuit simulation it seamed to work and output 24V and turn on and off with the arduino pins.
I will do the only reason I don’t know this is I have not really dipped my toes into the world of transistors and mosfets.
Yes the buzzer can replace the motor.
Make sure the kickback diode is across the buzzer.
Always confirm , with a DMM, the MOSFET full turns on.
One more thing what type of diode should I use for the kickback diode as there are multiple types.
How big is the buzzer.
A common 1N4004 will do for a small buzzer, so will any other general purpose 1A diode.
Leo..
Hi I tested the circuit in a simulation and the output power is only 12V not 24V Is it something I have done wrong or something else?
Please post an actual schematic. Remember to label the connections, too.


