0
\$\begingroup\$

I have a small issue here.

I am trying to drive a coil from an AtTiny85. I am sending an output signal to a transistor and the transistor will then connect to a coil.

I know that I am sending the proper signal to the transistor, but this is not passing it properly to the coil. I am getting an output with noise and it is definitely not a square wave.

Am I missing a Diode? Did I pick a wrong transistor ? Do I have a wrong resistor value?

I am attaching the pictures of the circuit,data sheet and of the oscilloscope.

The transistor picked is an MMBT3904

Schematic

The signal that is connected to the base is the 2.5 kHz signal coming from the ATtiny that passes trough the 1k resistor.

npn chart

These are the properties of the transistor.

Do any of you have any ideas or suggestions?

I am adding the pictures of the oscilloscope

enter image description here

The code intends to change the frequency, and it is actually doing it, but not as intended.

enter image description here

enter image description here

I have also changed the BJT for a Mosfet, it did not work. I keep getting the same results.

\$\endgroup\$
14
  • \$\begingroup\$ Do you have any oscilloscope screenshots? What about using proper symbols for your schematic? \$\endgroup\$
    – Bart
    Commented Aug 15, 2016 at 14:21
  • \$\begingroup\$ What's Vcc, what is the DC resistance and the inductance of your coil? \$\endgroup\$ Commented Aug 15, 2016 at 14:24
  • \$\begingroup\$ "... with 2.5 (+/-500) kHz signal." Do you mean 2.5 (±0.5) kHz? \$\endgroup\$
    – Transistor
    Commented Aug 15, 2016 at 14:24
  • 2
    \$\begingroup\$ "Am I missing a Diode" - yes \$\endgroup\$
    – brhans
    Commented Aug 15, 2016 at 14:30
  • 1
    \$\begingroup\$ @Gioben: Fix the title then. ;^) \$\endgroup\$
    – Transistor
    Commented Aug 15, 2016 at 15:37

1 Answer 1

1
\$\begingroup\$

I am getting an output with noise and it is definitely not a square wave.

This is what I'd expect to see: -

So, start at the beginning with the transistor deactivated.

You then push current into the base from your MCU and pretty immediately the collector voltage falls to a few tens of milli volts above 0V. Within microseconds, this low voltage starts rising towards a couple of hundred milli volts (as one would expect given that the inductor current is rising from zero amps and the transistor's job is becoming more difficult).

Then you switch off the base and the collector voltage rises to (possibly) a few hundred volts except maybe the transistor breaks-down because the back emf (due to open circuiting the inductor). It might damage the transistor but you might get away with it due to a certain amount of current limiting from R4 and parasitic capacitance.

This high positive voltage surge might last hundreds of micro seconds then all the inductor's stored energy is gone and the collector will drop (whilst possibly oscillating/ringing a bit) back at Vcc (providing it didn't get damaged too much).

Then the process repeats.

\$\endgroup\$
11
  • \$\begingroup\$ How can I fix this ? \$\endgroup\$
    – Gioben
    Commented Aug 15, 2016 at 14:55
  • \$\begingroup\$ i just want the coil to be driven at the oscillating 2.5 kHz signal. I would have to change my diagram or the transistor ? \$\endgroup\$
    – Gioben
    Commented Aug 15, 2016 at 14:56
  • \$\begingroup\$ I have provided the screenshots. \$\endgroup\$
    – Gioben
    Commented Aug 15, 2016 at 15:25
  • \$\begingroup\$ What is the coil for? How is it that you know the current is supposed to be 20mA? Do you have a datasheet or part number for whatever device you are using that possesses the coil? \$\endgroup\$
    – jonk
    Commented Aug 15, 2016 at 15:47
  • \$\begingroup\$ @jonk I need it to be 20mA there is no device that possesses the coil, it is just a bare coil, I am using it for its magnetic field \$\endgroup\$
    – Gioben
    Commented Aug 15, 2016 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.