also, I looking at the datasheet, and it looks like pin one is the signal wire (3.3v), pin two goes too the horns ground, and pin three goes to common ground. Then I need a pull down resistor between pin one and ground and a diode between the horns ground and power.
Does this look correct for the wiring of the mosfet? I will connect the horn to +12v and HORN(-) on the schematic. GPIO14 will be 3.3v when i want the horn ON, and 0v when i want the horn Off.
It's a minor point but R8 is on the wrong side of R9. R8 is there to pull down the GPIO in reset; that problem belongs to the MCU, not the FET, so the resistor needs to be on the MCU, not the FET.
Paul__B:
It's a minor point but R8 is on the wrong side of R9. R8 is there to pull down the GPIO in reset; that problem belongs to the MCU, not the FET, so the resistor needs to be on the MCU, not the FET.
"R8 is there to pull down the GPIO in reset"
I always thought the purpose was to turn off the MOS FET during the floating condition of the GPIO pin at reset.
It is the GPIO that "does" the floating, not the MOSFET, so it is the GPIO that you need to pull down.
It may not matter much - 2% loss of turn-on voltage with these component values, but it is just sensible design to make things as efficient as possible.
Point of interest, if the MOS FET and the controller were on two separate PCBs (connected by wires), where would be the best place for R8 and R9.
I would suggest R8 on the controller PCB (to prevent accidental output pin to ground shorting) and R9 on the FET PCB (to ensure turn off if cable opens).
What do you think?
.
LarryD:
Point of interest, if the MOS FET and the controller were on two separate PCBs (connected by wires), where would be the best place for R8 and R9.
I would suggest R8 on the controller PCB (to prevent accidental output pin to ground shorting) and R9 on the FET PCB (to ensure turn off if cable opens).
What do you think?
.
+1
Otherwise, it makes little difference which side of the 220 ohm the 10K pull down is on. The voltage swings that this circuit is designed for, swamp out the difference. The actual difference with the FET turned on, at the drain, would probably be difficult to measure. But it is true, to present a nearly identical voltage on the FET gate as is on the digital output, the 10K would have to be on the digital output side of the 220 ohm.
I would put them both on the MOSFET PCB. That way if the PCB is disconnected and being handled, any static electric charge on the gate is discharged. It is surprisingly easy to put 100V static onto a bare gate pin.
If these two PCBs are mounted in different boxes, then additional protection resistors on the Arduino side may be indicated. It is too easy to brush the wrong pin with a 12V battery connector.