Connect with us

Create controlled 50v pulse

Discussion in 'Microcontrollers, Programming and IoT' started by CommanderLake, Jan 24, 2019.

  1. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    I would like to create a controlled 50v pulse of a configurable duration for a high power LED with less than 4 amps possibly using a Picaxe as I've used one before, so I have 2 questions...

    1. Can the picaxe create fairly accurate a pulse down to 1 microsecond, I've not tried.

    2. What circuit would I need to switch a 50v power supply on and off very fast with a 5v signal from the picaxe?

    I have a 60v 5A bench supply.

    Thanks.

    Edit: I realise this might not even be possible because of the slew rate required but it only needs to be fast in the 40-50v range which is where the LED turns on, not all the way from 0v.
     
    Last edited: Jan 24, 2019
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,131
    2,662
    Jan 21, 2010
    I would investigate if the picaxe has a pulseout or simmilar command and read the documentation on it.

    Then I would use my power supply to set the voltage and current limits.

    Then I would use an n channel mosfet as a low side switch.

    Finally, I would use a gate driver to allow the mosfet to be switched as rapidly as possible.
     
    Last edited: Jan 25, 2019
  3. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    All of the drivers I can find with the required voltage are SMT, I'd prefer through hole for prototyping.
     
    Last edited: Jan 25, 2019
  4. Bluejets

    Bluejets

    3,227
    627
    Oct 5, 2014
    Might be a question better directed to the Picaxe forum.
    Also, I'd imagine one bottleneck may be the way you write the program.
     
  5. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    I might have to give up on this project I just cant find a simple enough solution.
     
    Last edited: Jan 25, 2019
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,131
    2,662
    Jan 21, 2010
    I believe there is a simple gate driver circuit in the resources section. Give me a moment to find it...

    Hmmmm.... Not in the resources (I should fix that). Look here.
     
    Last edited: Jan 25, 2019
  7. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,131
    2,662
    Jan 21, 2010
    If you're using an n channel mosfet as a low side switch them the gate probably only needs to be switched to +10V. Depending on the mosfet, the gate may be destroyed if it's pulled higher than 20V with respect to the source. The circuit I linked to above should be powered by maybe 10V to 15V, and can be driven by the output of a picaxe.
     
  8. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    I cant figure out how to use that circuit, do I replace the BJT's with MOSFET's, what does the loose end on the right connect to?
     
  9. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    I finally figured out your circuit, how fast can I expect it to be, how close will it get to the supply voltage when driven with 12v and can the BJTs be replaced with MOSFETs to speed it up?

    How about this MOSFET, it has a nice low on resistance: https://uk.rs-online.com/web/p/mosfets/7840290/

    Could I use this circuit:
    Circuit.png
     
    Last edited: Jan 25, 2019
  10. BobK

    BobK

    7,525
    1,604
    Jan 5, 2010
    You circuit will not switch in microsecond time because the combination of the 1K resistor and the gate capacitance will cause too long a rise time. It will turn off fast, but not on.

    The circuit Steve posted uses two BJTs: one to pull the gate low and the other to pull the gate high. This gives you fast switching times in both directions. The loose end on the right connects to the gate of the MOSFET.

    Bob
     
  11. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    But I thought BJTs were slow?

    ... I just assumed MOSFETs were faster because they are used in switching electronics but it turns out thats just because of the low switching power required.
    So thats a win win then with speed AND low on resistance!
     
    Last edited: Jan 25, 2019
  12. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,131
    2,662
    Jan 21, 2010
    There are a few things to note about that mosfet. Firstly, it has a gate capacitance of several nF for a certain set of conditions, that may be less onerous than the ones you'll face. Secondly, it is a logic level device which means that it may be slower to turn off if the gate is just pulled to 0V.

    The higher the gate capacitance, the higher the gate current required to switch the device in a given time. I have seen gate drivers capable of driving the gate of mosfets with a higher current than will be passed by the mosfet itself! A driver capable of several amps is not unusual. Unless you actually require a logic level device and a low Rds(on), compromising on these can allow you to select a device that will be capable of faster switching, or switch much faster without needing exotic gate drivers.

    In your case, even an Rds(on) of 1Ω would result in only 16W of dissipation, and you have sufficient voltage from your power supply to be able to cover the 4V dropped by the device. I'm not suggesting that you should be looking for 1Ω, just that 0.015Ω is clearly not a requirement. Maybe devices up to a couple of hundred milliohms should not be excluded.

    Using a gate driver like the one I suggested allows you to use a device with a higher Vgs(th). This means the gate driver does not have to pull the gate as close to zero volts before it switches off. Thus, pulling to 0V may be sufficient, rather than having to use a negative rail. This is less of a consideration in your case, however devices with low threshold voltages also frequently have higher gate capacitances, feeding into the problem mentioned above. Because the gate driver can swing the voltage through a larger range than the output of your microcontroller, the need for a logic level device is removed.

    To increase the speed of the driver even more, a schottky diode can be placed with the anode to the base of the first transistor and the cathode to it's collector. This prevents the transistor from saturating. Whilst this will also prevent the gate driver from pulling so close to 0V it will significantly increase the switching speed.

    In general bjt's do switch a lot faster than mosfets (to answer another of your questions). Mosfets have an advantage in lower ON resistance, typically resulting in lower voltage losses (and therefore lower dissipation with consequent reductions in the size of heatsinks).
     
  13. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    So what BJT do you suggest?
    With the BJT switching on the low side it only needs a very small amount of voltage and a current draw determined by the hFE so if the hFE were sufficient the picaxe could probably drive it directly, 1000hFE and a 1k resistor would reduce the current to well within the 25mA per pin limit of the Picaxe.
    Does hFE affect the rise and fall time of the BJT?
     
  14. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,131
    2,662
    Jan 21, 2010
    In that post I recommend 2N3904, but almost any other NPN transistor could be used. If you have 2N2222's, or BC548, etc...

    This circuit will probably deliver a couple of hundred mA to the gate of the mosfet, and that's plenty for most uses.
     
  15. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    What MOSFET? I mean Picaxe>BJT>Load, obviously the hFE would need to be sufficiently high.
    Circuit.png
     
    Last edited: Jan 26, 2019
  16. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,131
    2,662
    Jan 21, 2010
    A simple Darlington transistor can be slow to turn off. It may be better to use a pair of transistors with the second one having a resistor from base to emitter to turn it off faster.

    You may find that the voltage drop across the transistor is higher than for a mosfet too. In your case it shouldn't be too much of a problem.
     
  17. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
  18. BobK

    BobK

    7,525
    1,604
    Jan 5, 2010
    55 MHz is not that high. A 2N3904 is 300 MHz.

    Edit: Which does not mean that it can switch that fast. Saturation switching is much slower, probably in the range of 1-10 MHz. Transition frequency is where the gain goes to 1.

    Bob
     
  19. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,131
    2,662
    Jan 21, 2010
    If you check the datasheet you'll notice an internal resistor to speed up the switching off of the device. (That's a good thing)
     
  20. CommanderLake

    CommanderLake

    155
    2
    Oct 2, 2012
    The Vce of the 2N3904 is too low.

    I'm testing the circuit in post #15 with a spare BC547C, a 910 ohm load and a USB oscilloscope and I can see how the turn off time increases with a higher resistance to base which explains the slow turn off time with saturation switching as Bob said.

    But Steve, your MOSFET driver circuit uses a similar resistor>base configuration to switch the MOSFET off which you say is slower than a BJT?

    If I dump the Picaxe could I create a purely 50v logic circuit that creates pulses of a precise length or would I need to ask that in a different part of the forum?
     
    Last edited: Jan 27, 2019
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-