I want to create a virtual keyboard by interfacing a Raspberry Pi with an Arduino and an ultrasonic sensor. The goal is to create a new architecture for computers that will be a whole system. The problem with Pis right now is you need a rather large keyboard to work them, this will make the system not only portable but get around that requirement. The keyboard will interface directly with a Rasparian desktop.
I needed something that would run the keyboard.h library and I stumbled on to the Xiao. It's under $5 and about the size of your thumb.
Ultrasonic Distance Sensor - HC-SR04
Micro USB (Male) to USB 2.0 (Female) Adapter, On-The-Go (OTG) Convertor Cable
I ran into a bit of a wall with the Arduino Uno. It turns out as much as it is easy to interface with the Pi Zero W it has the wrong chipset and won't allow me to run the Keyboard.h or Mouse.h libraries. A few nights ago I stumbled on to the Seeeduino Xiao which might have just made the project better. It is ultra small, inexpensive and comes equipped with the chipset I need. I will find out more when it comes in the mail.
A typical Arduino IDE has a serial monitor but the CLI doesn't have that option. After doing some digging I found I was able to mimic the monitor by way of a cat command. I hooked up the ultrasonic sensor and ran:
stty -F /dev/ttyUSB* 1000000 raw -clocal -echo
This allowed me to see in real-time what was going on with the sensor proving that they had interfaced properly. My next step is overlapping a keyboard with the sensor.
I am farther along in this project than I expected. Last night I interfaced my Pi Zero W to my Arduino Uno via the adapter and cable with no power supply problems. The board itself reads correctly on the Raspbarian desktop due to the installation of the Arduino CLI. There's no Arduino IDE available on the Pi Zero W but the CLI does the job.