Hello, this is my first post - please let me know if I've made any mistake in how I'm posting.
I am trying to figure out which path I should research in order to achieve basic wireless communication between two Arduinos (radio, Bluetooth, WiFi, other?). I teach a high school engineering course, and my students are always interested in wireless communication, but my background is not electrical engineering or programming.
Ideally I would be able to use a sensor (e.g., potentiometer) connected to one Arduino and send that input data to another Arduino to control the speed of a motor. Range should not be a major concern. From initial searches, it seems like there are many ways to achieve this. But I would appreciate any recommendations for the easiest/best way to make this work (they all sound a little complicated to me at the moment), preferably with the simplest wiring and programming solution, while not having a huge lag in data transmission.
Mostly I just don't want to spend hours researching Bluetooth, only to find out later that using radio would have been the better option (or vice versa).
Infrared e.g. like a TV remote control could also be one possible candidate.
Will the communication always be just one way?
Personally I would go with Bluetooth.
It will work for a simple sensor setup between two Arduinos, and it has extensibility, meaning you can extend the same hardware to do a lot of cool things with your students like controlling things from a Mobile Device.
Please explain what you believe WiFi and Bluetooth are. Clearly you think they are not radio.
WiFi implementation might look like utilizing ArduinoCloud, Bluetooth might be using HC-05 modules, and radio could be the nRF24L01module or a 433MHz transmitter receiver.
Yes, it only needs to be one-way communication.
One option is to get a couple of ESP32-WROOM-32 boards connected to each other over their own wifi. It keeps the wifi off the school's system which likely has strict rules regarding access from anything not put in by the school itself (for good reason).
I used the following link to get three of these ESP32 boards connected to allow two remote ones to use RFID keys whose IDs can be read in Serial, to send that serial data to a third, connected to my PC, to receive that data and use it for a kind of action figure rolodex (GI Joe file cards from the 80s, actually). The PC was running an app in Processing 4 (works great to create custom GUIs and such using Serial with Arduino - in fact, Arduino was modeled after Processing to be for hardware, what Processing is for quick and easy graphic design).
The catch is, ESP32s are not nearly as friendly to work with as the typical Arduino Uno R3.
I have definitely considered buying a couple HC-05 (or -06?) modules and playing around with them. The programming seems a little more challenging from the examples I’ve seen so far online, but I’m willing to spend the time learning this if I know it can work.
That would be my suggestion too. No extra hardware or libraries needed to get ESP-NOW working and there are examples installed with the board files
I would second the use of ESP32 microcontrollers
the original ESP32 has onboard WiFi, Bluetooth Classic and BLE plus plenty of flash/SRAM (for a microcontroller) and IO functionality
a dev module is typically about £7 on EBAY in the UK
it is supported by the Arduino IDE
for a start try ESP-NOW as suggested by @hallowed31 and @UKHeliBob or use a local WiFi network if available
for long distance communication have a look at LoRa
there are modules with an ESP32 and LoRa onboard, e.g. Heltec LoRa32 V3
If you choose to send data between boards using Serial, I highly recommend spending some time with the great tutorial on this very forum regarding how to do that reliably.
Serial from one board to another was something that I really struggled with (is it Serial.print(someData); or Serial.println("someText"); or Serial.write(someNumbers);??? Am I supposed to subtract 32 or 48 from the result? Is it byte, char or int???
@Robin2 has you covered:
More challenging that what?
I think HC-05s will be the simplest solution and there are hundreds of tutorials available
Which Arduino boards do you have ?
a legal issue that gets overlooked: HC12 modules are not legal in the US. you will not be raided by jack booted minions of the law, but it can be a problem if you have FCC licenses. WiFi , Bluetooth and LoRa are good choices. I use LoRa because even living way out in the ginglyweeds all my neighbors use multiple 2.5 ghz channels. the 33cm US LoRa band is a ghost town.
Thanks for that info. I didn't know that. I'll try to remember not to recommend them to forum members in the US in future.
So I guess none of the radio modules that use 433MHz band are legal in US?
Or WiFi or Bluetooth. That's my point. They are radio too. WiFi and Bluetooth don't work by magic, they work by radio.
Get either an ESP8266 board like the Wemos d1 or NodeMCU or an ESP32 Module and use TCP/IP based WiFi.
The ESP32 even comes with Bluetooth.
I don’t think so, at least not for general license free use, they are supposed to use 915Mhz ?
However, I think it is widely used in the US …………….
That's in the 70cm amateur band so a simple to get Technician class license would solve that problem.
A class set of Arduino Unos (some R3s and some R4s), as well as a few Arduino Nanos (purchased last year, but not sure of the exact model).