A nodeMCU is the cheapest and the smallest IoT device which you can buy. It features a fast processor, ample I/O pins and a WiFi connection. It also has an inbuilt regulator so you are good to go with voltages upto 12v.
The device has an micro USB connector as well. This is helpful as one can directly connect it to the computer to program it.