![]() ![]() If the run current isn't too high you can sometimes add a large capacitor (500-1000uF) between 5V and GND to provide the momentary current spike when the motor starts. In this case you need to power the motor from a power source that doesn't go through the Arduino. Your motor spec doesn't include stall current or winding resistance, but it shows a run current of 0.4A (400mA) and stall current is always larger than run current, so it's probably high enough to cause a problem. If you are powering your motor from an Arduino then you are pretty much limited to 500mA before the voltage will sag and cause the Arduino to reset, restarting the sketch. Stall current is equal to the applied voltage divided by the motor's electrical resistance. ![]() When a motor starts up it will momentarily draw its "stall current". I only have two NPN models: PN2222 and S8050. My question is: does anyone know the best transistor (either BJT or MOSFET) I can buy just to act as a simple switch? I don't want a transistor with a high hFE, since I don't want to amplify current. Simulating the circuit above the DC motor shows a higher rpm ( 9982 rpm) than if I connect it to pins GND and 13 (which is in this case 5555 rpm) - as the 5V Power pin outputs 500mA. Therefore I though about using an NPN transistor as a switch, just like the figure above shows. I tried connecting the DC motor directly to the GND and 13 pins, but since the digital pins' output current is very low (I think 40mA), the DC motor won't rotate fast enough for my application's needs. PinMode(13, OUTPUT) // sets the digital pin 13 as outputÄigitalWrite(13, HIGH) // sets the digital pin 13 on For simplicity reasons, let's assume the code is just a simple digitalWrite(13, HIGH), as soon as the Arduino is turned ON: Many thanks for all the helpful replies.I'm developing a specific project that requires a DC motor to be turned ON and OFF via one of the digital pins - I'm using an Arduino UNO Model R2. So, removing the LCD shield and wiring everything directly into the Arduino with a separate push button, everything started working as expected. Eventually, after many attempts at getting the circuit to work, even the LED stopped working and that's when I realised that there must be a continuity problem with the header connections. This would explain the anomaly that only the LED lit up as expected, but the fan failed to work: presumably the weak current into the transistor's Base created sufficient gain to power the LED, but not the fan. It seems that the LCD shield I was using has some fault which only allowed limited current to flow from the corresponding Arduino pins. As the LCD shield occupies all the header pins on the Arduino, the LCD shield helpfully provides circuit connections for the unused Arduino pins. As mentioned in the question, I was using a button wired into an LCD shield. So the question is, why does the circuit work as expected for the LED, but not for the fan? Any help/suggestions will be greatly appreciated! ![]() I've tried different pins on the board, but always get the same result. But in my case, the current from the relevant digital pin to the transistor's base never goes higher than 1.4mA. My understanding is that an Arduino digital pin should easily supply this. Measuring the current from VIN (or the 5V pin) to base, I get 4mA, so my assumption is that 4mA is sufficient to saturate the base. If I take a wire directly from VIN or the 5V pin and touch it to base (through a resistor, of course), it does succeed in saturating the base, and the fan turns on. It does turn the LED on and off as expected, but the fan needs much more current than the LED. The problem that I have is that the Arduino's digital pin doesn't seem to be able to saturate the base, so not enough current passes through the transistor to power the fan. My expectation is that, when I press the button, the digital pin wired to the transistor's base will cause the transistor to close the circuit and turn the fan (and LED) on for five seconds. the relevant digital pin is switched from LOW to HIGH for a determined time in response to a button press recorded on A0.įor simplicity, I'm showing a separate button component in the diagram, but I'm actually using a button that's wired into an LCD shield. I'm using a 2N2222 transistor as a low-side switch to turn a 5V computer fan on and off with an Arduino digital pin, which responds programmatically to a button press - i.e. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |