Hello, and welcome to my first instructable, an instructable based around building a cheap infrared touch interface that anyone can build, given they are willing to put time and effort into it. In this instructable, I will teach you how to build the touch interface, upload the programs necessary for its function, and show you how to troubleshoot and test it.
The Touch Surface functions like an interactive touch display such as a SmartBoard. This means that when wirelessly connected to a computer, touching within the touch area will move the mouse on the computer. The wireless factor means that it can also be placed within any area it fits in. The interface is also relatively cheap, costing < $50 to assemble. All of the programs are provided.
Update 12/6/16: Please vote for this instructable in the contests it is involved in if you find it interesting or at least helpful. Thank you very much.
This is a primary prototype of an interactive touch interface and it is the prototype I have currently entered into numerous science fairs. This is the first prototype and it is capable of responding to touches accurately to a certain degree (you may watch the video attached to this instructable for a demonstration), I am currently working on a prototype with a larger touch resolution and with greater accuracy. I will make another instructable at a later date, teaching how to build the 2nd prototype.
Before getting into the instructions it is important to understand how infrared touch systems work. A quick overview of the function of these devices is as follows. A simple infrared touch system is composed of multiple infrared emitters (led or lasers) and infrared receivers. The purpose of the emitters is to emit infrared light to the receivers, a virtual grid system or similar formed by the emitters and receivers. The grid system is composed of x and y components, made by the receivers. The system is controlled by microcontrollers made by companies such as ARM and ATMEL. In this instructable, we will use Arduino boards as the microcontrollers which are made by ATMEL. The programs running on the microcontroller detect when a touch is encountered by one of the receivers when the said receiver sends a signal. The microcontrollers then analyze the positioning of the receiver and send a connected computer a signal with information on where the touch occurred relative to the screen.
Step 1: Compatibility
Touch interfaces usually require drivers on the PCs they are to be used on, but once this device is programmed, it can be plugged into any computer with a USB port, running any operating system and achieve normal functionality. When changing between computers of different resolutions make sure you install the appropriate file that corresponds to your screen resolution. The files for the different resolution will be uploaded on my GitHub as I get resolution requests. The default program for hub 5 supports 1600x900 resultion, if your resolution is any different, please feel free to email me your resolution so I can give you the right program for hub 5.
Step 2: Parts List & Requirements
One of my main goals within this instructable is to keep the project super low-cost. With this in mind, I was able to order all the parts that I needed on Ebay for no more than $50. To meet this price point it might be necessary to specifically seek out Chinese sellers for these items, the shipping time is usually 2 weeks. It is also important to keep in mind that it is always good practice to buy a few extra parts (especially for the small components such as resistors).
480 - Breadboard Male to Male Connectors Ebay
96 - 5mm Infrared Emitters (940nm) Ebay
96 - 5mm Infrared Phototransistors (940nm) Ebay
96 - 100k Ohm Resistors Ebay
12 - 4051 Texas Instruments Multiplexers Ebay
8 - 840 pin Breadboards Ebay
7 - Breadboard Female to Female Connectors Ebay
6 - 100 Ohm Resistors Ebay
5 - nrf24l01 Wireless Transceivers Ebay
4 - 10uF Capacitors Ebay
4 - Mini USB Type B Connectors Ebay
4 - Arduino Nano v 3.0 Ebay
1 - Arduino Pro Micro 3.3V/8Mhz Ebay
1 - Micro USB Type B Connector Ebay
Step 3: Setting Up Arduino IDE (Build Computer Only)
The build computer is the computer we use to upload programs to the Arduino and calibrate the devices, it can be the same or seperate from the computer we test/use the device on. In order to upload the pre-written programs on the Arduino boards, we are required to use the Arduino IDE. The IDE lets us interface with the Arduino boards, upload programs unto them, and later troubleshoot and calibrate the microntrollers. It is important to mention that the mentioned processes need to only be carried out once, one the computer we will be using to upload the programs onto the Arduino boards. If the computer we test/use the device on is different from the one we use to upload and calibrate the programs, we do not need to install the following programs and drivers.
Downloading the IDE:
We can download the Arduino IDE from the official Arduino website: https://www.arduino.cc/en/Main/Software
After Downloading the IDE, please install and open it.
Installing CH340G Drivers:
In order for our computers to interface with the Arduino Nano, we will need to install the necessary drivers, ( the CH340G) drivers. The file marked as DCcduino_ch340-drivers.zip contains the necessary drivers, use an extraction software to extract the files and run Setup.exe in the following directory: ~\DCcduino_ch340-drivers\CH341SER_WIN\CH341SER. Now when you plug in your Arduino Nanos they will be recognized by the computer and you can upload programs to them.
Installing Pro Micro in Arduino IDE:
In order to upload the Pro Micro program, we first need to install the Pro Micro in the Arduino IDE.
The instructions on how to install the Pro Micro on the Arduino IDE can be found on the sparkfun website (they are simple and easy to follow): https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/installing-windows
Step 4: Building Required Circuits: Hubs 1 & 2
In order for the programs we will upload onto the Arduinos to function, we need to build circuits for them to interface with. In total there are 5 "complex" circuits in this project (they are not complex to build, the complexity comes from the fact that they are connected to the Arduinos which make them one huge circuit with processors and all sorts of other components). There are 4 sensor hubs and 1 receiver/command circuit. In order to build any of these circuits, we need to use breadboards and the aforementioned components. Each sensor hub uses 2 breadboards, 24 (emitters, receivers, and 100k Ohm resistors), 1 nrf24L01 module, 1 capacitor, 3 multiplexers, 6 100 Ohm resistors, and 120 male to male breadboard wires. The images below appear blurry in the Instructables photo viewer, please download them and view them in programs such as paint for clearer resolution, THIS IS IMPORTANT FOR ACCURATE CONNECTIONS.
Building the first 2 Sensor Hubs
The process of building the sensor hubs is relatively the same so I used Fritzing to show the important steps of building as it is relatively straightforward this way.
Hub 1 & 2 Step 1 (refer to annotation on Image):
Connect the Arduino, multiplexers, nrf transmitter, capacitor, resistors and emitters in the same fashion as the one below. Be Make sure your connections to the Arduino are the same as the ones in the images.
Hub 1 & 2 Step 2 (refer to annotation on Image):
Connect the Infrared Receivers, and 100kOhm resistors onto the second breadboard and make the necessary wire connections as depicted in the images. The emitters are bright blue because Fritzing didn't have the right dark blue color that the 940nm receivers arrive in.
Hub 1 & 2 Step 3 (refer to annotation on Image):
Connect 8 infrared receivers to their respective positions on the multiplexers by using a wire from the pin between the resistor and receiver, going to the multiplexer. The connections are clearly depicted on the images.
Hub 1 & 2 Step 4 (refer to annotation on Image):
Connect another 8 infrared receivers to their respective positions on the multiplexers. The connections are detailed on the images.
Hub 1 & 2 Step 5 (refer to annotation on Image):
Connect the remaining 16 infrared receivers to the remaining 2 multiplexers. Make sure the connections for each set of eight receivers is similar to the way the first 8 were connected (which is detailed in the images for steps 3 and 4).
Step 5: Building Required Circuits: Hubs 1 & 2
Hubs 3 & 4 are nearly identical to hubs 1 & 2 in the way they are built but there are some subtle differences you may not have noticed while comparing the images for the two different types of hubs. The receivers on hubs 3 & 4 have different connections on the multiplexers. The grey, white, and orange lines on the multiplexers also have switched positions. Please pay attention to these subtle differences when building the 3rd and 4th hubs, failure to do so will result in circuits that do not correspond to the programs on the Arduino.
Step 6: Building Required Circuits: Hub 5
So far we have built the 4 sensor hubs that will send information to the receiver hub, now we have to build the receiver hub. The receiver hub has the most simple circuit out of the five as it requires only the Arduino Pro Micro 3.3V/8MHz and the only nrf24L01 module left. The included image shows how to build the circuit, we can use the female to feUsemale breadboard pins to directly connect the nrf24L01's pins and the Arduino's pins. We do not need a breadboard.
Disclaimer: This image of the pro micro hooked up to the transceiver module was not created by me, it is from the following forum: https://forum.mysensors.org/topic/1790/pro-micro-h...
I apologize, I could not make the image as there is no Arduino Pro Micro within Fritzing software.
Step 7: Uploading Programs
Now that we have successfully built our 5 circuits (4 sensor hubs, and 1 receiver hub) we will need to upload programs to the different hubs. It is important to note that each hub receives each own program. The code for each one of the hubs can be found on my GitHub page: https://github.com/Ultimatefire54/Arduino-Infrared...
Please download the zipped folder and unzip it, then follow the instructions below to upload the instructions below to upload the programs onto the respective hubs. The hub programs can also be downloaded directly from the instructable.
Plug all of the hubs into your computer using their respective USB connectors (Mini USB for Nanos and Micro USB for Pro Micro) and open up the Arduino IDE. Open up device manager as you plug in the hubs and note which hub is assigned which COM port.
Move each one of the "Hub.ino" files we downloaded into their own folders of the same name (in total there should be 5 folders now).
Open each one of the "Hub.ino" files using the Arduino IDE and select the board (Arduino Nano) and COM Port of the hub you want to upload the respective program on first. You may then upload each respective hub's code onto its hub, except for Hub 5. Hub 5's program requires us to select the Pro Micro from the Boards Manager (be sure you select the right version which in this case is the 3.3V/8MHz version).
Step 8: Calibrating and Operation
Now that the programs of each hub are uploaded, we can calibrate the Hubs and start the testing. The programs that I wrote for each hub have a debug mode that can be accessed through the Arduino Serial Monitor. The Serial Monitor allows for the program to output data from the microcontroller it is connected to, effectively giving us a debugging tool. The program has been written to accept specific commands for specific functions such as calibrating, resetting, and other debugging functions. In this step, we will cover only the commands necessary to calibrate the hubs properly and have them function in the way an infrared touch interface would.
Arrange the Hubs so that they form a square formation. Looking on one side of the square, the bottom-left hub should be hub 1, on the bottom-right hub should be hub 3. The top-left hub should be hub 2, and the top-right hub should be hub 4. Throughout the following steps make sure that hub 5 is plugged in.
Lining Up Sensors:
In order for the main hubs (hubs 1-4) to receive information from their sensors, the sensors must be lined up correctly with emitters from some other hub. In order to test whether the hubs are lined up, we can use the Serial Monitor tool within the Arduino IDE. After opening up the serial monitor of a certain hub we can check to see if the sensors are aligned by typing the letter "n" in the serial window and pressing Enter. If all of the values between 0-23 are above the value of 50, the emitters are aligned with the receivers. If not you may adjust the position of the receiver or emitter hub to receive full coverage.
After we have confirmed that all of the receivers on hubs 1-4 have full coverage we can then calibrate the programs on each hub, by entering the letter "a" into the serial monitor of each hub and pressing Enter. The receivers are now calibrated, but we now need to filter out shadows from the operation of the hubs so we send the "r" command and create as much shade over the 4 hubs to set a base light level. During the "r" operation, do not make any touches within the touch area until a data stream starts to flow from the serial monitor. After all of these steps we are ready to connect the 4 hubs to the 5th hub.
The 4 primary hubs send information wirelessly to the 5th hub so the hubs do not need to be connected to the same computer. Now that you have calibrated the hubs please E-mail me the screen resolution of the PC you plan on using the touch interface on to control the cursor. my email is: email@example.com
Step 9: Contests: Arduino, and First Time Author
This Instructable has been entered into the following Instructables contests:
- First Time Author
Please Vote for this Instructable in the categories it is competing in, this really helps me out a lot.