switching a transistor ?

Tonight for fun i programmed thr arduino with the blink program and connected the pin 13 and gnd to the swithing pins of a SN3055 transistor

the power side of the transistor was connected to a 12v motor and battery

i expected to see the motor switch on and off in 1 sec intervals

however what i actally saw was the motor speed up and slow down in 1 sec intervals - the led on the arduino was going dim them bright but not on and off

what did i do wrong ?

I can't even find a datasheet on SN3055 - do you have a link?
Do you have diode across the motor to protect against back EMF? May keep your transistor from being damaged.

Post your code & datasheet link, let's see what you're doing.

And where was ground connected with your battery/transistor/motor?
Hopefully you had something like
+12V to motor to transistor collector, transistor emitter to ground.
Arduino output to 220 ohm resistor (or higher) to base of the transistor.

Did you 2N3055 instead of SN3055?

Transistor was indeed a 2n3055

data sheet here - http://docs-europe.electrocomponents.com/webdocs/0469/0900766b80469a73.pdf

  • from battery to motor then from motor to the pin 2 emitter
  • to battery from the transistor can

the pin 13 from the arduino is connected to the pin 2 emitter
the gnd from the arduino is connected to the pin 1 base, i did not use a 220 ohn resistor

the code is exactly the same as the blink example

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}

“hfe 20 - 70”
Hmm.

does this mean is requires quite a bit of current to get it to switch on correctly ?

If I understand CrossRoads correctly, the setup should be as attached diagram. Just change the diagram output pin 4 to your pin 13.

I think ( Gurus please confirm here ) that you should be able to replace the relay in the drawing with your motor, and connect it to the 12v+ instead of the 5v+.

Alternatively, use the relay as shown and replace the “siren & strobe” with your motor.

DRAWING9a.jpg

I think you want Arduino GND connected to pin 2 and battery -. Pin 13 connected to the transistor base (pin 1). Transistor can to motor then to battery +.
And put a reversed diode across the motor or risk burning something out.

That would be the "standard" way of doing it anyway. Your way is pretty fascinating as the relative voltages between the battery and arduino circuitry float around. Pretty hard to figure out.

@DaveO: did you post that to the correct thread?

AndrewStone:
@DaveO: did you post that to the correct thread?

Yes. It is a drawing I did a few weeks back while learning how to control a transistor with the Arduino, and have the transistor drive an external component ( be it a motor, relay, siren, strobe light, etc )

I just thought the diagram may help the original post understand the wiring better. Is there a fault with it ?

Gadget999,

"+ from battery to motor then from motor to the pin 2 emitter

  • to battery from the transistor can
    the pin 13 from the arduino is connected to the pin 2 emitter
    the gnd from the arduino is connected to the pin 1 base, i did not use a 220 ohn resistor"

No. No no no. Those connections are just wrong.

With that transistor, you need to have it hooked up like here with your motor and +12V replacing the coil of the relay.

Hi Guys

thanks for all the advice

I am going to pop down the electroinics shop later to buy some parts

can anybody recommend a mosfet and or diode i should be buying ?

speak soon

Mike.

i found this circuit and will get this mosfet and diode

You may need a heatsink for that FET - it only turns fully on at 10V, if I'm reading the datasheet correctly.

cheers - i will see what heat sink i can get for it

the spec says it ca run up to 175C ! http://www.irf.com/product-info/datasheets/data/irf540n.pdf

when you say it only turns on fully at 10V, does it resistance drop as it passes more voltage ?

does the arduino have enough available current to be able to switch it ?

does the arduino have enough available current to be able to switch it ?

FETs are operated by voltage, not current (well, technically...no, let's not go there just now).
Logic-level FETs saturate at lower gate voltages (5V instead of 10V), but are a bit harder to find.

I got all the parts and a suitable heatsink and it all worked first time. Time now to pwm the arduino to adjust the motor speed. Should i be using an analogue output to do this?

Unless you really want to test the capabilities of the heatsink, PWM would be an excellent idea.

"Logic-level FETs saturate at lower gate voltages (5V instead of 10V), but are a bit harder to find."

Where have you been looking Awol? Digikey has 13 pages of thru hole logic level n-channel mosfets -some duplication of course with 2000 lot min buys & such, but still a lot of choices.

Where have you been looking Awol?

When I look, it is usually in my desk drawer, where there is an adequate supply, however the OP

I am going to pop down the electroinics shop later to buy some parts

(anyway, have you seen the prices Dodgykey charge for UK shipping?)

Yeah, you guys seem to get a bit of a bum deal over there.
There is no England/UK/Europe equivalent?