to just try and turn on the LED, but nothing happens. I'm using pins 5,6,7 for each transistor and am pretty sure I connected everything correctly.
Any suggestions?
Grumpy_Mike:
The variable gatesignal starts off at zero and there is nothing that changes it, so why would it ever get out of that while loop?
Any resistors in seriese with that LED?
Yeah I have 100 ohm resistors between the voltage source/LED and arduino/transistor.
I change the gatesignal but still nothing happens
When you change your code then post it again so we can see what you have done.
Yeah I have 100 ohm resistors between the voltage source/LED and arduino/transistor.
Words don't cut it in electronics. That is a very vague description. Can you sketch the schematic with pen and paper and post a photograph of it please? With component values.
While we are at it a IRF530 needs 10V to fully turn it on and an Arduino can only supply a 5V gate signal. You need a logic level FET
When you change your code then post it again so we can see what you have done.
Words don't cut it in electronics. That is a very vague description. Can you sketch the schematic with pen and paper and post a photograph of it please? With component values.
While we are at it a IRF530 needs 10V to fully turn it on and an Arduino can only supply a 5V gate signal. You need a logic level FET
Okay here are the two ways I changed the GateSignal value:
The second one stands no chance of working because as I said before nothing in that while loop changes the GateSignal variable.
The second one stands more chance because it will miss out the while loop all together. Now you say:-
I'm using pins 5,6,7 for each transistor
For an analogue output ( PWM ) you must use a PWM capable pin. To this end pin 7 is not a PWM capable pin and so you can't use it to dim a FET. The pins you can use are marked with a ~.
Note that the analogue output command only takes values from 0 to 255, after that it wraps round, that means a value of 256 gives the same result as 0.
Also like I said that FET needs 10V but you might get something to show with only 5V, but don't think it will be adequate.
Grumpy_Mike:
Also like I said that FET needs 10V but you might get something to show with only 5V, but don't think it will be adequate.
Hmmm. He seems to have corrected the FET to the IRL540, so that should work.
But the 100 Ohm in the common anode would not be appropriate if more than one colour is to be shown at the one time. There needs to be a resistor in series with each cathode. Now 12 V at 100 Ohm; 100 mA is too much for a single LED. If on the other hand, you really do mean a common anode LED strip, then those resistors are built in.
Hmmm. He seems to have corrected the FET to the IRL540, so that should work.
But the 100 Ohm in the common anode would not be appropriate if more than one colour is to be shown at the one time. There needs to be a resistor in series with each cathode. Now 12 V at 100 Ohm; 100 mA is too much for a single LED. If on the other hand, you really do mean a common anode LED strip, then those resistors are built in.
Okay I added 100 ohm resistors in series with each cathode and replcaed the 100 ohm resistor at the anode with a 1000 ohm one. This is a single RGB LED.
I really just want to see if I can turn on the LED right now with this setup and it still won't. This is frustrating