# NRF24 And DallasTemperature Wont work together

**URL:** <https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474>\
**Category:** Programming\
**Created:** [January 2, 2015, 12:56am UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474 "2015-01-02T00:56:42Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 12:56am UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/1 "2015-01-02T00:56:42Z")

</div>

I am trying to send Temperature (DS18B20) data VIA the NRF24 . the Radio and the Sensor work independent of each other, but as soon as the Sensor data is called the Transmitter stops. I Can run the code, See the data from the Probe on the receiver just for about 1 second and then it stops. Im wondering if its something on the Second time around on the loop. Like Address scan is changing the PinMode or maybe a interupt stop communication with the Radio and it cant recover. Ive used a few different librarys and sketchs , 1 that didnt even require the DallasTemperature.h , so im douting the problem is in there for me . I used Extrenal power for the 5v and 3.3 making sure it wasnt a power issue . Changed Pins just to make sure, No Change. No Error code eather. I cant find anyone else having this same kinda conflict so im guessing its something im over looking.  
How about maybe like use the Serial Monitor to debug the pins , Or would that be pointless/useless ?  
Anyway 🙂 Any Ideas 🙂 ?  
Update :  
Ive tried changing Boards from A Micro to a UNO , tried Different NRFs, and different Sensors Set the sensors Address so its not searching for it , But still just after it calls the Temperature it stops sending I think im running out of ideas

```cpp
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
 
DallasTemperature sensors(&oneWire);

#define CE_PIN  9
#define CSN_PIN 10
#define DATA_X A0
#define DATA_Y A1
#define DATA_Z A2

// NOTE: the "LL" at the end of the constant is "LongLong" type
const uint64_t pipe = 0xE8E8F0F0E1LL; // Define the transmit pipe

RF24 radio(CE_PIN, CSN_PIN); // Create a Radio
float DATA[3]; 

void setup()   
{
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(pipe);
  sensors.begin(); 
    Serial.println("Dallas Temperature IC Control Library Demo");

  
  
}

void loop()   
{
  
    Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");
  
  Serial.print("Temperature for the device 1 (index 0) is: ");
  Serial.println(sensors.getTempCByIndex(0)); 
  
  
  
  DATA[0] = analogRead(DATA_X);
  DATA[1] = sensors.getTempCByIndex(0);
  DATA[2] = analogRead(DATA_Z);
  
  radio.write( DATA, sizeof(DATA) );
Serial.print(DATA[1]);
}

```

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 5:00pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/2 "2015-01-02T17:00:15Z")

</div>

Was hoping some one had at least one idea 🙂

---

<div class="post-metadata">

**Author:** ![BulldogLowell](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@BulldogLowell](https://forum.arduino.cc/u/BulldogLowell)\
**Post date:** [January 2, 2015, 5:44pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/3 "2015-01-02T17:44:21Z")

</div>

How are you powering the radio?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 5:49pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/4 "2015-01-02T17:49:22Z")

</div>

At first was VIA the micro controller , but i wasnt sure if it was a power issue so i used a external power supply and those 8Pin Socket Adapter Board Plate for NRF24L01+ Wireless Transceiver​ Module just to make sure.  
When new code is sent to the transmitting unit it will show just for a few seconds the Data, but then the transmitter stop sending data ☹

---

<div class="post-metadata">

**Author:** ![BulldogLowell](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@BulldogLowell](https://forum.arduino.cc/u/BulldogLowell)\
**Post date:** [January 2, 2015, 7:42pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/5 "2015-01-02T19:42:42Z")

</div>

> woody\_unreal:  
> At first was VIA the micro controller , but i wasnt sure if it was a power issue so i used a external power supply and those 8Pin Socket Adapter Board Plate for NRF24L01+ Wireless Transceiver​ Module just to make sure.  
> When new code is sent to the transmitting unit it will show just for a few seconds the Data, but then the transmitter stop sending data ☹

Did you add a de-coupling capacitor across the power feed to the radio?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 7:50pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/6 "2015-01-02T19:50:50Z")

</div>

