This is a project from 2015.
I have an RGB LED strip in my dorm room. It came with a controller/remote pair that has 16 color options and a few fading/flashing options. I thought it would be cool to control this strip via Arduino, so I looked for an online tutorial and found this one.
The LED strip runs on 12V and can pull a few amps, meaning that it cannot be directly powered by the Arduino. Instead, we can use transistors controlled by the Arduino. I used three IRF3710 MOSFETs to control the red, green, and blue channels. At first, I had ordered IRLZ34N MOSFETs on eBay. I had trouble getting them to work, and only after a lot of troubleshooting I found out that what I received in the mail was a different model MOSFET with a higher gate threshold voltage. The analogWrite() Arduino function is used to output a pulse width modulation (PWM) square wave to the gate terminal of each MOSFET. By adjusting the duty cycle from 0% to 100%, we can adjust how often the LED is on and therefore adjust its perceived brightness.