How to get more current out of a Propeller Asc+ pin?

klk0146klk0146 Posts: 5
edited August 26 in Propeller 1 Vote Up0Vote Down
Hello--
I am using a Propeller ASC+ with a relay that is activated when it receives 30mA. Looking at the specs for the ASC+, it says that it should sink/send approximately 40mA. I am measuring the current output of pin 9 on the board at 1.4mA.

Is this a glitch on my board? Is there a way to increase the output of amps so I can still use this relay?
The specs for the relay can be found here.

Any thoughts or suggestions would be greatly appreciated!

Comments

  • 13 Comments sorted by Date Added Votes
  • jmgjmg Posts: 12,310
    klk0146 wrote: »
    Hello--
    I am using a Propeller ASC+ with a relay that is activated when it receives 30mA. Looking at the specs for the ASC+, it says that it should sink/send approximately 40mA. I am measuring the current output of pin 9 on the board at 1.4mA.

    Is this a glitch on my board? Is there a way to increase the output of amps so I can still use this relay?

    Any thoughts or suggestions would be greatly appreciated!

    What voltage is the relay ?
    30mA is too much to expect from a typical MCU pin, and if you look at the ASC notes here , that shows a 2.2k series R, for '5V tolerance'
    (3v3/2.2k is your 1.5mA)

    That means you cannot drive any relay directly, but any small N-CH mosfet, or digital transistor, would be able to provide the 30mA needed, with low drop across the switch.
    A catch diode across the relay is likely to be also needed.
  • IMO, it's never a good idea to connect a relay directly to an IO pin. Use a small transistor buffer in between.
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
  • "a" relay. What voltage? What current? Either way, it's not about getting more current out of a pin, it's about getting the right current to flow in the relay by running at the rated voltage. However if it is a 5V or 24 coil etc you can't drive it from a "logic" output, the signal needs to drive a transistor or other suitable device that can then handle the rated voltage and current, both of which are usually much higher than a logic output can handle.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    P2 SHORTFORM DATASHEET +++++ TAQOZ documentation
    Brisbane, Australia
  • Thank you for everyones response! The link to the relay we are using is here:

    Please let me know if this changes your thoughts on your suggested solutions. Thank you!!

  • Peter JakackiPeter Jakacki Posts: 7,806
    edited August 26 Vote Up0Vote Down
    5V coil at 30ma could theoretically be driven from "some" 5V logic but in practice it's a bad idea anyway as it is very easy to damage the whole chip for the sake of a 5 cent transistor. Anyway you will never get full voltage out of any logic pin if you load it so imagine that a Prop pin could supply 30ma, but because of its own internal resistance the actual voltage could very well be around 2V, not 3.3V etc. In a similar way the special 5V logic trying to drive a 5V relay would not work as the voltage drop would be significant enough that the relay might not be guaranteed to pull in.

    However a simple NPN (2N2222) etc with a base resistor of around 1k to 3k3 would do nicely and then the collector could drive the relay and of course add a small 1N4148 diode across the coil (cathode to 5V).

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    P2 SHORTFORM DATASHEET +++++ TAQOZ documentation
    Brisbane, Australia
  • Roadster wrote: »
    Here is simply circuit diagram, but you can use any general purpose transistor
    https://www.electronics-tutorials.ws/blog/relay-switch-circuit.html

    In practice the 10k "bias" resistor is never really needed for logic switching circuits as the logic drive is high or low and even if it were floating the npn can't turn on anyway. There are circuits that might need a bias/pulldown resistor but most do not.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    P2 SHORTFORM DATASHEET +++++ TAQOZ documentation
    Brisbane, Australia
  • The 10k pulldown is for when you choose to upgrade to a n-channel mosfet.

    The a bipolar transistor being driven by a PWM signal you'd use a strong pulldown on the base for faster switching.
  • This is a good reason to keep a handful of 2n3904s as 6s and maybe a few TIP3x or TIP12X around. Cheap in any quantity, everyone and their siblings have used them and the Internet is just littered with schematics of all sorts of ways to use these parts...
    Ordnung ist das halbe Leben
    I gave up on that half long ago.........
  • **UPDATE** More questions.
    Thank you for your help. We took the transistor idea and ran with it, but still had the same issue. We then attempted to run down where the current was going (because it is clear we are losing it somewhere).

    We ended up with the propeller board by itself with one wire connected to ground and another connected to an I/O pin that was programmed to send a signal every 5 seconds (we tested pin 8, 9, and 2). Measuring the voltage we got 3.3V, measuring the amps we got 0.2mA.

    Is this a glitch in my board (we tried it with two of my boards). The specs indicate that it should be 1.4--right? Did I blow my board somehow and everything else is working?

    I will also add that this exact same set up (the shield, transistor, etc.) works if we connect it to an Arduino board. I would really like to use the propeller board for various data collection reasons....I mention it because I wonder if there is some fundamental difference in the amount of amps that can pass through the Arduino vs. the propeller.

    Any thoughts? Does anyone else's board give them these measures? Thank you!
  • Peter JakackiPeter Jakacki Posts: 7,806
    edited August 28 Vote Up0Vote Down
    You totally lost me. What and where did you measure? The transistor base current or the relay current etc. You can't "lose" current. Be descriptive in your questions as if you are talking to someone far far away on the phone and they can't see what you see. Tell "them" step by step what you are doing so that they can build up a mental picture and see what is happening without actually seeing it themselves. Put yourself in their shoes or just remember when you were asked to help someone over the phone.

    If you are using an NPN then it will amplify the current going into it's base, but more correctly in this kind of circuit we just want it to turn fully on like a switch so we supply more than enough and more again base current. Rough "rule-of-thumb" is that while you operate the transistor well within its specs that the current gain is around 100, so if we supply 2.5ma to the base/emitter then we would be able to switch up to 250ma. You can't force 250ma into a load when it only draws 30ma at 5V so therefore the transistor can be viewed as a sensitive switch.


    @frank freedman - Please do not mention those big and ugly TIP devices, because that's where they belong! :) There are so many other devices that handle more current with less heat in much smaller packages. Those TIP devices were great in the '70s and perhaps even the '80's. I think even when I was still using TO92 packages that I used little BC337 devices which were rated for 800ma continuous with a minimum gain of 100 but typically a few hundred. However I use smaller SOT-23 devices now that handle even more current with higher gain etc. The TIP devices are darlingtons with 0.8V minimum saturation so you couldn't switch 1A for very long because they got way too hot, these devices were good at the time for momentarily switching heavy loads.

    @Mark_T - When you are driving the transistor from push-pull outputs such as the Prop's I/O then an iddly piddly little 10k resistor doesn't compare to the base being pulled down through a 1k resistor, does it? What irks me is that a lot of circuits are copied from one application and technology to a different application and technology without thinking about what is and what is not needed. The pulldown is useful when being driven at a higher frequency from voltage sources but CMOS of course does its own "pulling down". The other reason for a base/emitter resistor is to act as a voltage divider so that the transistor needs a higher voltage to turn on but that is rarely the case in most circuits.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    P2 SHORTFORM DATASHEET +++++ TAQOZ documentation
    Brisbane, Australia
  • Sorry Peter, Just showing age and lack of proper playtime. Yes, the tips were good for clicking relays and such. But I am working on more playtime, but we will see. So, I guess I will need to get a bit more efficient in my reading for newer stuff.
    Ordnung ist das halbe Leben
    I gave up on that half long ago.........
  • jmgjmg Posts: 12,310
    klk0146 wrote: »
    We ended up with the propeller board by itself with one wire connected to ground and another connected to an I/O pin that was programmed to send a signal every 5 seconds (we tested pin 8, 9, and 2). Measuring the voltage we got 3.3V, measuring the amps we got 0.2mA.

    Is this a glitch in my board (we tried it with two of my boards). The specs indicate that it should be 1.4--right? Did I blow my board somehow and everything else is working?
    I will also add that this exact same set up (the shield, transistor, etc.) works if we connect it to an Arduino board.
    You should focus on voltage, not current.
    How exactly did you drive the Prop pins - 0.2mA is not expected (unless you have 13.5k of total series Base R) , but did you enable CMOS output drive ?
    0.2mA base drive is likely to be light into a generic NPN device with 30mA load, better to target ~ 1mA

    The Ardunio is usually 5V, whilst Prop is 3v3, so you will have slightly less (~ -40%) base drive in a 3v3 system, other items being equal.
Sign In or Register to comment.