Skip to main content

Metal Touch Sensor Module Arduino Circuit diagram & Code

 Easy DIY Metal Touch Sensor with Arduino for School Projects 100% Working:

KY-036 Metal touch sensor Module Arduino:

KY-036 Metal touch sensor Module with Arduino– In this article, we will learn how to use the KY-036 metal touch sensor Module and its use with the Arduino Uno or Arduino Nano. The KY-036 metal touch sensor module features a Darlington and PN transistor, the signal of which is controlled by LM393 comparator IC which consists of two comparators. When you touch the bar wire meant over the transistor which is represented by the base of the transistor.

KY-036 Metal Touch Sensor

The 50 Hertz signal around us in a modern home or office is injected into a high gain amplifier the output of this amplifier is connected to the comparator. The AC signal is then converted to the square wave. We can adjust the sensitivity of the sensor by adjusting the trimmer. When we will touch the sensor the led will starts blinking. If you look closely at the led you will see a slight flicker this is due to the output that is represented by a square wave of 50 Hertz instead of constant value.

This module has integrated on board touch sensor which consists of potentiometer one microchip, six resistors and two LEDs. The resistor R1 used in this module is10-kilo ohms the resistor R2 is 100-kilo ohms the resistor R3 is 150 ohms and the resistor R4 is 1-kilo ohm the resistor R5 is 1-kilo ohm the resistor R6 is 100-kilo ohms and the main reason for using the resistors is to limit current circulating inside the module in other words to prevent current from burning the module. The LED L1 in the module lights up to show if the module is working properly or not and the LED L2 lights up every time when we touch the sensor.



Features of the KY-036 touch sensor:

These are some features of the sensor:

  • It has a power supply 3.3 volt or 5.5 volt.
  • its sensitivity is adjustable
  • it has an analog and digital output
  • Packaging: antistatic sealed bag
  • Form dimensions 34 x 16 mm

There are two built-in LEDs on the sensor module. The LED1 shows that the sensor is supplied with voltage and the LED2 will show that the sensor is detecting magnetic field. The main component of the KY-036 Metal Touch sensor module on its circuit board is the sensor unit at the front of the module which measures the area physically and send an analog signal to the second unit, the amplifier. The amplifier amplifies the signal according to the resistors value of the potentiometer and send the signal to the analog output of the Metal Touch Sensor module. The third component is a comparator which switch the digital output and the LED. If the signal falls under a specific value you can control the sensitivity by adjusting the potentiometer, here please note the signal will be inverted that may that if you measure a higher level high value it is shown as a low-voltage value at the analog output. The sensor does not show absolute value it is a relative measurements you define an extreme value to a given normal environment situation and a signal will be sent if the measurement exceeds the extreme value.

Working Principle of the KY-036:

Let us quickly understand the working principle of the KY-036 Metal Touch sensor module. Basically, the functionality of the KY-036 Metal Touch sensor module is divided into three main components first the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit the amplifier. The amplifier basically amplifies the signal and according to the resistance value of the potentiometer and sends the signal to the analog output of the module also you can set the sensitivity of the sensor by adjusting the knob of the potentiometer. If you rotate it in clockwise direction you can increase the sensitivity and if you rotate it in anti-clockwise direction you can reduce the sensitivity as shown in the diagram.

KY-036 Metal Touch Sensor

The comparator will switches the digital out and turn on the led if the signal falls under a specific value.

KY-036 Pinout:

KY-036 Metal Touch Sensor

It has basically four pins digital signal, VCC +V, Ground, and analog signal.

Interfacing KY-06 with Arduino, Circuit:

We will be using digital signal pin, the VCC pin, and the ground of the sensor to interface it with Arduino.

KY-036 Metal Touch Sensor

 This is the circuit diagram for the KY-036 Metal Touch sensor module interface with the Arduino. We are going to connect the ground pin with the ground of the Arduino. The VCC of the sensor will be connected with the 5V of the Arduino. The digital pin of the sensor will be connected with the digital pin number 8 of the Arduino. Connect the led with pin number 13 of the Arduino I am using a 5v led, if you are using a standard 2.5 LED then don’t forget to add a resistor of 330 ohms with the LED, otherwise the LED will burnout.

KY-036 Metal Touch sensor Arduino Code:

int led = 13;
int val;
int sensorpin = 9;
 
void setup() {
pinMode (led,OUTPUT);
pinMode (sensorpin,INPUT);
 
}
 
void loop() {
val= digitalRead(sensorpin);
if (val==HIGH)
{
  digitalWrite (led, HIGH);
  }
  else
  {
      digitalWrite (led, LOW);
 
    }
}

So, if you go ahead and upload this code, you will be able to control the LED. This is just a basic program to check if it is really working.

KY-036 touch sensor with Arduino and Relay module:

Now we will connect the touch KY-036 Touch Sensor with Arduino and relay module and when we touch the sensor bulb will turn on and in this way we can control home appliances and turn it on and off by just touching the sensor.

Components Required:

  • KY-036 touch sensor
  • Arduino UNO
  • Relay module
  • Bulb

KY-036 Circuit connection:

KY-036 Metal Touch Sensor

  • Connect the ground pin of the KY-036 touch sensor with the ground of the Arduino
  • Connect the VCC of the touch sensor with the 5 V of the Arduino
  • Connect the touch sensor Vo at the digital pin 8
  • Connect the relay module at the digital pin number D9
  • Connect the ground of the relay module with the ground of the Arduino
  • Connect 5V supply to the relay module
  • Connect the normally open contact of the relay module with the bulb
  • Connect the other normally closed of the relay module with the switch
  • Connect the other terminal of the switch with the bulb

