Make Teensy a 2.4 GHz Receiver

Status
Not open for further replies.

nameless

Well-known member
Hello,

I'm currently working on the following "problem": If I have this USB Presenter to remotely control my computer at the moment of a presentation, do you think it is possible to build a selfmade receiver for that presenter with the help of a Teensy? I thought about using a NRF24L01 Module for that, as the Presenter communicates at 2.4 GHz. The only thing I'm uncertain about (because I'm not yet very familiar with SPI, etc.), is the programming then.. So how can I figure out, what exact signals are sent by the presenter and how can I then "catch them" and send them to the computer with the Teensy?

Regards,
nameless
 
It's possible to reverse engineer that sort of thing, but 2.4ghz is not a lot to go on. You might get lucky and a NRF24 module will spit out bits from the thing but I wouldn't buy on with any serious expectation of success. There are a lot of ways to use a given frequency:
https://en.wikipedia.org/wiki/Category:Radio_modulation_modes

The process for doing this is using a software defined radio
things like http://www.rtl-sdr.com/tag/2-4-ghz/
(declaration, no idea if it works, was just first google hit)

Then pull apart the traffic, try to match it to a known traffic form and hope you can find a module that understands it. Which is by no means impossible but I'd call this a decent 3 month project working part time and putting in some serious book time on the topic.

If your ambition is just to 'make it work' you would be better buying something known for your sender (xbee, Teensy + NRF or:
http://www.ebay.com.au/sch/sis.html...larm+system+nurse+call&_trksid=p2047675.m4100
which (probably) will work with the RFswitch library
 
Hello,

I'm currently working on the following "problem": If I have this USB Presenter to remotely control my computer at the moment of a presentation, do you think it is possible to build a selfmade receiver for that presenter with the help of a Teensy? I thought about using a NRF24L01 Module for that, as the Presenter communicates at 2.4 GHz. The only thing I'm uncertain about (because I'm not yet very familiar with SPI, etc.), is the programming then.. So how can I figure out, what exact signals are sent by the presenter and how can I then "catch them" and send them to the computer with the Teensy?

Regards,
nameless
No, as it would be far too time consuming to reverse engineer the modulation modes, bit and frame coding, and so on. Unless something is published. And it would require special test equipment.
 
Rather than trying to interface with some unknown hardware, I would think about instead using one Teensy that emulates a USB keyboard send out the appropriate key sequences to move forward and backward in the presentation. It would have a radio receiver (nRF24L01+ perhaps or maybe bluetooth). A second teensy (or some other processor) would in the user's hands with the buttons and it would transmit the send sequence over the radio.

I recall that Adafruit had a simple keyfob transmitter and receiver that might be useful:

The product is 5v, so you would want to use a Teensy 3.2 with it, and not LC (or do level shifting on the input).
 
Rather than trying to interface with some unknown hardware, I would think about instead using one Teensy that emulates a USB keyboard send out the appropriate key sequences to move forward and backward in the presentation. It would have a radio receiver (nRF24L01+ perhaps or maybe bluetooth). A second teensy (or some other processor) would in the user's hands with the buttons and it would transmit the send sequence over the radio.

I recall that Adafruit had a simple keyfob transmitter and receiver that might be useful:

The product is 5v, so you would want to use a Teensy 3.2 with it, and not LC (or do level shifting on the input).


You mean like "hacking" the Presenter with a built in Teensy, so instead of the microcontroller in it, the button press is sent to my own Teensy, which sents it to the receiver I'm building?

If this is what you meant, what do I have to do, to use the Teensy with external power (from the battery of the presenter), so what do I have to change on the Teensy and where do I have to connect the battery (no USB needed then (after programming)).
 
Last edited:
You mean like "hacking" the Presenter with a built in Teensy, so instead of the microcontroller in it, the button press is sent to my own Teensy, which sents it to the receiver I'm building?

If this is what you meant, what do I have to do, to use the Teensy with external power (from the battery of the presenter), so what do I have to change on the Teensy and where do I have to connect the battery (no USB needed then (after programming)).

Actually, I meant creating your own presenter, instead of trying to adapt the external one. Using the Adafruit keyfobs above, you would just use two CR2016 batteries, and you would't have to run the Teensy on battery.

In terms of battery usage, there are many different ways to do it, depending on what form factor you want to use, how much battery power you want to use, etc. One such way that fits in a small space is to get Onehorse's lipo charger (https://www.tindie.com/products/onehorse/stbc08-high-current-lipo-battery-charger/) coupled with a small lipo battery (https://www.adafruit.com/products/2750). Or get the various cell phone charger batteries and connect one to the USB port.
 
You could always 'steal' the data lines between the radio transmitter chip and the input data. If you view it on an oscilloscope you may well be able to decode it and send it into your own radio transmitter.

Michael has the right idea though. You could make one with incredibly little effort if you use these plug and play USART radio links
 
You could always 'steal' the data lines between the radio transmitter chip and the input data. If you view it on an oscilloscope you may well be able to decode it and send it into your own radio transmitter.

Michael has the right idea though. You could make one with incredibly little effort if you use these plug and play USART radio links

So you think I could do my first idea (to get the original signals) as well? Because that actually would be a little better for me, even if it's associated with more effort and work...

@MichaelMeissner: If I'd do my own presenter or manipulate the original one, using external power, would there also be a way to use 2 normal AAA-Batteries with respectively 1,5V?
 
There are various boost regulators on the market that take a battery with smaller volts and boost it up to a given amount. Note, you do have to be careful as some of these can generate a lot of heat. Also note, non-rechargeable AA/AAA batteries may start off with 1.5v, but as the battery is discharged, the voltage goes down.

If you were willing to use AA batteries instead of AAA, you might consider:

If you wanted to roll your own, Pololu.com has a number of different step-up, step-down, or step-up/step-down converters. If you are going to 3.3v, you would hook the wires to ground and 3.3v on the Teensy. If you are going to 5v, you would hook the wires to ground and VIN on the Teensy. Also, you need to worry about not feeding multiple power sources to the Teensy (or protecting it via diodes, etc.) -- for a small hack project, you can just know not to combine multiple power sources at a time, but it is perhaps safer to take some time to design in some protections (note, I'm a software guy, not hardware, and I generally just use the one power source method -- be sure to get feedback from those more knowledgeable about hardware).
 
So with the Pololu 0,5-5.5v to 5v I could "boost" my 3V of 2 AAA batteries to 5V to run the teensy with it?
 
Sure, obviously you will have less milli-amps to play with after the conversion (both with Ohm's law, where voltage * amps is power, and with the boost converter losing some amount of energy in the translation). You will need to worry about heat produced by the conversion, as well as possibly draining the battery too much (if it is rechargeable), and whether the battery can realistically generate enough amps to be useful after the conversion.
 
From page 121 of the datasheet

battery.png
 
To get this thread awake again: Now I have soldered the NRF24L01 on my Teensy, but now I'm wondering how I can test it. There should be a possiblity, to receive every 2.4GHz Siganls in my environment, isn't it? So just to test the function of my NRF24L01... (I have no second Teensy/Arduino/...). But as I have my presenter, I could just send signals and see if they are received, or am I wrong?

What I have yet is:
Code:
#include <SPI.h>

void setup() {
  SPI.setSCK(14);
  SPI.begin(); 
}

void loop() {

}

I have SCK soldered to PIN14.. But what now? How can I display the results (what the NRF-Chip) receives on Serial Port?

Edit: I now found that, and tried it, but it doesn't seem to work, as I'm getting tons of error-messages. This is my source code now:
Code:
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>

#include <SPI.h>

typedef enum 
{ 
  module_unknown = 0, 
  module_nrf24 , 
} module_e;
 
// Instantiate Radio Modules
RF24    radio_rf24(RF_CE,RF_CSN);    /* NRF24L01 */
 
module_e module; // RF module used
 
uint8_t detectDevice() 
{
  module_e module = module_unknown;
  uint16_t status;
 
  radio_rf24.begin();
  
  radio_rf24.setRetries(0x0A, 0x05);
  
  if (  radio_rf24.getRetries()==0xA5 && radio_rf24.setDataRate(RF24_1MBPS) ) 
  {
    // We are sure, this is a NRF24
    module = module_nrf24; 
  }
  return module;
}
 
void setup()
{
   Serial.begin(9600);
  delay(1000);
  Serial.println("Nrf24L01 Receiver Starting");

  SPI.setSCK(14);
  SPI.begin(); 
 
  module = (module_e) detectDevice();

  if ( module == module_unknown )
    Serial.println("No module detected..");
   else
     Serial.print(module==module_nrf24?"NRF24L01":"RFM12B");
}


void loop() {
  // put your main code here, to run repeatedly:

}

That are the error messages:
Code:
Arduino: 1.6.5 (Windows 8.1), TD: 1.25, Board: "Teensy 3.2 / 3.1, Serial + Keyboard + Mouse + Joystick, 96 MHz optimized (overclock), German"

sketch_jan14a:14: error: 'RF_CE' was not declared in this scope
sketch_jan14a:14: error: 'RF_CSN' was not declared in this scope
sketch_jan14a.ino: In function 'uint8_t detectDevice()':
sketch_jan14a:27: error: 'class RF24' has no member named 'getRetries'
sketch_jan14a.ino:21:12: warning: unused variable 'status' [-Wunused-variable]
'class RF24' has no member named 'getRetries'

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

Can anybody help me figure out the problem?
 
Last edited:
I used
https://github.com/maniacbug/RF24
suggest looking at
https://github.com/maniacbug/RF24/blob/master/examples/pingpair_dyn/pingpair_dyn.pde
(ground pin 7 to make it a recover)
These use a 32 bit address, so it's not something you can just cycle through unless you want to push a button on the remote 2^32 times. Unsure if there is a mechanism to put the nRF into a 'unaddressed' mode so it reports all valid nRF traffic. Remember it's quite possible the pointer is using blue tooth or some other spec that nRFs will just ignore as well.

You could also look at the radio head library
http://www.airspayce.com/mikem/arduino/RadioHead/
But unsure if it offers any other methods to get more info out of the module as a snooper.
 
Thats the library I'm (trying to) using to. Trying to upload pingpair_dyn to my Teensy, I get a error "fvedopen" was not declared in this scope...
In terms of the receiver (or the pointer): It definetly uses 2.4GHz, I already figured it out, to be more precise: 2405.00000000 2474.00000000
Thats the exact range it uses...


What I'm wondering about:
Code:
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>

#include <SPI.h>
 
void setup()
{
  Serial.begin(9600);
  delay(1000);
  Serial.println("Nrf24L01 Receiver Starting");

  SPI.setSCK(14);
  SPI.begin(); 

  RF24 radio(17,18);
}


void loop() {
  // put your main code here, to run repeatedly:

}

Have a look at that code, should there be a output on serial monitor (except Nrf24L01 Receiver Starting)?
Isn't there something easy to test, if everything is right on Teensy?

In the picture assigned, you can see how I assigned my pins (except VCC - that goes to the 3.3V under where I connected GND to).Teensy_connection_to_nrf24l01.png
 
Try this ported library

I doubt you'll receive anything though. Remember the NRF24L01 is a digital microwave transmitter. I highly doubt it follows a non-proprietary communication protocol, and even if it did it's unlikely to be the same as your presenter.

Again opening the presenter and telling us what the radio control system is will confirm this.


EDIT:
Your pin connections look correct. I'm not sure I understand what you mean by
Isn't there something easy to test, if everything is right on Teensy?
though
 
Last edited:
Thanks for the library... What do you mean, why shouldn't I see receive anything? On that page you can see, that the receiver receives signals on the range I specified in my last post (2405 to 2474)...

What else could I detect when I open the presenter?
 
As per the modulation link at the top of the page, frequency is just one of many elements of a radio link. You and a dog are both communicating in the audio spectrum, but that doesn't mean you can understand each other, or even automatically notice that the other is communicating.

The chip inside MIGHT get you a data sheet saying what spec it uses. Codes and clever software may or may not further complicate things.
 
Try this ported library

I doubt you'll receive anything though. Remember the NRF24L01 is a digital microwave transmitter. I highly doubt it follows a non-proprietary communication protocol, and even if it did it's unlikely to be the same as your presenter.

Again opening the presenter and telling us what the radio control system is will confirm this.


EDIT:
Your pin connections look correct. I'm not sure I understand what you mean by though

What I meant with "something easy to test" is a simple function check, if the NRF24L01 is soldered correctly on the Teensy and if it's working at all (could have gotten a damaged one as well (even if it's unlikely))

@GremlinWrangler I see your point....Hopefully it works...

I'm at the moment opening the pointer so I can present you some pictures of it. Here are some pictures of the original receiver by the way, can you maybe use them too to figure something out?

IMG_20160114_124844.jpgIMG_20160114_124903_1.jpg
 
That IC in the third photo, is that NRF3151? Not getting any hits for a data sheet but that's probably the doing the RF in this. Couldn't read anything of the IC on the other RX end, unsure if it was a blank IC or just the angle?
 
Hi nameless.
I am seeing that you want to go on with this more to learn than to save money or time. I would like to encourage you since the nRF24L01 or similar is a good chip to learn about. Since I am using it for many years in several customer projects let me say one thing.
It uses 3 to 5 bytes for adresses, 2 modes for CRC, 2 modes for payload length, 3 baudrates and 80 channels. All this must match if you want to receive a packet.
There is a RSSI bit that may help you to find the channel. Not sure if it works with unrecognized packets. Chances are close to 0.
Using a Logic analizer (Saleae or clones) is the only realistic way I think.
Anyway. Go on with your own control routines or the library you received and use those incredibly cheap modules from Aliexpress. The day you will see your first reaction on a transmitted packet will be great. Good luck.
 
Last edited:
Okay, thanks for the information about the module itself..

How do I connect such a logic analizer on my teensy? (as the NRF24L01 and the Teensy is directly connected, so the wires are directly connected to the pins)

And how can I figure out the RSSI bit? How can I at least receive something on my chip?
 
Status
Not open for further replies.
Back
Top