Author Topic: Circuit Malfunction, can't figure out the problem? "Leaky" transistor?  (Read 3579 times)

0 Members and 1 Guest are viewing this topic.

Offline corrado33Topic starter

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Hey guys, long time no post.  Anyway, the regulars here might remember I was building a moving moonlight.  Well, I finally did, but I'm having a bit of trouble with the board I built.  There are NO erroneous connections, I checked every one with the multimeter.  Basically I have an AtMega8.  I have an LED, and a transistor connected to pin 17/PB3 (OC2).  This pin outputs a PWM signal.  But, that's not really the problem, because this happens regardless if I have the MCU in the socket or not.  Here's a quick and dirty schematic for the problem I'm having.


Geeze that pic sucks, here's a link to it so you can zoom in/download it.
http://picasaweb.google.com/lh/photo/1ezKOYv14f3ieDaJ6oA4Bg?feat=directlink

Ok, so as you can see, both the LED and a transistor are connected to pin 17.  Two transistors are then connected to the first.  (I'm not sure if I have it drawn right, but it's connected right, because I've used these transistors in very similar situations before, I always face them the same direction, and power goes in the top, out the bottom, with the control wire in the middle.)  I'm doing this because I have a 5V PWM signal that I want to control 2 12V fans with.  Yes, there are probably better ways, but this is what I thought of.  So the PWM signal is sent through the first transistor, which is controlled by pin D7.  The PWM signal then controls the two other transistors, letting the 12V signal through to the fans, and making me able to control their speed at the same time.  The transistors aren't PWM optimized, but I'm under the speed they can switch at.  Anyway, 12V shows up at wire 1 and 2, which makes sense (obviously, it's connected directly to the 12V source).  However, 12V is ALSO present at wire 3, the control wire for both of the transistors.  This is where I think something is wrong.  12V is also present at the wire connect to D7.  However, when I test continuity, there is 700 Ohms of resistance between the wires 1 and 3 (and obviously 2 and 3).  I thought that was odd, so I checked on another transistor not in use, and I got the same results.  Since there is 12V present at wire 3, the transistor "opens" and lets current through to the fans, which also weirdly enough lights the LED.  I'm so confused, I don't know where I went wrong.  If anyone can offer any wisdom I'd be grateful.  Of course the rest of the AtMega is wired correctly, I just didn't feel like doing the whole schematic.
« Last Edit: June 30, 2010, 06:29:29 PM by corrado33 »

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,208
  • Helpful? 15
  • Hardware and Firmware Designer
    • The Hellinic Robots Portal
You are missing.... "some" resistors....
For whom the interrupts toll...

Offline corrado33Topic starter

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Yes, on the base of the transistors, sorry about that.  Is that my problem though?

Oh, and an explanation of why I need them in the first place would be cool.  I don't see why you would need them?  Again, I'm kinda inexperienced when it comes to this stuff.  I have the imagination of a 5 year old but I don't have the electronics skills to keep up with it. 

EDIT:  Ah, kinda like LEDs, too much current in the base of the transistor will... break it.  Good to know, but again, I don't know if this solves my problem?
« Last Edit: June 30, 2010, 06:59:03 PM by corrado33 »

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
I don't know weather tricky meant pull down/up resistors or current protection resistors but have you tried either/both of those?
Also, if 12v is present in wire 3, thats very bad, for the microcontroller of coarse? Did you mean 5v?
Howdy

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Hi,


It will never work with PNPs only, as the the leftmost transistor will try to put out ~5V on line #3 when pin17 is high and pin 13 is low (and in any other circumstances it will be closed for business).
However, the remaining transistors have their base just ~0.7V below their emitters, so depending on impedances in the different transistors used and the circuit board, line #3 will be somewhere between 5V and 11.3V when the first transistor is open and when it's closed, it depends mostly on circuit board impedances, but I doubt it will ever go to 0V.


This will work:

(Better resolution)

Oh, forgot the values.
Assuming 5V on the controller and a red LED:
R1, 220R
R2, 4k7
R3, 470R
R4, 330R
R5, 330R

No reason to use two lines of I/O, just AND the PWM with the output status and use the resulting signal.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Hi,

Also, if 12v is present in wire 3, thats very bad, for the microcontroller of coarse? Did you mean 5v?
The controller wouldn't care, as it's the collector of the first transistor (think O.C.).
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline corrado33Topic starter

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Thanks guys.  I'm never going to try to add something into a project at the last minute.  I had taken the time to plan out all of the moonlight stuff, but the fans where thrown in when I started building it.  Thanks for the input, I'll eventually get around to hooking them up correctly.  I just snipped the two wires for now to test the LED portion of the moonlights.  I know it's not the best solution, but this is just a proof of concept type thing.  When I do it again/when I redo the circuit board for this one, I'll incorporate everything exactly correctly.  I just feel... dumb, I don't understand, usually I can pick stuff up very quickly, but building circuits is not my strong point. 

On a happier note, the moonlights work perfectly, and the LED I was using as a light sensor worked!

On a more sad note, the LED I attempted to use as a sensor was not nearly as precise as I had hoped, and it wasn't able to do the job correctly. lol

I did order a phototransistor though, (actually 6 of them), so it'll work right when they get here.  Basically what I'm doing is I'm using a sensor to detect when the normal lights go on and off.  When the normal lights go off, the "sunset" lights immediately come on, they dim over a half hour.  It's dark for a half hour (roughly), and then the moonlights start, they end, another half hour of dark, then the sunrise lights come on (same as sunset lights), they stay on until the normal lights come on.  Yes I know I could have done this a different way, like using a RTC (which I'll do next time), but I thought it'd be cool to try to use a LED as a sensor.  I'm done basing projects on what I think would be cool.  Next project, it's going to be "what works".

 

SMF spam blocked by CleanTalk