Now the circuit is completed and after uploading the code when we will touch the sensor the bulb will be on.

KY-036 touch sensor Arduino Code to control a Bulb:

const int sensor = 8;
const int relay = 9;
int stat;
 
void setup() {
pinMode (sensor, INPUT);
pinMode ( relay, OUTPUT);
 
}
 
void loop() {
 
  stat = digitalRead (sensor);
  if ( stat == HIGH)
  {
    digitalWrite (relay, HIGH);
    }
else
{
      digitalWrite (relay, LOW);
 
  }
}

Comments

popular posts

AX2358 Homemade 5.1 Remote Kit with 16x2 LCD

AX2358 Homemade 5.1 Remote Kit with 16x2 LCD                                               AX2358 is I used for this 5.1 remote kit project. It is Built-in 2-channel to 6-channel converter and 6-channel volume controller. It has 4 stereo inputs and one 6 channel input. Any stereo input terminals of AX2358 are selected, it will be directly converted to 6 channels and then output through volume adjustment but when the signal from the 6-channel input terminal is selected, it directly enters the volume adjustment and then outputs it without any processing. It has 6-channel individual volume control in this IC (0 to -79dB, 1dB/step). This IC working by I2C communication. The data are transmitted to the AX2358 via the SDA and SCL. So I need a microcontroller. I choose the microcontroller is Atmega328 for this. This microcontroller programmed with Arduino UNO.      ...

DIY Tutorial Resetting Toner Chip on Ricoh SP C250DN Printer in Simple Steps

  DIY Tutorial Resetting Toner Chip on Ricoh SP C250DN Printer in Simple Steps The RICOH SP 250DN printer toners have a chip that keeps track of the number of pages that have been printed. This is anoying because it will render a refill useless. In order to reuse this kind of toner, there are two things you need to do: refill the toner with ink (if needed) reset the toner chip (or replace it) There is plenty of information explaining how to refill the toner but little information on how to erase the toner chip. This document deals with the second point: how to dump the chip and reset it. It took me a while to get everything setup and to have my toner chip reset so I would like to share this process in order to help other to do the same with their printer toner cartridges. I will step through the process of understanding the problem, analysing the chip circuit, dumping the chip contents and writing back a pattern so the printer will be able to initialize the chip and set t...

DIY Metal Detector using Arduino A Simple Guide to Building Your Own at Home

  DIY Metal Detector using Arduino A Simple Guide to Building Your Own at Home How does a metal detector work? As we can see there are three things that are using to complete the whole project. Electronic circuit, Arduino, and a copper coil. here actually we are making a proximity sensor that detects the metal with a  metal detector  using Arduino . Here are the steps to build a DIY metal detector using an Arduino: Materials required: Arduino UNO Copper coil Diode 10nf capacitor Buzzer Led 220 ohm &  330 Ohm Resistor Jumper wires and a breadboard USB cable for uploading the code Circuit Diagram Arduino metal detector:-  Arduino UNO 10 nf Capacitor A2 Pin Terminal 1 GND Terminal 2 Arduino UNO Buzzer D6 Pin Positive GND  Negative Arduino LED 220 Ohm Resistor D5 Pin   Terminal 1   Anode Pin Terminal 2 GND Cathode Pin   Arduino UNO Copper coil Diode 330-ohm res   Terminal 1 Terminal 1 Terminal 1 A1 Pin     Terminal 2 A2 Pin ...

How to Calculate Inverter Battery Backup Time

  How to Calculate Inverter Battery Backup Time? Backup Time (in hours) = Battery Capacity (in Ah) X Input voltage (V) / Total Load (in Watts) Whenever you plan to buy an inverter battery, there is a desire to know some important information in your mind. Like how much will be the backup of the inverter battery, how many hours of backup will be available for how many ah batteries, etc. In this informative information, here you will know the backup time calculation formula.   Taking your inputs, you can calculate your total load, like: 3 tube led lights = 40 x 3 = 120 Watts 2 fans = 75 x 2 = 150 Watts 1 Bulb router = 1×20 Watts = 20 Watts So, the total load in your case is 120 + 150 + 20 = 290 Watts. Now, let us apply all these values in the above-said battery backup time formula.  Backup Time (in hours) = Battery Capacity (in Ah) X Input voltage (V) / Total Load (in Watts) Backup Time (in hours) = 150 x 12 / 290 = 6.2 So, your inverter battery will last around 6.2 hours ....

Wireless Joystick controlled Robot Car using Arduino, 433Mhz RF and L298N Motor Driver

    Wireless Joystick controlled Robot Car using Arduino – In this tutorial, you will learn how to control a Robot Car wirelessly using Arduino, L298N Motor driver, and  433 Mhz RF transmitter and Receiver . The robot control system can be activated and de-activated using the Built-in Joystick push Button. Arduino Uno Arduino Nano Mega 2560: Robot Car chassis kit: L298N motor driver: 2-Axis Analog Joystick 433 MHz Transmitter and Receiver Modules: DISCLAIMER: Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way! wireless joystick Interfacing: Watch this tutorial for the robot parts assembling and connections. All the connections are exactly the same as explained in my previous tutorial. The only modification that I did is the addition of the 433 Mhz RF receiver module…the VCC pin of the receiver module is connected with the 5 volts…the ground pin of the ...