Raspberry PI Zero W

Initial SD card setup:

Initial server setup:

Arduino

Arduino Nano pinout Arduino RF-Nano pinout ESP32 WeMos D1 mini NodeMCU V3 pinout NodeMCU V1 / V2 / V3 pinout ESP8266 models Wemos D1 mini versions

:INFO: When selecting ATmega328 vs ESP8266 based solution, consider that ATmega328 would need 5V sensors, but ESP8266 would need 3-to-5V step-up when controlling LEDs.

:INFO: ESP8266 has D3 / GPIO0 and D4 / GPIO2 10k pull-up + D8 / GPIO15 10k pull-down resistors, see LOLIN D1 mini description.

Name Price CPU CPU clock Flash SRAM Networking Power Interface PWM DAC
Arduino Nano v3.0 €3.60 + €0.92 = €4.52 ATmega328P 16Mhz 32KB 2KB :NO: shield costs €2.51 + €0.67 = €3.18 5..12V MiniUSB :YES: :YES:
LoLin NodeMCU V3 €1.89 + €0.88 = €2.77 ESP8266 80MHz 4MB 64KB :YES: built-in 2.4GHz WiFi 802.11 b/g/n 3.3..12V (e.g. 3.7V LiIon) MicroUSB :YES: :NO:
Wemos D1 mini V1 €1.76 + €0.66 = €2.42 ESP8266 80MHz 4MB 64KB :YES: built-in 2.4GHz WiFi 802.11 b/g/n 3.3..12V (e.g. 3.7V LiIon) MicroUSB :YES: :NO:
Wemos D1 mini Pro V1.1 €2.67 + €0.65 = €3.32 ESP8266 80MHz 16MB 128KB :YES: built-in 2.4GHz WiFi 802.11 b/g/n 3.3..12V (e.g. 3.7V LiIon) MicroUSB :YES: :NO:

Check:

Arduino clones need FTDI CH430 drivers from here (CH341SER.ZIP).

ESP

LED strips

Connecting LED strip to Arduino (5V data) Cheating At 5V WS2812 Control To Use 3.3V Data SK6812 VS WS2812B

Smart meter

Logical inverter based on BS170 Logical inverter based on BS170 with additional resistor

Challenges:

Network:

Ethernet Shield ENC28J60 pinout

Power saving:

Sensors

Vibration

Curtain

Temperature

The BME280 has more precise measurements but has its own problems too, as it suffers from self-heating in its default configuration (sampling data continuously). The library should switch the sensor into forced mode to make it sleep when the measurement is finished, see this comment and this post.

Infrared thermograph / temperature sensor

Market price: AMG8833 infrared thermal sensor – $51.83 (€47.90) DYI:

Climate control / CO₂

Oximeter / pulsometer

Door bell

Measuring current:

Logical converter

Bi-Directional Logic Level Converter Hookup Guide 5V to 3.3V logic level converter Building a 3.3V to 5V level converter with a MOSFET

USB-UART converter

Front PCB Schematic

CH340E:

CH340 supports 5V and 3.3V operation. When using 5V operation, supply 5V to VCC pin, and decouple the internal 3.3V reference with a capacitor of 4.7-20nF from V3 pin to ground. When using 3.3V operation, tie V3 pin to VCC pin and supply 3.3V power.

Controlling the power

Using relay

See also:

Using MOSFET e.g. IRLB3034PbF

See also:

Using Solid State Relays (SSR)

G3MB-202P 5V SSR relay, 1 channel, 240VAC 2A – €1.55+€0.84=€2.59 ($3.08) HFE60-5-1HDST-L2 5V latching relay, 2 channel, 2 coils – $10+$8 HFE60P-5-1HDST-L2 5V latching relay, 2 channel, 2 coils HFD2-003-M-L2-D 3V latching relay, 2 channel, 2 coils, 220V 3A – €1.75 ($2.08)

See also:

Using dedicated controller + MOSFET

Dimmer

Other automations

FAQ

Arduino Nano uploading gives error: avrdude: stk500_recv(): programmer is not responding

In Arduino UI choose Tools → Processor → ATmega328P (Old Bootloader).

Arduino Nano build-in LED conflicts with Ethernet shield

This is because the LED is on pin 13 and pin 13 is the clock pin for SPI device like Ethernet shield.

Alternative way to flash Wemos D1

Flash ESP-01 with your NodeMCU

With NodeMCU:

Connect the following pins between NodeMCU and Wemos D1:

  • RX → RX
  • TX → TX
  • D3 → D3
  • RST → RST
  • 3.3V → 3.3V
  • GND → GND
  • EN → GND

With USB-TTL converter:

  • RX → TX
  • TX → RX
  • 3.3V → 3.3V
  • GND → GND
  • D3 → GND (GPIO0 should be grounded when ESP is starting)

NodeMCU v3 (LoLin) built-in LED features

:WARN: LEDs operate in “inverted” mode, with regard to the pin levels – when the pin is LOW, the LED is on.

:WARN: Runnning pinMode(1, OUTPUT); breaks serial communication (when doing Serial.println("..."); nothing is printed) because pin 1 and 3 are reserved for TX/RX.

:WARN: Builtin LED on NodeMCU v3 (LoLin) is on D4 (pin 2) i.e. use pinMode(2, OUTPUT);