Help with transistor

Hello!
I'm trying to use esp8266 esp01 for switching a relay. i need a transistor to turn on the relay because the microcontroller doesnt provide enough current to turn the relay on.

I found c945.
http://pdf.datasheetcatalog.com/datasheets2/12/1247641_1.pdf

i connected emitter to gnd, mcu pin trough a resistor to base and the relay to colector.

The problem is when i'm turning on the microcontroller. It wont turn on if the pin pd0 or pd2 is connected to gnd. Using transistor the pin is pulled down somehow. If i turn on the microcontroller and then connect the pin to transistor i can swith the relay witout any problem.

How can i solve this?

post a schematic of how your circuit showing the transistor wiring.

I tried both pins.

iRzKO.gif

That's not what I had in mind. Get a blank sheet of printer paper and a ball point pen and draw the circuit with all the voltages and connections , with labels.
You haven't given enough information to draw any conclusions.

rotarucosminleonard:
The problem is when i'm turning on the microcontroller. It wont turn on if the pin pd0 or pd2 is connected to gnd. Using transistor the pin is pulled down somehow. If i turn on the microcontroller and then connect the pin to transistor i can swith the relay witout any problem.

First never ever make any connections to a circuit while it is powered.

What pin are you using to drive the transistor and why are thes other pins connected to ground? A schematic would make those points clear.

This is so anoying. If you put a large image and you send the message it wil reject and you lose the entire message.

Use Paint to Resize image and save as jeg. (*.jpg).

Did that.same thing. Made it with proteus now

There are two schematics. Left one is the one i used and it wont let the mcu boot.
On Right one, i'm thinking to software set GPOO-0 as low and connect to Transistor Emitter. Wil it hold?

If this wont work, I'm thinking about soldering wires directly to MCU .

In schematics i found GPIO4 and GPIO5 at corners.It may be easyer to solder. Does it worth the effort? Are they ussable?

GPIO pins 0 and 1 are usually reserved for serial communication.

DO NOT EVEN THINK ABOUT SOLDERING TO MICROPROCESSOR WITHOUT FIRST CONSULTING US !

You can use any other GPIO pins (OTHER than 0, & 1).

raschemmel:
You CANNOT use GPIO -0 for driving transistors ! D0 is the SERIAL Rx pin. D1 is the Serial Tx . pin.
Do NOT use EITHER one for ANYTHING EXCEPT SERIAL COMMUNICATION !

DO NOT EVEN THINK ABOUT SOLDERING TO MICROPROCESSOR WITHOUT FIRST CONSULTING US !

You can use any other GPIO pins (OTHER than 0, & 1).

The microprocessor is esp8266 esp01 . You can check the datasheet i posted.

Anyway,on Arduino UNO i know that you can also use pins D0 and D1 as digital outputs if you are not using serial (Serial.begin())

the transistor base resistor is too high. Change it to 470 ohm to 1 k.

it's 1k, i forgot to change the value in schematic. As i said, The circuit it's working.

The only problem is that the microcontroller wont boot with the transistor connected because the Base make connection with gnd when it's not powered. It wont boot if any of two gpio are connected to gnd.

rotarucosminleonard:
As i said, The circuit it's working.

The only problem is that the microcontroller wont boot with the transistor connected because the Base make connection with gnd when it's not powered. It wont boot if any of two gpio are connected to gnd.

Ah, some strange new usage of the word "working" that I was was previously unaware of.

You posted:-

On Right one, i'm thinking to software set GPOO-0 as low and connect to Transistor Emitter. Wil it hold?

It will sink the full relay current through the pin which will probably burn it out.

Are you using the raw chip, a picture would help a lot.

The ESP will go into program mode if GPIO-0 is low during reset.

on ESP8266 it’s more tricky because you need to have GPIO0 pin low when reseting the board to be able to upload firmware.

esp8266-autoreset

so. there is no way you can control something with esp01.

this is the only way i see:

To solder directly a wire to a specific pin.

How can know wich pin is pin number 1,2 and so on.

No idea.
This is an arduino forum.

so. there is no way you can control something with esp01.

Why not use a PNP transistor and current source the relay.

Grumpy_Mike:
Why not use a PNP transistor and current source the relay.

Because it is only 3.3 Volts?