Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 17 of 17

Thread: Teensy 3.2 Pin output voltage <1V, Broken?

  1. #1
    Junior Member
    Join Date
    Dec 2017
    Posts
    8

    Teensy 3.2 Pin output voltage <1V, Broken?

    Hey everyone,
    i just recieved my teensy 3.2 to drive my 15m WS2811 12V (testing with 5meters) but after i upload the sketch, nothing happens.
    after i measured the pins output voltage, i saw its only 0.8-0.9V max.
    Shouldn't it be 3.3v on the data lines, since my esp8266 and arduino nano are both giving 3.3 on the pins.

    Im currently using FastLED, but i get the same result with octoWS2811.
    The current sketch is working on both the esp8266 and the arduino nano.
    i will add my sketch to this post down below.

    When i apply power to the led strip after the teensy started up, all leds are randomly colored.

    The strip is powered by a 12v dc psu, the teensy by a powerbank, shared ground. (if everything is working, ill power the teensy from the 12v psu with a step down)
    I also got a 100ohm resistor between the teensy pin and the din of the strip to reduce noise.

    If you need any more info, i surely will supply them asap.

    regards

    Code:
    #include "FastLED.h"
    
    FASTLED_USING_NAMESPACE
    
    // FastLED "100-lines-of-code" demo reel, showing just a few 
    // of the kinds of animation patterns you can quickly and easily 
    // compose using FastLED.  
    //
    // This example also shows one easy way to define multiple 
    // animations patterns and have them automatically rotate.
    //
    // -Mark Kriegsman, December 2014
    
    #if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
    #warning "Requires FastLED 3.1 or later; check github for latest code."
    #endif
    
    #define DATA_PIN    3
    //#define CLK_PIN   4
    #define LED_TYPE    WS2811
    #define COLOR_ORDER GRB
    #define NUM_LEDS    100
    CRGB leds[NUM_LEDS];
    
    #define BRIGHTNESS          96
    #define FRAMES_PER_SECOND  120
    
    void setup() {
      delay(3000); // 3 second delay for recovery
      
      // tell FastLED about the LED strip configuration
      FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
      //FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
    
      // set master brightness control
      FastLED.setBrightness(BRIGHTNESS);
    }
    
    
    // List of patterns to cycle through.  Each is defined as a separate function below.
    typedef void (*SimplePatternList[])();
    SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, bpm };
    
    uint8_t gCurrentPatternNumber = 0; // Index number of which pattern is current
    uint8_t gHue = 0; // rotating "base color" used by many of the patterns
      
    void loop()
    {
      // Call the current pattern function once, updating the 'leds' array
      gPatterns[gCurrentPatternNumber]();
    
      // send the 'leds' array out to the actual LED strip
      FastLED.show();  
      // insert a delay to keep the framerate modest
      FastLED.delay(1000/FRAMES_PER_SECOND); 
    
      // do some periodic updates
      EVERY_N_MILLISECONDS( 20 ) { gHue++; } // slowly cycle the "base color" through the rainbow
      EVERY_N_SECONDS( 10 ) { nextPattern(); } // change patterns periodically
    }
    
    #define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
    
    void nextPattern()
    {
      // add one to the current pattern number, and wrap around at the end
      gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);
    }
    
    void rainbow() 
    {
      // FastLED's built-in rainbow generator
      fill_rainbow( leds, NUM_LEDS, gHue, 7);
    }
    
    void rainbowWithGlitter() 
    {
      // built-in FastLED rainbow, plus some random sparkly glitter
      rainbow();
      addGlitter(80);
    }
    
    void addGlitter( fract8 chanceOfGlitter) 
    {
      if( random8() < chanceOfGlitter) {
        leds[ random16(NUM_LEDS) ] += CRGB::White;
      }
    }
    
    void confetti() 
    {
      // random colored speckles that blink in and fade smoothly
      fadeToBlackBy( leds, NUM_LEDS, 10);
      int pos = random16(NUM_LEDS);
      leds[pos] += CHSV( gHue + random8(64), 200, 255);
    }
    
    void sinelon()
    {
      // a colored dot sweeping back and forth, with fading trails
      fadeToBlackBy( leds, NUM_LEDS, 20);
      int pos = beatsin16( 13, 0, NUM_LEDS-1 );
      leds[pos] += CHSV( gHue, 255, 192);
    }
    
    void bpm()
    {
      // colored stripes pulsing at a defined Beats-Per-Minute (BPM)
      uint8_t BeatsPerMinute = 62;
      CRGBPalette16 palette = PartyColors_p;
      uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);
      for( int i = 0; i < NUM_LEDS; i++) { //9948
        leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));
      }
    }
    
    void juggle() {
      // eight colored dots, weaving in and out of sync with each other
      fadeToBlackBy( leds, NUM_LEDS, 20);
      byte dothue = 0;
      for( int i = 0; i < 8; i++) {
        leds[beatsin16( i+7, 0, NUM_LEDS-1 )] |= CHSV(dothue, 200, 255);
        dothue += 32;
      }
    }
    Last edited by xcruell; 12-26-2017 at 06:44 AM.

  2. #2
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,048
    i dont see you setting pinMode the pin to OUTPUT, by default the pin is DISABLED.

  3. #3
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    I already tried that before, without success.

    Why is it working with the esp and arduino, if its disabled by default?

    regards

  4. #4
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,048
    how do you expect to test the output pin with a voltage meter without it being an output? do you expect 400/800khz to register? lol

  5. #5
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,048
    you also need latest fastled from github

  6. #6
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    Well as i said, even after setting it to an output with "pinMode(3, OUTPUT);" doesnt make a change.

    regards

    edit: i got the latest fastled library from github, 3.1.6

  7. #7
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,048
    pinMode(3,OUTPUT) and digitalWrite(3,1) doesnt work? teensy problem.
    otherwise, update your fastled library which recently added teensy updates

  8. #8
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    yeah both dont work.
    Thats odd, because i need an ic to drive my ws2811. my arduino nano, pro mini, esp8266 and 32 are too weak for this job.

    thanks anyway.
    regards

  9. #9
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,048
    if the first wont work thats a priority
    is it well soldered? you should get 3.3v after you set output and digitalwrite high

  10. #10
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    Yes it is. pretty similar to my esps.
    interesting thing is, i get the same voltage on all pins i choose in the sketch.
    3V and Vout both supply 3.3v.

    regards

  11. #11
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,633
    Quote Originally Posted by xcruell View Post
    the teensy by a powerbank
    T3.2 on powerbank?
    there are only a few powerbanks that do not shutdown with the little current T3.2 draws.

    can you simply try to download blink example and see if that is working? (with/without other HW), (with/without powerbank (i.e. from computer))

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,022
    Quote Originally Posted by xcruell View Post
    yeah both dont work.
    Thats odd, because i need an ic to drive my ws2811.
    Any chance you simply connected this IC incorrectly? Maybe show us some photos and we might be able to help?

    Have you tried running the LED blink example set to pin 3, and then measure the DC voltage directly at pin 3 (not the output of your chip, but right at the Teensy pin)?

    Or maybe first just upload the LED blink with the default pin 13, and observe whether the LED really blinks? That can at least check if your Teensy is still working.

    When working with 12V LED strips, extreme caution is needed. If any 12V wire touches Teensy for even a brief moment, it will almost certainly destroy your Teensy. You can also damage your PC if plugged into the USB port, so please be extremely careful with those 12V wires!

  13. #13
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,048
    youll know if you burnt it with a 12v signal, when you plug it in the chip will get very hot after a few secs

  14. #14
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    @PaulStoffregen
    Thanks for your answer.
    I uploaded the LED blink sketch and get 3.3v pulses, how it should work.

    I know 12v will insta kill 3-5v ics. I burned one of my arduino nanos once. I can use that one as a hand heater now

    So since the blink sketch works fine, the teensy is fine too.

    i attached 3 pictures.
    Is it normal that i get 2.2v from the data line of the strip?

    regards
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	IMG_20171226_203109.jpg 
Views:	23 
Size:	145.3 KB 
ID:	12391   Click image for larger version. 

