Live in ARGYNIX Cloud
A DHT22 sends to your Connect dashboards; Connect switches the LED.

The code
// This board, live in ARGYNIX Cloud. Link it (Live in Cloud, top right) to a device
// from Connect, press Run, and its readings reach that device's dashboards. A switch
// in Connect sending "setLed" turns the LED on pin 13 on and off.
#include <DHT.h>
#include <ArgynixCloud.h>
DHT dht(2, DHT22);
ArgynixCloud cloud;
const int LED = 13;
unsigned long last = 0;
void onCommand(const char *method, const char *params) {
if (strcmp(method, "setLed") == 0) {
bool on = strcmp(params, "true") == 0 || strcmp(params, "1") == 0;
digitalWrite(LED, on ? HIGH : LOW);
cloud.add("led", on);
cloud.publish();
Serial.println(on ? "LED on, from the cloud" : "LED off, from the cloud");
}
}
void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
dht.begin();
cloud.onCommand(onCommand);
Serial.println("Sending a reading every 5 s");
}
void loop() {
cloud.loop();
if (last == 0 || millis() - last >= 5000) {
last = millis() | 1;
float t = dht.readTemperature();
float h = dht.readHumidity();
if (!isnan(t) && !isnan(h)) {
cloud.add("temperature", t, 1);
cloud.add("humidity", h, 1);
cloud.publish();
Serial.print("Sent ");
Serial.print(t, 1);
Serial.print(" C, ");
Serial.print(h, 0);
Serial.println(" %");
}
}
}
More like this

BLE thermometer (ESP32)
A BLE server: the DHT22’s temperature as a characteristic the phone reads and follows, and a second one it writes "on" or "off" to for the LED.
ArduinoESP32 DevKit V1

Weather station
A DHT22 read every 2 s, shown on an I2C LCD and the serial port.
ArduinoArduino Uno

Distance (HC-SR04)
An ultrasonic echo timed with pulseIn(). Set the distance in the inspector.
ArduinoArduino Uno