Arduino Handheld Fan With Capacitive Touch Switch.

Photo of Ron

Made by Ron / Health / Robotics / Sensors

About the project

In this tutorial we will learn how to Turn Hendheld battery fan ON and OFF using capacitive touch sensor, reley module and Visuino.

Project info

Difficulty: Moderate

Platforms: AdafruitArduinoDFRobotVisuino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Axial Fan, 12 VDC Axial Fan, 12 VDC x 1
Jumper wires (generic) Jumper wires (generic) x 1
Adafruit Capacitive Touch Sensor Breakout - MPR121 Adafruit Capacitive Touch Sensor Breakout - MPR121 x 1
DFRobot Gravity: Digital 5A Relay Module DFRobot Gravity: Digital 5A Relay Module x 1
Arduino UNO Arduino UNO x 1

Software apps and online services

Visuino Visuino
Arduino IDE Arduino IDE

Story

In this tutorial we will learn how to Turn Hendheld battery fan ON and OFF using capacitive touch sensor, reley module and Visuino.

Watch a demonstration video.

Step 1: What You Will Need

1 / 6

  • Arduino UNO (or any other Arduino)
  • Jumper wires
  • Capacitive touch sensor
  • Wires with aligator clips
  • Battery fan (or some other battery powered device)
  • Visuino program: Download Visuino

Step 2: The Circuit

  • Connect Capacitive touch sensor "Signal" pin to Arduino Digital pin[7]
  • Connect Capacitive touch sensor "VCC" pin to pin [5V]
  • Connect Capacitive touch sensor "GND" pin to pin [GND]
  • Connect Relay "Signal" pin to Arduino Digital pin[8]
  • Connect Relay "VCC" pin to pin[5V]
  • Connect Relay "GND" pin to pin[GND]
  • Connect Hendheld "Positive" pin to pin[5V]
  • Connect Hendheld "Negative" pin to Relay pin[NC]
  • Connect Relay pin[C] to pin[GND]

Step 3: Start Visuino, and Select the Arduino UNO Board Type

1 / 2

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 tutorial will not work! If you have not done follow the steps in this tutorial to setup 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 on Picture 2

Step 4: In Visuino Add Components

  • Add "Detect Edge" component and set under 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]

Step 5: 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.

Step 6: 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 tutorial. You can download and open it in Visuino: https://www.visuino.eu

Schematics, diagrams and documents

Visuino File

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...