I don't have the right power supply to drive the motor, so just for testing, I've connected a regular 12V DC power supply to the DC IN terminals, and a red LED with a 1k resistor to the output terminals. I've also connected the board to a PWM and GND pins on Arduino and wrote a code to change the signal from 0 to 100% duty cycle and back. Basically this setup:
The code is working - the status LED on the board is changing its brightness. However, my test LED is constantly ON with full brightness (turns off only when PWM is at 0%) - so it basically behaves like a switch.
I don't know. I can't see your code or your actual circuit. But if the onboard LED is changing brightness but the other isn't then I'd guess you have it connected wrong, either to the wrong location on the module or the wrong Arduino pin.
Actually, you need to upload the code, we didn't see any detailing about the problem is.
But, i found something on website page about IRF530, have you check it?
Here's my code, a photo of the circuit and better photos of the board itself. The labels on the bottom are Chinese, but google translates them to "Power terminal" - that's where I connected the DC 12V and "Output" - where I have connected the LED.
You should have:
PS + to LED anode, current limit resistor to cathode to MOSFET drain, MOSFET source to PS - (GND), PS GND to Arduino GND, input to gate to Arduino output pin. NOTE: IRF530 is NOT a logic level part, 5V on the gate will barely turn it on, no good for higher currents. Maybe the optocoupler will let it work for 10V and up.
EDIT: With the opto, you may not need to connect grounds,
I've checked all the connections on board and made a schematic. The transistor turns on and stays on all the time (It's off only when my PWM duty cycle is at 0%), not changing the brightness of my LED.
That board will not support PWM. It has a 10k resistor on the gate
tlisek:
I've checked all the connections on board and made a schematic. The transistor turns on and stays on all the time (It's off only when my PWM duty cycle is at 0%), not changing the brightness of my LED.
That's not a working circuit. You have made a mistake as the gate is permanently clamped at the negative
rail and thus the MOSFET must always be fully on.
Also the resistor values are way too high for PWM to be possible - this could explain the behaviour
you see.