Input external signals through USB

You can use an usb connection with an Arduino. The smallest Arduino that can be used with SerialOTG is a ATTINY85.

See: Serial OTG. Arduino CH340. FTDI. rkl099's Extension