Name:	IMG_20171226_203029.jpg 
Views:	19 
Size:	128.7 KB 
ID:	12390  

    Click image for larger version. 

Name:	IMG_20171226_203403.jpg 
Views:	18 
Size:	135.9 KB 
ID:	12392  
    Last edited by xcruell; 12-26-2017 at 06:38 PM.

  15. #15
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    i swapped the teensy out for a arduino nano, i didnt know the nano was capable of driving 15m ws2811
    Last edited by xcruell; 12-27-2017 at 11:00 AM.

  16. #16
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,022
    Quote Originally Posted by xcruell View Post
    Is it normal that i get 2.2v from the data line of the strip?
    If the program is continuously transmitting to the LEDs, then any voltage from 0.66 to 2.64 volts would be valid. Zero bits are a narrow pulse of approx 20% duty cycle, which would measure 3.3V * 0.20 = 0.66 volts, if repeating throughout the entire measurement time of your voltmeter. One bits are wider pulses, between 50% to 80% duty cycle. So if all 1s are being transmitted, you could expect a voltmeter to read between 1.65V to 2.64V.

    Of course, if the program is transmitting bursts of data, which is pretty common if the code is written to update the LEDs at a particular frame rate like 30 or 50 or 60 Hz, then you'd expect to see lower numbers. If the bursts don't exactly align with the timing of your multimeter's measurement periods, you could also expect to see the number fluctuate quite a bit, as the meter sometimes measures more of the bursts and other times measures more of the gaps between them.

    Most programs don't just send the exact same data over and over to the LEDs, because that's boring and useless. The LEDs retain the last setting, so there's no reason a program would send the same data repetitively unless it's specifically been designed for signal testing. Real programs do animations which change the colors rapidly. You can expect those sorts of programs to have a good mix of 0 and 1 pulses. Voltages between 0.66 and 2.64 would be "normal" when running normal LED animations. The specific voltage you should see depends on the mixtures of 0 and 1 pulses, and whether the program is waiting between transmissions.

  17. #17
    Junior Member
    Join Date
    Dec 2017
    Posts
    8
    Thanks for the good explanation.
    But the thing is that i get the ~2.2v directly from the strip, without any ic connected
    Just power and ground from the psu, measured the data line and ground.

Posting Permissions

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