Sensor Modules

Arduino Sensor Modules Explained: Ultrasonic, PIR, Gas, Flame, Sound, Soil Moisture and More

What each popular Arduino sensor module does and where it is used: HC-SR04 ultrasonic, HC-SR501 PIR motion, MQ-2 gas, KY-026 flame, KY-038 sound, soil moisture, water level, IR obstacle and touch sensors.

2 min readBy the module.pk teamاردو میں پڑھیں ↓

Browse all 11 Sensor Modules
Sensor Modules

Sensors are how an Arduino or ESP32 project knows what is happening around it. A sensor module puts the sensor together with the small circuit it needs on one board with labelled pins, so you connect three or four wires and read it in code. No extra components, no guesswork.

This guide explains the sensor modules students and makers use most, what each one detects and the projects it suits. You can see all of them on our sensor modules page.

Digital and analog outputs

Many modules give two outputs. The digital output (DO) switches high or low when the reading crosses a threshold you set with the small blue potentiometer on the board. The analog output (AO) gives the actual level, which you read with analogRead() for finer control. Most work on 3.3V to 5V, so they suit Arduino, ESP8266 and ESP32 alike.

Tips for reliable sensor readings

  • Preheat gas sensors: an MQ-2 needs a few minutes of warm up before its readings settle.
  • Avoid soil sensor corrosion: power the soil moisture sensor only when reading it, to make the probe last longer.
  • Adjust the potentiometer: set the threshold for the digital output in the real place the sensor will be used.
  • Keep PIR sensors away from heaters and sunlight, which cause false triggers.
MQ-2 Gas and Smoke Sensor
The MQ-2 gas and smoke sensor, used in kitchen gas leak alarms with an Arduino and a buzzer.View MQ-2 Gas and Smoke Sensor

Filter sensors by what you need on module.pk

On our sensor modules page you can type a model like HC-SR04 or simply a word like gas or motion, and tap a quick pick tile for the sensor type: PIR motion, ultrasonic distance, gas, flame, sound or soil moisture.

The filters narrow it further by output type (digital, analog or both), operating voltage and adjustable sensitivity, so a 3.3V ESP32 project only shows sensors that work at 3.3V.

Frequently asked questions

Which sensor is used for an obstacle avoiding robot?

The HC-SR04 ultrasonic sensor for distance, or the HW-201 IR sensor for close range detection.

Do these sensors work with ESP32?

Most work from 3.3V to 5V. Use the operating voltage filter on our sensor modules page to check.

What does the potentiometer on a sensor module do?

It sets the threshold at which the digital output switches.

اردو میں

Arduino سینسر ماڈیول کی پوری سمجھ: الٹراسونک، PIR، گیس، آگ، آواز، مٹی کی نمی اور مزید

سینسر سے ہی Arduino یا ESP32 پراجیکٹ کو پتا چلتا ہے کہ آس پاس کیا ہو رہا ہے۔ سینسر ماڈیول میں سینسر اور اس کا چھوٹا سرکٹ ایک بورڈ پر ہوتا ہے، پنوں پر نام لکھے ہوتے ہیں، تو آپ تین چار تاریں جوڑ کر کوڈ میں پڑھ لیتے ہیں۔ نہ اضافی پارٹس، نہ اندازے۔

اس گائیڈ میں وہ سینسر ماڈیول ہیں جو طالب علم اور شوقین سب سے زیادہ استعمال کرتے ہیں، ہر ایک کیا پکڑتا ہے اور کس پراجیکٹ میں کام آتا ہے۔ سب ہمارے سینسر ماڈیول پیج پر ہیں۔

ڈیجیٹل اور اینالاگ آؤٹ پٹ

بہت سے ماڈیول دو آؤٹ پٹ دیتے ہیں۔ ڈیجیٹل آؤٹ پٹ (DO) تب ہائی یا لو ہوتا ہے جب ریڈنگ اس حد سے گزرے جو آپ بورڈ پر نیلے پوٹینشیومیٹر سے سیٹ کرتے ہیں۔ اینالاگ آؤٹ پٹ (AO) اصل لیول دیتا ہے، جسے analogRead() سے باریکی سے پڑھا جاتا ہے۔ زیادہ تر 3.3V سے 5V پر چلتے ہیں، اس لیے Arduino، ESP8266 اور ESP32 سب کے ساتھ لگتے ہیں۔

