~$4 microcontroller from Espressif (Chinese vendor with unusually good English documentation). Dual-core Xtensa CPU, ~4 MB storage, megabyte-level RAM, on-board Wi-Fi and Bluetooth, SPI/I2C and other typical microcontroller interfaces. Development boards (some with screens and battery chargers) are widely available on eBay up to ~$10.