Shop OBEX P1 Docs P2 Docs Learn Events
Transistor Question - Page 2 — Parallax Forums

Transistor Question

2»

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-05-29 08:37
    I'm not sure if you're trying to light an LED or discuss transistor theory. This flashes the LED every second. It's not very bright due to the handy 10k that was sitting on my bench.
    NPNWireUp.jpg

    CON
        _clkmode = xtal1 + pll16x
        _xinfreq = 5_000_000
             
    PUB Main
      repeat
        Toggle(0, 1_000)
    
                 
    PUB Toggle(pin, ms)
      dira[pin]~~
      !outa[pin]
      waitcnt((clkfreq / 1_000 * ms) + cnt)
    
    Back to my other question. Is there a reason not to use a transistor to PWM a servo?
    This needs more explanation.
    640 x 480 - 29K
  • RagtopRagtop Posts: 406
    edited 2011-05-29 09:04
    So, to sum up. The voltage readings are in the range of what one would expect.

    Put the load on the power side.
    No resister going to ground.

    On the servo control, it has been a while and my memory is horrible. But a while back I was playing with this
    and I thought that I did try running a servo at 5v while controlling it with prop and the results were alot of jitter in the servo movements.

    Why I guess I was thinking the PWM control needed to be closer in voltage to the power of the servo. So I should be able to control any voltage
    servo with a prop pin and a 1 to 2k resister in between?
  • RagtopRagtop Posts: 406
    edited 2011-05-29 09:28
    I just don't know why my brain keeps reverting back the wrong way on this electronic thing. In my mind
    I had the transistor as a gate with voltage on one side waiting to go to other side to play.

    Instead it is more like play can not start on the power side until the gate to ground is closed.
  • PublisonPublison Posts: 12,366
    edited 2011-05-29 10:28
    Do you have a spec sheet or part number of the servo in question.

    Most Hobby Servos can be driven by the 3.3 volt output of the Propeller, (with a ~2.2K resistor in series on the control line). The voltage on the control line has nothing to do with the power and torque of the servo. This is determined by the physical characteristics of the servo, and the voltage and current supplying the power and ground leads on the servo.

    You can send PWM to the control input at 3.3-5 volts, and the servo power, (normally Red and Black), could be supplied by a 7.2 volt battery source, (depending on the stats for your servo). Of course, the controller and servo power must share a common ground.


    Ragtop wrote: »

    Why I guess I was thinking the PWM control needed to be closer in voltage to the power of the servo. So I should be able to control any voltage
    servo with a prop pin and a 1 to 2k resister in between?
  • LeonLeon Posts: 7,620
    edited 2011-05-29 10:35
    Ragtop wrote: »
    I just don't know why my brain keeps reverting back the wrong way on this electronic thing. In my mind
    I had the transistor as a gate with voltage on one side waiting to go to other side to play.

    Instead it is more like play can not start on the power side until the gate to ground is closed.

    The Art of Electronics has a "Transistor man" cartoon that explains transistor operation:

    http://books.google.com/books?id=bkOMDgwFA28C&pg=PA64&lpg=PA64&dq=the+art+of+electronics+transistor+man&source=bl&ots=F38lVL60Vp&sig=ndh5RMpg4Hm_lMxdI7snjoYUo6g&hl=en&ei=nYPiTbfnOY-EhQeptvnyBw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CCAQ6AEwAA#v=onepage&q&f=false

    You should buy a copy.
  • Mike GMike G Posts: 2,702
    edited 2011-05-29 11:30
    Ditto on reading The Art of Electronics

    The transistor is setup as a switch. A small base current supplied by a propeller pin (HIGH) closes the switch and allows current to flow from the 5V source to ground. A low on the pin opens the switch.
    On the servo control, it has been a while and my memory is horrible. But a while back I was playing with this
    and I thought that I did try running a servo at 5v while controlling it with prop and the results were alot of jitter in the servo movements.

    Why I guess I was thinking the PWM control needed to be closer in voltage to the power of the servo. So I should be able to control any voltage
    servo with a prop pin and a 1 to 2k resister in between?

    Servo jitter can be the result of crappy servo electronics, control signal, or power source. To get help you need to supply the type of servo, your code, and your connections.

    Have you taken a look at any of the servo control code in OBEX? Most of the source has comments that describe how to wire up the prop to servo circuit.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-05-29 12:14
    Ragtop,

    As others have stated, it is unlikely you need a transistor to control your servo.

    I think you stated that the servo works with a Propeller but you wanted to get more torque out of it?

    The signal from the Prop has nothing to do with how much torque you get.

    Most of my problems with using a Prop to control servos have been power supply issues. You should be able to power the servo with 6V and use the Prop's 3.3V signal.

    There are a few servos that don't like the 3.3V signal (not many). These are the ones that need some sort of transistor on the signal line. This was discussed lately (I think in the Robot forum). I'll find the thread and post a link here.

    If your servo works at all with the Prop, you probably don't need a transistor. The Prop isn't giving any power to the servo. It's just tells the servo were to move. Increasing the signal voltage will not give you more torque.

    I just reread some of the above posts. It looks like you're already understanding a lot of what I just said. Sorry for repeating thing.

    I'll be back with that link.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-05-29 12:28
    Okay, I found the thread.

    Here's probably the best solution (from post #27): I've tried it successfully myself.
    attachment.php?attachmentid=58334
Sign In or Register to comment.