سب سے مشہور سینسر ماڈیول اور ان کا کام

سینسرکیا پکڑتا ہےکہاں استعمال
HC-SR04 الٹراسونکفاصلہ، تقریباً 2cm سے 4mرکاوٹ سے بچنے والے روبوٹ، پارکنگ سینسر، ٹینکی کا لیول
HC-SR501 PIRانسان کی حرکتسیکیورٹی الارم، خودکار لائٹ
MQ-2 گیس اور دھواںLPG، میتھین، دھواںکچن میں گیس لیک الارم
KY-026 آگشعلے کی انفرا ریڈ روشنیفائر الارم، آگ بجھانے والے روبوٹ
KY-038 آوازآواز کا لیولتالی سے چلنے والا سوئچ، شور ناپنا
مٹی کی نمیمٹی میں پانیپودوں کو خود پانی دینا
پانی کا لیولاس کی پٹیوں پر پانی کی گہرائیاوور فلو اور بارش کا الارم
HW-201 IRقریب کی چیزیں اور کالی لکیرلائن پر چلنے والے روبوٹ
KY-036 میٹل ٹچدھات کی پن کو چھوناٹچ سوئچ
وائبریشن LM393ہلنا اور ٹھوکرچوری کا الارم
HC-SR04 Ultrasonic Distance Sensor
HC-SR04 الٹراسونک سینسر آواز کی لہروں سے فاصلہ ناپتا ہے، روبوٹ اور ٹینکی لیول میٹر کا کلاسک سینسر۔

پکی ریڈنگ کے لیے مشورے

  • گیس سینسر کو گرم ہونے دیں: MQ-2 کی ریڈنگ چند منٹ گرم ہونے کے بعد ٹھیک ہوتی ہے۔
  • مٹی کے سینسر کو زنگ سے بچائیں: صرف ریڈنگ کے وقت بجلی دیں تاکہ پروب زیادہ چلے۔
  • پوٹینشیومیٹر سیٹ کریں: ڈیجیٹل آؤٹ پٹ کی حد اسی جگہ سیٹ کریں جہاں سینسر لگنا ہے۔
  • PIR سینسر کو ہیٹر اور دھوپ سے دور رکھیں، ورنہ غلط الارم بجتا ہے۔
MQ-2 Gas and Smoke Sensor
MQ-2 گیس اور دھوئیں کا سینسر، Arduino اور بزر کے ساتھ کچن کے گیس لیک الارم میں استعمال ہوتا ہے۔

module.pk پر اپنی ضرورت کے سینسر فلٹر کریں

ہمارے سینسر ماڈیول پیج پر HC-SR04 جیسا ماڈل یا صرف gas یا motion جیسا لفظ لکھیں، اور سینسر کی قسم کا فوری ٹائل دبائیں: PIR حرکت، الٹراسونک فاصلہ، گیس، آگ، آواز یا مٹی کی نمی۔

فلٹر مزید آؤٹ پٹ کی قسم (ڈیجیٹل، اینالاگ یا دونوں)، وولٹیج اور حساسیت کم زیادہ ہو سکتی ہے یا نہیں سے لسٹ چھوٹی کرتے ہیں، تاکہ 3.3V کے ESP32 پراجیکٹ میں صرف 3.3V پر چلنے والے سینسر دکھیں۔

اکثر پوچھے جانے والے سوال

رکاوٹ سے بچنے والے روبوٹ میں کون سا سینسر لگتا ہے؟

فاصلے کے لیے HC-SR04 الٹراسونک سینسر، یا قریب کی چیزوں کے لیے HW-201 IR سینسر۔

کیا یہ سینسر ESP32 کے ساتھ چلتے ہیں؟

زیادہ تر 3.3V سے 5V پر چلتے ہیں۔ ہمارے سینسر ماڈیول پیج پر وولٹیج فلٹر سے چیک کریں۔

سینسر ماڈیول پر پوٹینشیومیٹر کیا کرتا ہے؟

یہ وہ حد سیٹ کرتا ہے جس پر ڈیجیٹل آؤٹ پٹ بدلتا ہے۔

Shop Sensor Modules on module.pk

See all Sensor Modules

Ready to order Sensor Modules?

Prices, stock and photos for every part, with delivery across Pakistan.

Browse Sensor Modules

Keep reading