I didnt have to there is plenty of juice for the radios with External power supply Feed into those riser cards [Socket Adapter plate Board for 8Pin NRF24L01+ Wireless Transceive​ module 51 | eBay](http://www.ebay.com/itm/Socket-Adapter-plate-Board-for-8Pin-NRF24L01-Wireless-Transceive-module-51-/200960749614?pt=LH_DefaultDomain_0&hash=item2eca31b02e) they also have several Caps for that reason 🙂  
I can also use the sketch with out the Call to the probe and it continues to work 🙂 without interruption 🙂  
Its almost like the is a request in the onewire library that messes it up.. im just guess with process of elimination

---

<div class="post-metadata">

**Author:** ![BulldogLowell](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@BulldogLowell](https://forum.arduino.cc/u/BulldogLowell)\
**Post date:** [January 2, 2015, 7:55pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/7 "2015-01-02T19:55:34Z")

</div>

> woody\_unreal:  
> I didnt have to there is plenty of juice for the radios with External power supply Feed into those riser cards [Socket Adapter plate Board for 8Pin NRF24L01+ Wireless Transceive​ module 51 | eBay](http://www.ebay.com/itm/Socket-Adapter-plate-Board-for-8Pin-NRF24L01-Wireless-Transceive-module-51-/200960749614?pt=LH_DefaultDomain_0&hash=item2eca31b02e) they also have several Caps for that reason 🙂  
> I can also use the sketch with out the Call to the probe and it continues to work 🙂 without interruption 🙂  
> Its almost like the is a request in the onewire library that messes it up.. im just guess with process of elimination

I'd still add the cap.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 8:31pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/8 "2015-01-02T20:31:31Z")

</div>

You can plug the NRF24L01 into the national grid, it still will not work without a power decoupling capacitor. I have tried it.

For preference use a low ESR one.

---

<div class="post-metadata">

**Author:** ![Cosford](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@Cosford](https://forum.arduino.cc/u/Cosford)\
**Post date:** [January 2, 2015, 8:47pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/9 "2015-01-02T20:47:02Z")

</div>

I made the mistake of getting PCBs made up with a cap around 1.5cm away from the headers the nrf24l01 was being plugged into and that still wasn't adequate.  
Solder a cap directly onto the pins of the module, or you can and probably will run into issues because of it. It may not actually be the cause of the problem in this case, but I'd strongly recommend doing it.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 9:10pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/10 "2015-01-02T21:10:03Z")

</div>

I Did put a additional cap as ask 🙂 without change. If i pull the CE wire off the Radio it at least will transmit, of course its not sending actual data , So i thought maybe something is changing thats pin State , so i moved it , and changed code as well.. still no luck. Reading a rock solid 3.303v on a 4000count multimeter right at the radios pins. Maybe its just not possible to have DS18B20 on NRF24s  
they will work apart . just not together

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 10:24pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/11 "2015-01-02T22:24:28Z")

</div>

what do others use for temp sensors, and then transmit that data ?

---

<div class="post-metadata">

**Author:** ![BulldogLowell](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@BulldogLowell](https://forum.arduino.cc/u/BulldogLowell)\
**Post date:** [January 2, 2015, 10:45pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/12 "2015-01-02T22:45:51Z")

</div>

> woody\_unreal:  
> what do others use for temp sensors, and then transmit that data ?

You could try putting the temperature reads into a millis() timer and read just once every 30seconds or less often...

Your voltage at the pins is important, but not as important as the available power. Spend a few cents on a couple caps and rule that out. I wouldn't hound you if it didn't mean a lot on that particular device...

I have a 20 node RF network and they all needed it.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 10:49pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/13 "2015-01-02T22:49:38Z")

</div>

I posted earlier ,, already soldered one on it , without change

---

<div class="post-metadata">

**Author:** ![BulldogLowell](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@BulldogLowell](https://forum.arduino.cc/u/BulldogLowell)\
**Post date:** [January 2, 2015, 11:02pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/14 "2015-01-02T23:02:50Z")

</div>

> woody\_unreal:  
> I posted earlier ,, already soldered one on it , without change

Missed that, sorry. Make sure you do both transceivers.

Try reading the sensor less yet?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 2, 2015, 11:27pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/15 "2015-01-02T23:27:48Z")

</div>

DANG Finally Looks like that did it

```cpp
 unsigned long currentMillis = millis();

  if(currentMillis - previousMillis > interval) {
    
    previousMillis = currentMillis;   
    sensors.requestTemperatures();
    Serial.println(sensors.getTempCByIndex(0)); 
}

```

now i just need to pass the data across the radio ugg 🙂

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 20, 2015, 7:07pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/16 "2015-01-20T19:07:44Z")

</div>

Can you share the final cede?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 9:03pm UTC](https://forum.arduino.cc/t/nrf24-and-dallastemperature-wont-work-together/279474/17 "2021-05-05T21:03:07Z")

</div>


