If you used an N-channel MOSFET on the low side of the fan, and put the high side onto +12v, you could run the fan at a full 12v (I don't think all of those fans will even spin at 5v) You need to use a transistor to switch high current loads. Stop doing that before you burn out the pin driver. Oh yeah, there's no way you can power a 12v fan that typically uses that type of connector via an Arduino I/O pin, even with 5v, it would draw far too much current (which is what is happening, that's why the pin isn't able to provide a whole 5v). put your main code here, to run repeatedly:ĪnalogWrite(fan1Pin, 250) //Should be linear relation between 0-5V and 0-255 analog output.Ĭorrection: Vin is only supplying 4V when it's supposed to be supplying 12V. put your setup code here, to run once: This pin is PWM enabled for analog output 0-255 Sketch: const int fan1Pin = 5 //Output pin for the fan. It measures 3.23V for DC and square wave is just -000. I am placing it at the exposed yellow wire and the black wire at the base of the fan. I'm using a multimeter set to measure DC voltage and the square wave. Pin 5 (on the PWM side) is an output going to the red (+) terminal on the fan, black (-) terminal is hooked up to breadboard bar wired to the arduino's ground. There's a 12V power supply to the board in addition to USB. Need to see your wiring diagram - have you other stuff connected ? How are you measuring the voltage ? And your sketch - something is wrong but it’s not obviousĪttached picture of wiring setup.
0 Comments
Leave a Reply. |