Problem driving a 12V/20mA frequency inverter with BC517 transistor

Situation

Using an Arduino Nano, a BC517 transistor, a 4K7 base transistor and the circuit below I tried to control a 12V/20mA (says datasheet, I measured 14V/40mA) flow, which should go from the +12V to the controller enable pin which switches on a EVF8202-E frequency inverter.

Expected result

There should flow current to the controller enable when the Arduino puts 5V on the transistor, and not so otherwise.

Actual result

Unfortunately the motor always starts when I connect the transistor, even if the base is connected to the Arduino ground.

Possible problem points I thought about:

Base resistor

I calculated the 4K7 value with help from this post (and others), which led me to believe that with a 5K resistor I'd get a base current of 1mA, which with a gain of 100 (I checked the datasheet on this) would mean it would be able to saturate collector currents above 100mA, which is fine here.

Transistor

The first time I connected the transistor without the base resistor, and I don't think I've blown it but who knows... so I took a second transistor and tested with the base resistor with above results, which were the same for both transistors.

Circuit

Of course I've googled around a lot, and found a lot of examples to control a dc motor with a transistor like this. The circuits look similar, although they use an extra diode because of the dc motor and the motor is on the other side of the transistor, which I think shouldn't matter.

Test code

I'm sure there's nothing wrong with that because I tested the output with a multimeter, 4.7 volts for high and 0.7 volts for low.

Project

Would someone be interested why, I'm trying to control the solar panels at home to get them always at an optimal angle. Android app included, hooray for ethernet shields.

Don't try to switch the 12V, switch the GND and you are all set :slight_smile:

And if you really really need to switch high side you need a two stage design with a NPN and a PNP.

septillion:
Don't try to switch the 12V, switch the GND and you are all set :slight_smile:

Ah, I noted indeed that I did that different from other people but didn't know it mattered.

So, say I have on the frequency inverter one GND pin, one +12V pin, and one enable pin, how would I switch the GND? Would I connect the +12V and enable, and then switch the wire going from the enable to GND?

(I'll just try it anyway when it gets dry outside, and come back here when I have results)

I googled a little, and it seems I need a low side switch because I have a NPN transistor?

Where is the datasheet for this drive? Is it opto isolated?

PHPirates:
Would I connect the +12V and enable, and then switch the wire going from the enable to GND?

Of course this will not work, because when I connect +12V to enable the motor will start no matter what else I do, I guess.

MarkT:
Where is the datasheet for this drive? Is it opto isolated?

When I google for the datasheet, I get the operating instructions which mentions on page 4-11 the pinout, and the full datasheet.

I googled for opto isolation, but I don't see what that has to do with this?

Eurgh, v. poor datasheet, doesn't even tell you if the "power for digital inputs" is an input or an
output!

You'll have to find out whether the digital section is opto-isolated with a multimeter.

If its isolated and it provides its own power, you can very simply use an NPN to switch it.
If it doesn't provide its own power you have to provide at least 12V externally and high-side
switch it.

MarkT:
Eurgh, v. poor datasheet, doesn't even tell you if the "power for digital inputs" is an input or an
output!

You'll have to find out whether the digital section is opto-isolated with a multimeter.

If its isolated and it provides its own power, you can very simply use an NPN to switch it.
If it doesn't provide its own power you have to provide at least 12V externally and high-side
switch it.

Haha agree it took me a lot of time just to find that pinout... I just noticed the link to the datasheet seems broken, I hope you got the right one (EVF8202-E)
but I still don't see where you saw ''power for digital input"?
I can tell you though that pin 20 does provide +12V, I measured around 14 volts, so when I connect +12V with enable the motor starts running. The operating instructions speak of "Voltage supply for digital inputs" but oh... wait a second. It's listed under 'digital inputs'... Hmm. I'm confused now.

But I still don't see exactly what you mean with opto-isolated here, google tells me

"In electronics, an opto-isolator, also called an optocoupler, photocoupler, or optical isolator, is a component that transfers electrical signals between two isolated circuits by using light."

Hi,
This is what you are looking for.


Tom... :slight_smile:
In the contents under CONTROL CONNECTIONS

Thanks Tom, nice find, only one page further... So 20 indeed is a positive supply voltage pin, as it's labeled Vcc.

So since I want to switch the ground, I need to intercept the connection somewhere right? I use supply with internal control voltage I think, so the first image.

But I don't see how I could come between the connection from 28 to the internal GND 2?

Oh, hang on a second. Now looking at the second picture, and there I can switch the connection to ground. Is that the way to go? So I'd need to figure out a 14V power supply... but the only connections I have to draw power from are in the picture...

I just bought some PNP transistors and made a high side switch now, using a circuit for example from Stackexchange. I used R1=4K7, R2=1K and R3=10K, as suggested in a comment there.

But now the motor doesn't do anything... be the Arduino pin high or low. I checked and there is 14V between +12 and the GND, but I don't know of more things to check. Ideas?

Sorry for the bumping, but I just measured some things.

When the Arduino pin is low, I measure around 14 volts across both transistors, which is fine.

When the Arduino pin is high, I measure again around 14 volts across the NPN transistor and 11 across the PNP one, which I think is not so fine especially for the NPN transistor which should start conducting when I put 5V at the base, right?

(We also replaced the transistor just in case it was broken, and tested some other crucial connections, although not all)

Try connecting terminal 20 to Q1 collector, Q1 emitter to RUN (28?) Arduino output pin to R1 and Arduino GND to 39, should work.

Hi,
As outsider has said, BUT
pin 20 to Q1, Emitter
pin 28(run), or what ever pin you want to switch, to Q1 COLLECTOR
pin 39 to Arduino GND.

Leave out the LOAD as that is provided inside the Lenze.

Q1 is PNP transistor

Tom.... :slight_smile:

Correct! I sprach to quickly :-[
TNX Tom, K++

outsider:
Try connecting terminal 20 to Q1 collector, Q1 emitter to RUN (28?) Arduino output pin to R1 and Arduino GND to 39, should work.

**[Edit]**Nevermind, someone else just explained that of course you have to connect the Arduino ground because otherwise there will never be a closed circuit from the Arduino I/O pin... Thanks a lot for the heads up!

TomGeorge:
Hi,
As outsider has said, BUT
pin 20 to Q1, Emitter
pin 28(run), or what ever pin you want to switch, to Q1 COLLECTOR
pin 39 to Arduino GND.

Leave out the LOAD as that is provided inside the Lenze.

Q1 is PNP transistor

**[Edit]**Oh I just saw that collector and emitter are the other way around on a PNP compared to NPN, so we accidentally had it connected the way you suggested. So the only new thing is the 39 to Arduino GND.

Oh, and I noticed Q2 is a BC547 NPN transistor, not a BC517, not sure if it matters.

I will try this out to confirm the solution when I get home again, unfortunately that'll only be the day after tomorrow.

Thanks everyone for your help!

Just to be clear, this is how I understand I should wire it up.

Why isn't the transistor emitter connected to circuit GND ?

My post should have been:
Try connecting terminal 20 to Q1 emitter, Q1 collector to RUN (28?) Arduino output pin to R1 and Arduino GND to 39, should work.
Switch terminals 20 & 28 in that last picture you posted. Sorry for my confusion. :-[