Automated Touch on Display

by DanySteve in Circuits > Arduino

53 Views, 0 Favorites, 0 Comments

Automated Touch on Display

IMG_2270.jpeg
Screenshot 2026-03-28 at 9.14.33 PM.png
IMG_2272.jpeg
IMG_2271.jpeg
2FE1CC50-A8D6-40CE-9CA4-0CBF01F58356.jpg

I built a device that automatically presses the buttons in the game Don’t Press the White Tiles. It uses photoresistor sensors to detect the tiles and transistors to control solenoids that physically press the screen.

Supplies

Transistor-TIP-122.jpg
pir_photo_cell_trigger_ied__54122.jpg
412-00.jpg
E56C4037-68A1-4695-B761-B2548AFE52A1.jpg
Screenshot 2026-03-28 at 9.15.14 PM.png
Screenshot 2026-03-28 at 9.15.02 PM.png

Here is the list of required materials: 4 photoresistors, 4 transistors, and 4 solenoids. Additionally, you will need some screws and access to a 3D printer to create a custom mount for your phone (basic CAD skills are recommended).

Cad Design

suport telefon solenoide v1.jpg
IMG_3460.jpeg
suport telefon solenoide v1.png
Screenshot 2026-03-28 at 9.13.57 PM.png

The first step is to create a basic CAD design based on the specific solenoid model you purchased, so you can properly mount and align them with your phone.

Transistors

Screenshot 2025-08-23 at 5.17.54 PM.png
FWU2SIBMN97ROM6.jpg

The second step is to understand how a transistor works, as it is essential for this project. The Arduino does not provide enough power to drive the solenoids directly, so transistors are needed to act as switches and control them safely. The provided circuit diagram is very helpful for understanding how to connect the transistors to the Arduino and to the external power source.

Photoresistors

FNJBDFJMN97ROMC.jpg
de4d5774d93a4020b3441e5625e74c7bb9298f5a.jpg
F4X1FZSMN97RONA.png
WhatsApp Image 2026-03-05 at 16.22.43.jpeg

The third step is to understand how a photoresistor works. It detects changes in light intensity—distinguishing between brighter and darker areas—which makes it ideal for this application, since the game features white and black tiles that can be easily identified using photoresistors. I also recommend running a calibration (tuning) program beforehand to achieve high accuracy for each individual sensor.

Solenoids

F86BKDBMN97ROSD.jpg
FR6VHQ1MN97ROMR.png
FD4OO3YMN97ROMJ.png

The fourth step is to prepare the solenoids so they have a larger contact surface that is also conductive, allowing them to mimic a human finger and properly interact with the touchscreen.

Final Product

F4X1FZSMN97RONA.png
FN2TIQHMN97RONL.jpg
FGIXX2NMN97ROOA.jpg

The fifth step is to connect all the components together and ensure good wire management to prevent interference or tangling. Once everything is properly assembled and organized, you can move on to the coding stage.

Coding

Screenshot 2026-03-28 at 9.54.15 PM.png
Screenshot 2026-03-28 at 9.53.16 PM.png
Screenshot 2026-03-28 at 9.53.22 PM.png
Screenshot 2026-03-28 at 9.53.28 PM.png
Screenshot 2026-03-28 at 9.53.37 PM.png
Screenshot 2026-03-28 at 9.53.47 PM.png

The sixth and final step is to develop a functional code that triggers the solenoids whenever the photoresistors detect a change in light intensity. The image includes sample code snippets, as well as the full program I wrote to make the system actually play the game.


In the given pictures you can also find explanations for each piece of code.