Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 26

Thread: Teensy 4.0 using external power

  1. #1
    Junior Member
    Join Date
    Jan 2021
    Posts
    11

    Teensy 4.0 using external power

    Hello everyone,
    This is my first time ever using a teensy so this might be a dumb post but here it goes.
    I cant seem to get my teensy 4.0 to work with external power to the Vin, without usb.
    Ive followed this example:
    https://www.pjrc.com/teensy/external_power.html

    Ive cut the 5vin from the usb on the board.
    The source is 5v (which ive tested with a multiemter) and connected the 5v to the 5v in of the teensy and the ground of the teensy to the ground of the source. And well, nothing, I cant get the Teensy to boot.
    Ive tested with Leds to see if it was an issue with the power source but it works as expected.
    The only bit of code running is the blink tutorial:

    Code:
    void setup() {
      pinMode(ledPin, OUTPUT);
    }
    
    void loop() {
      digitalWrite(ledPin, HIGH);   // set the LED on
      delay(1000);                  // wait for a second
      digitalWrite(ledPin, LOW);    // set the LED off
      delay(1000);                  // wait for a second
    }
    Any help would be greatly appreciated.
    Last edited by sleep.totem; 01-31-2021 at 01:09 PM.

  2. #2
    Junior Member
    Join Date
    Jul 2017
    Posts
    18
    Could be one of the reasons:
    if you are using the Teensy4.0 without the usb cable plugged in make sure there is no
    Code:
    while(!Serial);
    in your setup function, right after the Serial.begin(); Use a delay of few hundreds milliseconds instead of the while loop.
    That line make the Teensy wait until the USB serial port is enumerated by the host system. Without the USB connection is it an endless loop, hence the program is not started.

  3. #3
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Thanks for the reply but I dont think there is any Serial mention on the code so im guessing its something else.
    This is the entire program thats loaded on the teensy:

    Code:
    void setup() {
      pinMode(ledPin, OUTPUT);
    }
    
    void loop() {
      digitalWrite(ledPin, HIGH);   // set the LED on
      delay(1000);                  // wait for a second
      digitalWrite(ledPin, LOW);    // set the LED off
      delay(1000);                  // wait for a second
    }

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,907
    No value shown for ledPin? Missing code?

    Does the Teensy 4.0 show anything of the RED LED when the button is pressed?

    Does the code compile and upload properly?

  5. #5
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,150
    So I tried to compile code
    ledPin not declared
    #define ledPin 13
    should help

  6. #6
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Apologies for that, somehow the copy paste screwed me, this is the actual entire block
    Code:
    int ledPin = 13;
    
    void setup() {
      pinMode(ledPin, OUTPUT);
    }
    
    void loop() {
      digitalWrite(ledPin, HIGH);   // set the LED on
      delay(1000);                  // wait for a second
      digitalWrite(ledPin, LOW);    // set the LED off
      delay(1000);                  // wait for a second
    }

  7. #7
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Quote Originally Posted by defragster View Post
    No value shown for ledPin? Missing code?

    Does the Teensy 4.0 show anything of the RED LED when the button is pressed?

    Does the code compile and upload properly?

    When plugged to the 5v source nothing happens, no leds turn on, pressing or holding the button on the teensy does nothing.
    When plugged with usb to a computer everything works correctly. Code compiles and uploads properly, led blinks.

  8. #8
    I take advantage of the query, since I consider that it goes in the same direction: external source for teensy 4.x.

    How bad is it to connect an external source directly to the microUSB connector, let's say like a powerbank with a 5V@2.1A supply, without cutting the VIN-VUSB bridge?

  9. #9
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,150
    Quote Originally Posted by TFTLCDCyg View Post
    I take advantage of the query, since I consider that it goes in the same direction: external source for teensy 4.x.

    How bad is it to connect an external source directly to the microUSB connector, let's say like a powerbank with a 5V@2.1A supply, without cutting the VIN-VUSB bridge?
    Teensy does not know if 5V on USB is from PC or from powerbank.
    VUSB and Vin go to LDO that generates 3.3V for Teensy.
    if VUSB-Vin is cut, ONLY Vin is providing power to Teensy, so Vin must be always provided.
    If you do not cut VUSB-Vin and provide both inputs, you may, AFAIK, destroy either Vin powersuply or PC USB port, but not Teensy.
    (A look to schematic is always useful)

  10. #10
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Quote Originally Posted by sleep.totem View Post
    When plugged with usb to a computer everything works correctly. Code compiles and uploads properly, led blinks.
    Do you mean USB only, or USB and 5V external power connected?
    Can you show us a photo of your setup? And a close-up photo of the backside of the Teensy 4 [where you cut the pads]?

    Paul

  11. #11
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Quote Originally Posted by PaulS View Post
    Do you mean USB only, or USB and 5V external power connected?
    Can you show us a photo of your setup? And a close-up photo of the backside of the Teensy 4 [where you cut the pads]?

    Paul
    Usb only with no external 5v works fine.
    Heres is the connection I have with the external power setup:
    5v of power supply is going to the 5v (Vin) pin in the teensy and ground of the teensy is going to ground of the power supply.
    Apologies for the quality of the images.
    Click image for larger version. 

