Iot Cloud with Arduino Uno R3 - Wifi Module?

I'm looking for help with connecting my Arduino Uno R3 to the IoT cloud. I'm collecting temperature data that I wish to send to the cloud. Can anyone tell me if I need a wifi module connected to the Uno board and if so can someone recommend me one and perhaps give me guidance on the code and how to set it up? I'm completely new to arduino and coding and so far have managed to cobble together my project using bits of code I've found in other projects online.

#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>

const int SENSOR_PIN = 13; // Arduino pin connected to DS18B20 sensor's DQ pin

OneWire oneWire(SENSOR_PIN);         // setup a oneWire instance
DallasTemperature tempSensor(&oneWire); // pass oneWire to DallasTemperature library
LiquidCrystal_I2C lcd(0x3F, 16, 2);  // I2C address 0x3F (from DIYables LCD), 16 column and 2 rows

float tempCelsius;    // temperature in Celsius
float tempFahrenheit; // temperature in Fahrenheit

void setup()
{
  Serial.begin(9600); // initialize serial
  tempSensor.begin();    // initialize the sensor

  lcd.init();         // initialize the lcd
  lcd.backlight();    // open the backlight 
}

void loop()
{
  tempSensor.requestTemperatures();             // send the command to get temperatures
  tempCelsius = tempSensor.getTempCByIndex(0);  // read temperature in Celsius
  
  Serial.print(tempCelsius);    // print the temperature in Celsius
  Serial.println("°C");

  lcd.clear();
  lcd.setCursor(0, 0);       // start to print at the first row
  lcd.print("CONCRETE TEMP:");  // print concrete temp wording
  lcd.setCursor(0, 1);       // start to print at the second row
  lcd.print(tempCelsius);    // print the temperature in Celsius
  lcd.print((char)223);      // print ° character
  lcd.print("C");

  delay(1000); // read temperature once every 15 minutes which is 900000 ms
}

Since the Arduino Uno doesn't have WiFi or ethernet you can either add a ethernet hat or a wifi module to it. Since cost-wise it's not going to make any sense, it would be easier to use a board with networking built in such as ESP32 dev boards or similar.

Thanks. I'm thinking of just buying the Arduino Uno R4 Wifi. I'm guessing this will do the trick? If you have any experience connecting SD card's to Ardunio Uno also I'd love some advice on getting that setup. I ideally want to transfer data over wifi and store on an SD card as the power in my workplace often trips out so I don't want to lose data if I lose wifi connection.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.