Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›IR Remote Receivers

How-to · Beginner · 3 min read

IR Remote Receivers

VS1838B, TSOP and How to Decode a Remote With Arduino

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerHow an IR remote worksWiringDecoding button codesSending IR codesTroubleshootingTry itCommon mistakesFAQsParts and next steps
Short answer

An IR receiver such as the VS1838B contains a photodiode and a filter tuned to 38 kHz. It outputs the on/off pattern of a remote control on one pin. Connect it to power, ground and a digital input, install the IRremote library and print the codes of each button. To send IR, use a 940 nm LED driven by a transistor.

Key specs at a glance

Carrier
38 kHz (VS1838B, TSOP38238 and similar)
Supply
2.7 to 5.5 V on most; check the module
Output
Digital, normally high, pulled low during a burst
Range
Up to about 8 to 10 m for a standard remote
Protocols
NEC, Sony SIRC, RC5, Samsung and others
Pins
OUT, GND, VCC; order depends on the part, check the data sheet
01

How an IR remote works

A remote flashes an infrared LED in a coded pattern at 38 kHz. The receiver ignores sunlight and lamps and outputs the demodulated pulse train. The NEC protocol, used by many cheap remotes, sends a start burst (9 ms on, 4.5 ms off) followed by 32 bits: address, inverted address, command and inverted command. Libraries turn the timings into the address and command numbers.

02

Wiring

Connect VCC to 3.3 V or 5 V, GND to ground and OUT to a digital pin (pin 2 or 11 on an Uno). The VS1838B has three pins: with the dome facing you, check the data sheet for the exact order, because breakout boards differ. A 100 nF capacitor across the supply and a 100 Ω series resistor help in noisy circuits.

03

Decoding button codes

Install the IRremote library, upload this sketch and open the Serial Monitor. Press each button and write down the command number.

IR receiver with IRremote (Arduino) · Arduino C++Verify & upload in Electrolark
#include <IRremote.hpp>
const uint8_t IR_PIN = 2;

void setup() {
  Serial.begin(115200);
  IrReceiver.begin(IR_PIN, ENABLE_LED_FEEDBACK);
}

void loop() {
  if (IrReceiver.decode()) {
    Serial.print("Protocol: ");
    Serial.print(getProtocolString(IrReceiver.decodedIRData.protocol));
    Serial.print("  Command: 0x");
    Serial.println(IrReceiver.decodedIRData.command, HEX);
    IrReceiver.resume();             // ready for the next code
  }
}
04

Sending IR codes

Use a 940 nm IR LED with a transistor (for example a 2N2222 or an N-channel MOSFET) because a microcontroller pin cannot drive enough current for good range. Use the library's send functions to repeat the codes you captured. An IR transmitter module with a built-in driver is easier. See transistors.

05

Troubleshooting

No codes appear

check the pinout and that the receiver is 38 kHz, and that the remote battery is good.

Random codes

sunlight, fluorescent or dimmer noise; add a capacitor or shield the receiver.

Only works at short range

weak battery in the remote or a 36 kHz/56 kHz remote on a 38 kHz receiver.

Nothing sends

use a phone camera to see if the IR LED flashes; add a transistor.

06

Try it: Led resistor calculator

Change the values and the diagram and results update as you type.

07

Common mistakes to avoid

  • !Mixing up the pin order on the receiver.
  • !Driving the IR LED straight from the pin and expecting range.
  • !Using a 56 kHz remote with a 38 kHz receiver.
  • !Forgetting to call resume() after each decode.
  • !Leaving the receiver in direct sunlight.
08

Frequently asked questions

Can I use any IR LED?

Use 940 nm LEDs, which match the receiver. Visible red LEDs will not work.

What is the difference between VS1838B and TSOP38238?

Both are 38 kHz receivers. The TSOP is more noise tolerant and consistent, the VS1838B is cheaper.

Can I use one receiver with many remotes?

Yes, if they use 38 kHz. The library decodes common protocols.

How do I find my TV remote codes?

Capture each button with the sketch above and record the protocol and command.

Does it work on 3.3 V boards?

Yes, most receivers run from 2.7 V up.

Parts for this guide

  • VS1838B IR Remote Control Receiver – Pack of 2
    ₹113View
  • HS-S23P 38KHz Infrared Decoding Receiver Module – Digital Output
    ₹137View
  • Adafruit Infrared IR Remote Receiver – STEMMA JST PH 2mm Module
    ₹699View
  • Adafruit Infrared IR Remote Transceiver – STEMMA JST PH 2mm – 940nm Emitter + 38KHz Receiver
    ₹969View
Shop Infrared & Optical Detection Modules

Calculators

Led resistor calculator

Terms in this guide

38 kHz carrierMost IR remotes switch their LED on and off at 38 kHz. An IR receiver filters that frequency and outputs the on/off pattern.InfraredLight just beyond red that people cannot see, used by IR obstacle sensors, remote controls and line-following sensors.PhotodiodeA diode that produces a small current in proportion to light. Faster and more linear than an LDR, used in IR receivers and light meters.InterruptA hardware signal that makes the microcontroller pause its program and run a short function immediately, for example when a button pin changes.DebounceFiltering the rapid on-off bouncing of a mechanical switch so one press counts once.

Projects that use it

Put this into practice: 7 step-by-step builds in our project library use parts from this guide.

Beginner · 1 hourTV-remote controlled switchesView projectBeginner · 1 hourRemote-controlled RGB mood lightView projectBeginner · 2–3 hoursTV-remote controlled robot carView project
Browse all 7 projects

Keep learning

Component guideBeginnerIR Obstacle Sensor ModuleAn IR obstacle sensor module shines infrared light from an LED and watches for its reflection with a photodiode; when something is within about 2 to 30 cm, its OUT pin goes LOW.3 min read · SensorsComponent guideBeginnerArduino UnoThe Arduino Uno is a beginner-friendly microcontroller board that reads sensors and controls LEDs, motors and relays using simple C++ programs called sketches.5 min read · Boards & MicrocontrollersHow-toIntermediateTransistors and MOSFETs as SwitchesA transistor lets a small microcontroller signal switch a much larger current.4 min read · Semiconductors & ICsComponent guideBeginnerPIR Motion Sensor (HC-SR501)A PIR (passive infrared) sensor detects movement of warm bodies by sensing changes in infrared heat across its field of view.3 min read · SensorsComponent guideBeginnerESP32 GuideThe ESP32 is a low-cost 3.3 V microcontroller from Espressif with built-in Wi-Fi and Bluetooth, used for IoT devices, smart-home controllers and web dashboards.5 min read · Boards & Microcontrollers

Sources

  • Vishay TSOP38238 data sheet
  • IRremote library documentation (NEC protocol timing)

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerHow an IR remote worksWiringDecoding button codesSending IR codesTroubleshootingTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide4 items · ₹1,918

VS1838B IR Remote Control Receiver – Pack of 2 · HS-S23P 38KHz Infrared Decoding Receiver Module – Digital Output · Adafruit Infrared IR Remote Receiver – STEMMA JST PH 2mm Module · Adafruit Infrared IR Remote Transceiver – STEMMA JST PH 2mm – 940nm Emitter + 38KHz Receiver

Run itChange the inputs and watch the output
Serial monitor115200 baud
 

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question