Name:	WhatsApp Image 2021-02-01 at 17.04.03 (1).jpg 
Views:	22 
Size:	52.6 KB 
ID:	23549
    Click image for larger version. 

Name:	WhatsApp Image 2021-02-01 at 17.04.03.jpg 
Views:	27 
Size:	58.9 KB 
ID:	23550

  12. #12
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Code:
    Usb only with no external 5v works fine
    This means that the Vin was not separated from the USB.
    Are you sure that you cut the very small trace between the pads [as indicated in the red circle]? Please measure with an ohm-meter whether it's really cut-through.
    Click image for larger version. 

Name:	T4.PNG 
Views:	13 
Size:	311.3 KB 
ID:	23551

    Paul

  13. #13
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Quote Originally Posted by PaulS View Post
    Code:
    Usb only with no external 5v works fine
    This means that the Vin was not separated from the USB.
    Are you sure that you cut the very small trace between the pads [as indicated in the red circle]? Please measure with an ohm-meter whether it's really cut-through.
    Click image for larger version. 

Name:	T4.PNG 
Views:	13 
Size:	311.3 KB 
ID:	23551

    Paul
    You were correct, I have now properly cut the trace between the pads and measured it. Now it it is not turning on when usb is connected.
    However its not turning on with external power either, even when usb + 5v is plugged, no leds, no button response, nothing.

  14. #14
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,958
    A couple of things: Make sure you don't have both USB and external power on at the same time. With external power check measure your voltage between the ground pin and the Vin pin on the teensy itself? With USB plug in make measure the voltage between that through hole and the ground pin? Check to see if any components are getting hot? Measure voltage between 3.3v and Ground pin? Should read 5v in the 1st 2 cases and 3.3v in the last case.

  15. #15
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Quote Originally Posted by mjs513 View Post
    A couple of things: Make sure you don't have both USB and external power on at the same time. With external power check measure your voltage between the ground pin and the Vin pin on the teensy itself? With USB plug in make measure the voltage between that through hole and the ground pin? Check to see if any components are getting hot? Measure voltage between 3.3v and Ground pin? Should read 5v in the 1st 2 cases and 3.3v in the last case.
    Ah i think we might be onto something.
    With external 5v and ground connected to the teensy: measuring the 5v + ground gives me a reading of 4.0v and measuring the 3.3v + ground gives me a reading of 1.0v
    Measuring the power source 5v + ground without teensy gives me a 5v reading so the power source seems correct.
    I tried with different spots on the breadboard to see if it was a faulty row or something but same results.
    I havent noticed anything getting hot.
    I am no electrician nor smart enough to deduce whats going on here

  16. #16
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,958
    Quote Originally Posted by sleep.totem
    With external 5v and ground connected to the teenst: measuring the 5v + ground gives me a reading of 4.0v and measuring the 3.3v + ground gives me a reading of 1.0v
    Ok to me doesn't sound good. If you are only getting 1.0v on the 3.3v-Gnd you may have burnt out your T4. Only thing I can suggest at this point is to retouch your solder joints on the T4. You may have a flaky solder connection on Vin and Gnd pins.

    There were some troubleshooting guidelines that I saw but can't seem to find now.

  17. #17
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Perhaps the red and yellow wire in your setup are flaky? I have had problems once or twice with such wires...

    When the 5V and 3V3 are present, but still no blinking, you can do a factory reset of a Teensy 4: power it up and then press & hold the program pushbutton for around 20 secs [until you see a little red LED next to the USB connector flash]. You then release the pushbutton and the Teensy will do it's factory reset cycle. That takes also around 20 secs with the red LED turned on bright. After that, the red LED will turn off and the orange LED should start flashing like in the Blink sketch.

    Paul

  18. #18
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Quote Originally Posted by mjs513 View Post
    Ok to me doesn't sound good. If you are only getting 1.0v on the 3.3v-Gnd you may have burnt out your T4. Only thing I can suggest at this point is to retouch your solder joints on the T4. You may have a flaky solder connection on Vin and Gnd pins.

    There were some troubleshooting guidelines that I saw but can't seem to find now.
    Ah man that sucks.
    Resoldered the Vin Usb pad back and usb is now working as before. With usb power only all pins read correctly (5v is 5.19 and 3.3v is 3.30)
    Now here is the weirder bit, testing with external power to Vin only (no usb connected) now reads 2.7v on both the 5v and the 3.3v pins.

  19. #19
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Quote Originally Posted by PaulS View Post
    Perhaps the red and yellow wire in your setup are flaky? I have had problems once or twice with such wires...

    When the 5V and 3V3 are present, but still no blinking, you can do a factory reset of a Teensy 4: power it up and then press & hold the program pushbutton for around 20 secs [until you see a little red LED next to the USB connector flash]. You then release the pushbutton and the Teensy will do it's factory reset cycle. That takes also around 20 secs with the red LED turned on bright. After that, the red LED will turn off and the orange LED should start flashing like in the Blink sketch.

    Paul
    Tested with multiple cables to rule that out, same result. Did a factory reset just to make sure I hadn't screwed something, nothing still

  20. #20
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,958
    Ok so now that it’s working usb connected we the t4 is good. Going to assume your new readings are only the external power applied. What is your external peer source and what voltage reading are you getting from just the external power source. Also did you resolver/touch up the vin and Gand pins?

  21. #21
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Is your external power source perhaps acting up? What exactly is your external power source? And can you try another 5V supply?

    Paul

  22. #22
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Quote Originally Posted by PaulS View Post
    Is your external power source perhaps acting up? What exactly is your external power source? And can you try another 5V supply?

    Paul
    The power source is AE modular, a modular synth that has 5v/ground connections for external devices. I have tested this same source with other things and they power correctly.
    Unfortunately I dont have any other power sources handy atm.

  23. #23
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Hmm, I'm out of ideas now. I would have a close look at the PCB again with a magnifying glass and check whether there are very tiny solderballs laying around that short pads/pins/parts.
    Is your soldering iron hot enough? From the photo, the solder didn't flow well around the pins.

    Paul
    Last edited by PaulS; 02-01-2021 at 06:56 PM.

  24. #24
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,958
    I agree with @PaulS on the soldering of the vin and ground pins on the headers as I mentioned before. Only other thing is to measure the 5v / Gnd fro the power supply.

  25. #25
    Junior Member
    Join Date
    Jan 2021
    Posts
    11
    Quote Originally Posted by PaulS View Post
    Hmm, I'm out of ideas now. I would have a close look at the PCB again with a magnifying glass and check whether there are very tiny solderballs laying around that short pads/pins/parts.
    Is your soldering iron hot enough? From the photo, the solder didn't flow well around the pins.

    Paul
    I will desolder and solder back all the ugly bits today and retest to see if that fixes it.
    QQ, do I need to desolder the Vin - Vusb pads that I soldered after cutting them or can external power (with no usb plugged in) be used without doing that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •