Wireless Temperature Sensor

In continuing with my quest to automate my house, I want to have better temperature control of various rooms.  My goal is to create a few digital thermometers connected to the nRF24 radios that I have started working with.  I’m using an Adafruit Trinket microcontroller, a DHT11 temperature and humidity sensor, and an nRF24L01+ 2.4GHz radio.  I wired together a quick prototype pictured below.


The Trinket has 5 pins:

– D0: SPI Clock to nRF

– D1: SPI Data Write to nRF

– D2: SPI Data Read From nRF

– D3: SPI Chip Select Bar to nRF (CSN)

– D4: Chip Enable to nRF (CE) \ Data Wire to DHT11

Notice how I had to overlap the 5th Trinket pin.  The nRF was powered down in software in order to read from the DHT11.  I learned several important things about programming with the Trinket.  I’ll discuss that next time. 


10 thoughts on “Wireless Temperature Sensor

    • I have made a little more progress. I started a github repo for the nrf24 radios (https://github.com/jowood4/nrf24) and I designed a PCB that basically does what the wiring board I posted earlier does. I’m also looking at other temp sensors besides the DHT11 because I want resolution. The DHT11 gets about 1 deg C, but others do better than that.
      I’m planning to write another post tomorrow to describe this stuff in detail.

      • Hi Jowood4,
        Thank you very much for your library nrf24.
        I have tried to use it but unfortunatelly I did not succeed.
        Can you please share example code for sending and receiving?
        And what did you do with IRQ of the nRF? Connected to ground?
        Thanks for your help

      • I can post some examples. This library is meant to target Arduino, Raspberry Pi, and Trinket (a ATTiny85 breakout). I use preprocessor directives to specify which target, so that unnecessary code doesn’t overload the memory. What are you trying to target?
        I also tried to include the IRQ as an option for the library, so you can use it if you want, but you don’t have to. If you don’t use it, the micro constantly polls the status register to see if anything is received.

      • Nice. I want to use two Trinkets for sending and receiving.
        Thanks for some example code and for sharing your knowledge!
        Best regards thomas

  1. Hi, do you happen to have some sample code to look at? I’m new to all this and getting very frustrated with all the libs out there. Your project has elements that I’m looking for to use a Trinket to give me a call button for my mom in case she falls. I want her to carry a pendant with a Trinket and have a base station that will alert me if she calls for me. Any help would greatly be appreciated.

    • Yes, I could share some of my code. Are you using a nRF24 as well? My trinket code is pretty centered around that as a transceiver to send messages and commands.

    • Hey Joe, any chance I could see how you used your Radio commands and settings? I really don’t know how to implement them to get my Trinket radio working. I was able to get a Trinket Pro and Uno to work with other libs. But the Trinket would be much better for the pendant I want to make. Your libs look just right for what I’m trying to do.

      • Hi Joe!

        Finally a trinket project with wireless communication that really does what I want to achieve, well could multiple trinket/NRF24L01+ 2.4GHz communicate with a raspberry with NRF24L01+ 2.4GHz.

        Could you show more code and the wiring or the file of the pcb or ideally a electric shematic.

        And could it be possible to use a led as indicator when it checks just for the visual aspect of the sensor.

        I really hope you answer!! 😀

        Kindest Regards!!

      • Hello!
        Thanks for checking out my blog! I am planning to pick this back up and make some more sensors soon. When I do, I’ll certainly post so you can see. I ultimately want to make a mesh network of NRF24s that can share temp data and potentially other info as well.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s