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!
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++;
}
}