I am using a transistor to switch on and off power to a ringer circuit as the diagram shows below. What sort of code would I use? I want to keep the current and voltage as low as possible to minimize risk to the arduino.
PS Does anybody know if I should remove or add resistors? I'm not sure if I should keep the 100K or 2.2K or if it would hurt to leave them in.
holmes4:
Ask your self what logical inputs does the transistor need?
Mark
I looked around and its mostly just physical diagrams without any clue on how to approach the code. I'm using either a TIP120 or a NTE2987 Logic Level Mosfet.
I guess the closest I can figure is to set pin X to output with pinmode() and then digitalwrite to set it to High and Low thru digitalWrite to turn it on or off?
11I just need to switch the transistor on and off to stop and start flow to the ringer. Also wondering about the resistors too.
I guess the closest I can figure is to set pin X to output with pinmode() and then digitalwrite to set it to High and Low thru digitalWrite to turn it on or off?
Exactly correct. The transistor is a switch that the Arduino turns on or off by applying, or not, voltage to the gate.
MarkT:
What on earth is that 100k resistor on the emitter of the TIP120 doing????
it prevents excessive current from the 12v ground to the 9 volt ground. ??
since base on a TIP120 is pin 1, the signal is from the GSM to switch the ground between power supplies ????
why such a large transistor ? a PN2222 or even a 2n7000 mosfet ?
this diagram needs more labeling.
I would suggest you determine the actual power used and to learn to use a transistor. there are many great articles on how to select a resistor. I suspect you will find your answer with a better understanding of them.
//RINGING CODE
int ringPin = 4 // transistor connected to digital pin 4
void setup()
{
pinMode(ringPin, OUTPUT); // sets the digital pin as output
}
void loop()
{
digitalWrite(ringPin, HIGH); // sets the ring on
delay(2000); // waits for two second
digitalWrite(ringPin, LOW); // sets the ring off
delay(4000); // waits for four seconds
}
dave-in-nj:
100K Resistor?
Pull down resistor for controller failing to open. I moved it to a new position
dave-in-nj:
1
why such a large transistor ? a PN2222 or even a 2n7000 mosfet ?
THe LL Mosfet was the only LL Mosfet available. The tip 120 was the transistor used in the article I referenced.