Hi I am new to this forum, I hope I have posted this in the correct section I have done some searches on this but am still a little baffled
I am planning to use an arduino to control the electrics on a Kit Car
Because car components tend to have a negative earth it makes sense to use a high level switching system so I tried using this kind of circuit which i copied from a robotics website:
The led in this case is the direction indicator flasher unit which is a led matrix using about 200 mA
The problem is that the npn transistor that sinks the base to ground to switch on the pnp darlington (incorrectly labelled mosfet on here by me) is getting v hot with an Ie of 150 mA so i wonder if i need to add a seies resistor to the PNP base :
however i'm not sure if this is right and was not completely sure how to choose it's value looking at the TIP125 data sheet in the on state it quotes Ib values of 10-20mA but this is for collector currents of 3-5A but my led matrix will only draw 200 mA or so so not sure what to use for the series resistor .For 12v ignoring the 2.4K and the transistor resistances when switched on for 15mA led me to choose 800 ohms but would really value some help on this also would like to understand the values for the 2.4 K and the 10K resistors as well
Any help would be gratefully received.
my code which seems to work ok if interested is :
//Switch
int switchPin = 5;
int ledPin = 4;
unsigned long flashfreq = 400;
boolean flashbool=0;
void setup() {
pinMode(switchPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
}
void loop(){
flashbool=(boolean)((millis()/flashfreq)%2);
digitalWrite(ledPin, (!(digitalRead(switchPin))&&(flashbool)));
}