3

I would like to have (10+) Arduinos read from their own temperature sensors - fine, I've done that.

Now, I would like to have the Arduinos (transmitter) send the temperature sensor data over RF to a SINGLE Raspberry Pi (receiver). I am very confused, would this work:

http://www.ebay.com/itm/1pcs-433Mhz-RF-transmitter-and-receiver-kit-for-Arduino-project-/261041100836?pt=LH_DefaultDomain_0&hash=item3cc7431824

Would I have to have all of the receivers (not what I want) or would all the transmitters work with just one receiver?

After getting the comms working, how can I get the Arduino to send a string over RF - is there a library for it? A library for Python (Raspberry Pi end) would be great too!

WillyWonka
  • 547
  • 1
  • 5
  • 13
developius
  • 288
  • 3
  • 17

2 Answers2

5

Don't buy those crap receivers and transmitter. At least pick one that has a crystal. The ones you linked to just provide the modulation of the signal. You'll have to implement a protocol yourself.

Better go with the NRF24L01. These chips do all the heavy lifting. The can both send and receive. Just push some data to the chip using SPI, and the chip will create a package and send it. The receiving chip listens for packages and converts the signal back into a your data. It also does error correction. You can even have it setup, so that if a packet is resend if the sender doesn't get an ACK from the receiver.

There are some nice libraries for these chips for arduino. At least one of them is ported to Raspberry; https://github.com/stanleyseow/RF24.

If you need more range, you can get these modules with an external antenna. Since they are on a higher frequency 2.4Ghz the range is in theory less than with 433Mhz.

I am using these modules to transmit power-meter data. Currently my arduino is reading the data. But the plan is to connect it to my Pi, and create some nice graphs on it. Since my power-meter sensor runs on batteries I had to mess around a bit to turn off the auto-retransmit feature.

PS. the internal temperature sensor on the atmega328 is not very accurate, and gets heated by the cpu itself. Just buy these cheap temperature and humidity sensors, while you are on eBay.

Gerben
  • 2,420
  • 16
  • 17
0

They look like they all run on the same frequency, so they should be able to run together. You would have to make sure, however, that you run it in some way that allows all of the transmitters to share the connection without drowning each other out. Synchronizing these would be difficult, so you may need to have each transmitter also have a receiver. It looks like they come together anyway, so I don't think you'd be wasting money.

I'm no expert, and I didn't look at how it works too closely, but it looks as if the TX/RX modules don't really concern themselves with sending data; they just make a "virtual wire" for extending connections. So what you need is a connection protocol that will allow for multiple sensors to civilly report their readings and synchronize themselves. Something like SPI or I2C would work, but they require multiple wires, so it's out.

The Arduino's serial connection uses one transmitter (TX) and one receiver (RX) line to establish two-way communication, which can (I think) use the transmitter and receiver part of your RF modules. This could be the way to go, but I don't know whether it's possible for multiple devices to use the same connection. If it's possible to just broadcast a "Calling Sensor 7" message and have only Sensor 7 respond, then this would work. However, I am guessing (and I don't know) that there is some sort of handshaking that has to go on to establish this connection, so having multiple devices all share the same connection might be hard, because they might all try to respond to any message sent. Your job, then, would be to learn more about the serial protocol (UART) and figure out whether multiple devices could listen and chime in. In the likely case that that's not possible, you would either have to find another existing protocol or roll your own. With the hardware, it should be possible.

One last thing: you'll almost certainly want to have an Arduino on the receiving end instead of a Pi. Pi's are usually terrible at timing-critical things like communications protocols, so it would be a lot easier for you to have one more Arduino to act as the master and receive all the data and then send it to the Pi over a USB connection.

This is as much as I can offer; I don't think I know enough to do it myself, but I wanted to point you in the right direction. Good luck.

PS—Look at this question, if you haven't already.

krs013
  • 366
  • 2
  • 8