I have 4 small LED lights (raptor lights for a RAV4 grille) for my vehicle and I thought it would be cool if when I start my car, the outer lights would fade in, and then the inner lights would fade in, just for a cool effect when I first turn my car on. I've learned so much so far trying to make this idea happen, but I am at a roadblock and now I have reached out here to see if anyone else would know how I can achieve this.
I have the Raspberry Pi Pico code all set and I have demo code stepping the voltage up to 3.3 V and then back down to 0 V. Using a multimeter, the voltage is stepping how it should.
To power the 12 V source for the lights, I was told that maybe a MOSFET would be best and I hooked up a IRF520 drive module (Link to product) yesterday for the first time. But while the code is executing, the 12 V is not stepping from 0 V to 12 V and then 12 V to 0 V respectively.
I am guessing (and where I need some expertise on) a MOSFET is either on or off based on the signal voltage. Am I correct?
I have some other lights that will be controlled from a timer that I purchased from timers.shop. This timer kind of has this feature, but I want to be able to control the amount of time the fade starts and ends, which the timer is pre-set with a fade value for that.
If anyone could point me in a good direction that would be great. As I am out of ideas currently, as I am a novice to circuit building.
I wanted to post an update on this, and I definitely feel like a newb now. I just received my IRL540N MOSFETs today in the mail and ended up hooking it up and testing the voltage. To my dismay, the voltage was not changing from 0 V to 12 V and from 12 V back down to 0 V using the Raspberry Pi Pico PWM pin. I was really confused why any of the 3 types of MOSFETs were not doing what I needed, so instead of using a voltage meter to check the output voltage, I went ahead and just hooked up the LEDs to the output. To my surprise, my LEDs were fading in and out just how I needed them to! I went ahead and tested some of the other MOSFETs I bought, and sure enough they were doing the same thing.
To sum this all up, it was definitely a learning experience and I should have just checked the lights before but thought checking the voltage would be enough. I am still unsure how the lights are fading in and out if the voltage is not going down to 0 V from 12 V and back up again. So if someone could explain that, that would be great! I'm here to learn!