Maker.io main logo

Arduino Handheld Fan With Capacitive Touch Switch

131

2026-07-21 | By Ron Cutts

Share

License: GNU Lesser General Public License Microcontrollers Power Supplies Touch Arduino ESP32

In this tutorial, we will learn how to turn a handheld battery fan ON and OFF using a capacitive touch sensor, relay module, and Visuino.

Watch a demonstration video.

What You Will Need

What You Will Need

What You Will Need photo 2

What You Will Need photo 3

What You Will Need photo 4

What You Will Need photo 5

What You Will Need photo 6

What You Will Need photo 7

The Circuit

  • Connect the capacitive touch sensor "Signal" pin to Arduino Digital pin[7]

  • Connect the capacitive touch sensor "VCC" pin to pin [5V]

  • Connect the capacitive touch sensor "GND" pin to pin [GND]

  • Connect the relay "Signal" pin to Arduino digital pin [8]

  • Connect the relay "VCC" pin to pin [5V]

  • Connect the relay "GND" pin to pin [GND]

  • Connect the handheld "Positive" pin to pin [5V].

  • Connect the handheld "Negative" pin to Relay pin [NC]

  • Connect Relay pin [C] to pin [GND]

The Circuit

Start Visuino, and Select the Arduino UNO Board Type

To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://www.arduino.cc/.

Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher; otherwise, this will not work! If you have not done so, follow the steps to set up the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino. When the dialog appears, select "Arduino UNO" as shown in Picture 2

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type photo 2

In Visuino, Add Components

  • Add "Detect Edge" component and set under the properties window "Rising" to "True"

  • Add "(T) Flip-Flop" component

  • Connect Arduino Digital Out pin [7] to "DetectEdge1" component pin[In]

  • Connect "DetectEdge1" component pin[Out] to "TFlipFlop1" component pin[Clock]

  • Connect "TFlipFlop1" component pin[Out] to Arduino Digital IN pin[8]

In Visuino Add Components

Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom, click on the "Build" tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Generate, Compile, and Upload the Arduino Code

Play

If you power the Arduino UNO module, the fan should spin if you touch the "capacitive touch" sensor or turn the fan off.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project that I created for this. You can download and open it in Visuino: https://www.visuino.eu

Downloads

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.