Teensy 3.2 refuses to run on external power

Status
Not open for further replies.

bf109k4

New member
Hi,

I am using a Teensy 3.2 board to integrate an nRF24L01+ wireless transmitter. The program I have written seems to be working fine, but only when the Teensy is plugged into the computer via the USB cable. When I finished programming it, I unplug the USB cable and attempt to power the Teensy from a 5V power supply. I simply connect Vin to the positive side and GND to the ground side. But the board does not power up and does not run the program. I have an LED attached to one of the digital pins, that will blink whenever the transmitter is transmitting. On external power, the LED never lights up.

The nRF24L01+ module has its own power supply of a series 3V battery pack. I am not powering it from the Teensy's 3.3V output. I am using a 3.3V voltage regulator with the input being the 5V from the power supply. And I just pull another line from the supply bus on the breadboard for the Teensy's external 5V input.

Here is my code, is there something in the software that is causing the Teensy board to behave like this? It seems like the Teensy is remains turned off whenever I unplug the USB cable and try to power it externally.

Thank you!

Code:
//on Teensy 3.2
#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>

#define CE_PIN 9
#define CS_PIN 10
#define ledPin 8
//mosiPin = 11; misoPin = 12; sckPin = 13 or 14;

int num = 0;

RF24 myRadio(CE_PIN, CS_PIN);
const uint64_t address = 0xF0F0F0F0E2LL;

void setup(){
  SPI.begin();
  SPI.setSCK(14);   //set the SCK pin to digital pin 14
  SPI.setClockDivider(SPI_CLOCK_DIV64);
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
  myRadio.begin();
  myRadio.openWritingPipe(address);      //write for transmitter
  myRadio.setChannel(101);     //channel must be the same as the receiver
  myRadio.setPALevel(RF24_PA_MAX);
  myRadio.setDataRate(RF24_250KBPS);
  myRadio.powerUp();
  myRadio.stopListening();      //transmitter doesn't need to listen
}

void loop(){
  while(myRadio.available()){
    myRadio.write(&num, sizeof(num));
    Serial.print("Writing: ");
    Serial.println(num);
    digitalWrite(ledPin, HIGH);
    delay(500);
    digitalWrite(ledPin, LOW);
    delay(500);
    num++;
  }
}
 
Can you attach a photo of your setup. your narrative says you power nRF from batteries but also says you are using a 3.3V regulator?

when teensy is powered from 5v power supply (no USB cable), what is voltage on Teensy 3v3 pin? Do you have all the grounds attached to each other? What are specs on your 5v supply?

Can you run a simple blink program on the Teensy when powered from your 5v supply?
 
Maybe try adding a delay before myRadio.begin();

Sometimes Teensy boots up too quickly. The problem was much worse before the 400 ms (soon to become only 350 ms) startup delay was added. Still, if your radio module takes half a second or longer to become ready, maybe your program is not working only because the radio isn't getting initialized?
 
Did you ever get this resolved? I am having similar problems when trying to power an nRF24 from an external supply.
 
Status
Not open for further replies.
Back
Top