<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Play with Circuit</title>
    <description>The latest articles on DEV Community by Play with Circuit (@play_withcircuit_241ef87).</description>
    <link>https://dev.to/play_withcircuit_241ef87</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3015801%2Fb43108d4-24c1-491c-9ced-9c27b9020370.jpg</url>
      <title>DEV Community: Play with Circuit</title>
      <link>https://dev.to/play_withcircuit_241ef87</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/play_withcircuit_241ef87"/>
    <language>en</language>
    <item>
      <title>Interface a MicroSD Card Module with Arduino UNO</title>
      <dc:creator>Play with Circuit</dc:creator>
      <pubDate>Sat, 19 Sep 2026 05:30:17 +0000</pubDate>
      <link>https://dev.to/play_withcircuit_241ef87/interface-a-microsd-card-module-with-arduino-uno-big</link>
      <guid>https://dev.to/play_withcircuit_241ef87/interface-a-microsd-card-module-with-arduino-uno-big</guid>
      <description>&lt;p&gt;When an Arduino project needs to store data over a long period, the board's internal memory quickly becomes a limitation. A weather station, for example, may need to record temperature and humidity every few seconds. A soil-monitoring system might need to keep readings for several days.&lt;/p&gt;

&lt;p&gt;A MicroSD card is a simple way to add external storage to such projects. With a small MicroSD card module, an Arduino UNO can read and write files on a memory card using the SPI interface.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll connect a MicroSD card module to an Arduino UNO and use it to access files on the card. An I2C LCD is also used to display information from the card.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Need
&lt;/h2&gt;

&lt;p&gt;For this project, you'll need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arduino UNO R3&lt;/li&gt;
&lt;li&gt;MicroSD card module&lt;/li&gt;
&lt;li&gt;MicroSD card&lt;/li&gt;
&lt;li&gt;16x2 LCD with I2C interface&lt;/li&gt;
&lt;li&gt;Jumper wires&lt;/li&gt;
&lt;li&gt;USB cable for Arduino UNO&lt;/li&gt;
&lt;li&gt;Arduino IDE&lt;/li&gt;
&lt;li&gt;5V power supply, if required&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Understanding the MicroSD Card Module
&lt;/h2&gt;

&lt;p&gt;A typical Arduino MicroSD card module contains more than just the card socket.&lt;/p&gt;

&lt;p&gt;It generally includes a &lt;strong&gt;3.3V voltage regulator&lt;/strong&gt; and a &lt;strong&gt;logic-level conversion circuit&lt;/strong&gt; so that it can be used with 5V Arduino boards.&lt;/p&gt;

&lt;p&gt;The MicroSD card itself operates at approximately 3.3V. The regulator on compatible modules converts the incoming supply to the required voltage for the card.&lt;/p&gt;

&lt;p&gt;The logic-level circuitry is used to translate the SPI signals between the Arduino's 5V logic and the SD card's lower-voltage logic.&lt;/p&gt;

&lt;p&gt;Because different MicroSD modules are available, it's worth checking the schematic or markings of your particular module before applying power.&lt;/p&gt;

&lt;h2&gt;
  
  
  MicroSD Module Pins
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fapu2f1r91zuzerkar21h.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fapu2f1r91zuzerkar21h.PNG" alt=" " width="607" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most of the common SPI-based MicroSD modules provide these pins:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Module Pin&lt;/th&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VCC&lt;/td&gt;
&lt;td&gt;Power supply&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;td&gt;Ground&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MISO&lt;/td&gt;
&lt;td&gt;Data from SD card to Arduino&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MOSI&lt;/td&gt;
&lt;td&gt;Data from Arduino to SD card&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SCK&lt;/td&gt;
&lt;td&gt;SPI clock&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CS&lt;/td&gt;
&lt;td&gt;Chip Select&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The SD card communicates with the Arduino through the &lt;strong&gt;SPI bus&lt;/strong&gt;. On an Arduino UNO, the hardware SPI pins are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;MOSI — D11&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MISO — D12&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SCK — D13&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;strong&gt;CS&lt;/strong&gt; pin can be assigned to a suitable digital pin. In this example, we'll use &lt;strong&gt;D10&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting the MicroSD Module to Arduino UNO
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fca1kr7y5puar4k17wb3p.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fca1kr7y5puar4k17wb3p.webp" alt="wiring diagram" width="641" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Connect the module as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MicroSD Module&lt;/th&gt;
&lt;th&gt;Arduino UNO&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CS&lt;/td&gt;
&lt;td&gt;D10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SCK&lt;/td&gt;
&lt;td&gt;D13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MOSI&lt;/td&gt;
&lt;td&gt;D11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MISO&lt;/td&gt;
&lt;td&gt;D12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VCC&lt;/td&gt;
&lt;td&gt;5V*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;*The 5V connection assumes you are using a MicroSD module specifically designed with the appropriate regulator/level shifting for 5V Arduino boards. Do not connect 5V directly to a bare MicroSD card.&lt;/p&gt;

&lt;p&gt;The SPI connections are straightforward because the Arduino UNO has dedicated hardware SPI pins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding the I2C LCD
&lt;/h2&gt;

&lt;p&gt;The LCD is connected through the Arduino UNO's I2C interface.&lt;br&gt;
For an UNO:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;I2C LCD&lt;/th&gt;
&lt;th&gt;Arduino UNO&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VCC&lt;/td&gt;
&lt;td&gt;5V&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SDA&lt;/td&gt;
&lt;td&gt;A4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SCL&lt;/td&gt;
&lt;td&gt;A5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Many 16x2 I2C LCD modules use &lt;strong&gt;0x27&lt;/strong&gt; as their default address, but this isn't universal. If the LCD doesn't respond, scanning the I2C bus is a good way to find its actual address.&lt;/p&gt;

&lt;p&gt;Also check the address-selection jumpers on your LCD backpack if your particular module provides them.&lt;/p&gt;
&lt;h2&gt;
  
  
  Arduino Libraries
&lt;/h2&gt;

&lt;p&gt;You can use the built-in &lt;strong&gt;SD&lt;/strong&gt; and &lt;strong&gt;SPI&lt;/strong&gt; libraries for the MicroSD card.&lt;/p&gt;

&lt;p&gt;For the LCD, install the &lt;strong&gt;LiquidCrystal_I2C&lt;/strong&gt; library.&lt;/p&gt;

&lt;p&gt;In Arduino IDE:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Library Manager&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Search for &lt;code&gt;LiquidCrystal I2C&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install the library you intend to use.&lt;/li&gt;
&lt;li&gt;The SD and SPI libraries are normally included with the Arduino AVR core.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Using a MicroSD Card for Data Logging
&lt;/h2&gt;

&lt;p&gt;This is where the MicroSD module becomes particularly useful.&lt;/p&gt;

&lt;p&gt;Suppose you're building an environmental monitoring system with a temperature and humidity sensor. Instead of keeping only the latest measurement in RAM, the Arduino can periodically append each measurement to a file.&lt;/p&gt;

&lt;p&gt;A typical workflow would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sensor
   ↓
Arduino UNO
   ↓
SPI
   ↓
MicroSD Module
   ↓
Data File
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The file could contain one measurement per line, making it relatively easy to process later on a computer.&lt;/p&gt;

&lt;p&gt;The same approach can be used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Weather stations&lt;/li&gt;
&lt;li&gt;Soil-moisture monitoring&lt;/li&gt;
&lt;li&gt;Energy monitoring&lt;/li&gt;
&lt;li&gt;GPS data logging&lt;/li&gt;
&lt;li&gt;Industrial sensor logging&lt;/li&gt;
&lt;li&gt;Temperature monitoring&lt;/li&gt;
&lt;li&gt;Motion/event recording&lt;/li&gt;
&lt;li&gt;IoT prototypes with offline data storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A Few Things to Check When the SD Card Doesn't Work
&lt;/h2&gt;

&lt;p&gt;MicroSD modules can sometimes be surprisingly sensitive during initial setup. If the Arduino reports that the card initialization failed, check these points before changing the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the CS pin first.&lt;/strong&gt; The pin defined in the program must match the physical connection. In this example, it is D10.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the SPI wiring.&lt;/strong&gt; On an Arduino UNO, MOSI is D11, MISO is D12 and SCK is D13.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the card format.&lt;/strong&gt; An incorrectly formatted or incompatible card can prevent initialization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try another MicroSD card.&lt;/strong&gt; Some cards work more reliably than others with older Arduino libraries and hardware.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the module's voltage arrangement.&lt;/strong&gt; Not every MicroSD breakout is designed to accept 5V directly. Verify that your particular board includes the required regulator and level shifting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep the SPI wires short.&lt;/strong&gt; Long jumper wires can introduce communication problems, especially on breadboards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Adding a MicroSD card gives an Arduino project a practical way to store much more data than the microcontroller's internal memory can hold.&lt;/p&gt;

&lt;p&gt;The SPI interface keeps the wiring simple, and the Arduino SD library provides the basic functions needed to initialize the card, create files, read data, and write new records.&lt;/p&gt;

&lt;p&gt;Once the basic interface is working, you can extend the project into a complete data logger by connecting sensors and periodically saving their readings to the SD card.&lt;/p&gt;

&lt;p&gt;If you want to follow the complete project and source-code implementation, you can find the detailed tutorial on &lt;strong&gt;Play with Circuit&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>arduino</category>
      <category>electronics</category>
    </item>
    <item>
      <title>How nRF24L01+ Works and How to Interface It with Arduino</title>
      <dc:creator>Play with Circuit</dc:creator>
      <pubDate>Mon, 07 Sep 2026 09:13:20 +0000</pubDate>
      <link>https://dev.to/play_withcircuit_241ef87/how-nrf24l01-works-and-how-to-interface-it-with-arduino-19pd</link>
      <guid>https://dev.to/play_withcircuit_241ef87/how-nrf24l01-works-and-how-to-interface-it-with-arduino-19pd</guid>
      <description>&lt;p&gt;Wireless communication between microcontrollers is useful in many projects where running physical wires between devices is inconvenient. For example, the same approach can be used for remote sensing, wireless control, home automation, and distributed sensor systems.&lt;/p&gt;

&lt;p&gt;For Arduino-based projects, the nRF24L01+ transceiver module is a practical option for adding wireless communication. It operates in the 2.4 GHz ISM band and supports both transmitting and receiving data, which makes it possible to build simple two-way communication systems as well as networks with multiple transmitters.&lt;/p&gt;

&lt;p&gt;In this project, I am using two Arduino boards with nRF24L01+ modules to demonstrate a basic communication between an initiator and a responder. The initiator sends a message, the responder receives it and sends a reply, and the communication status is displayed on an I2C LCD connected to the initiator.&lt;/p&gt;

&lt;p&gt;I will also cover how the nRF24L01+ Multiceiver feature can be used to communicate with multiple transmitters through a single receiver.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the nRF24L01+?
&lt;/h2&gt;

&lt;p&gt;The nRF24L01+ is a low-cost, single-chip wireless transceiver module capable of both transmitting and receiving data. The module operates between 1.9 V and 3.6 V and works best with a 3.3 V supply.&lt;/p&gt;

&lt;p&gt;It is a relatively low-power device. During transmission it consumes around 11.3 mA, while receive current is around 13.5 mA. It can also enter standby and power-down modes, where its current consumption drops considerably. This makes it useful for battery-powered wireless applications.&lt;/p&gt;

&lt;p&gt;The standard nRF24L01+ module uses a PCB trace antenna and can provide a communication range of around 50–100 meters in open space. If a longer range is required, versions with a PA (Power Amplifier), LNA (Low-Noise Amplifier), and external antenna are available. Depending on the environment and configuration, these versions can provide communication distances of up to 1000 meters in open space.&lt;/p&gt;

&lt;p&gt;The nRF24L01+ supports data rates of 250 Kbps, 1 Mbps, and 2 Mbps. Using a lower data rate such as 250 Kbps can improve the effective communication range because the lower rate is less sensitive to noise.&lt;/p&gt;

&lt;h3&gt;
  
  
  Technical Specifications
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Specification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frequency range&lt;/td&gt;
&lt;td&gt;2.4 – 2.5 GHz ISM band&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data rates&lt;/td&gt;
&lt;td&gt;250 Kbps / 1 Mbps / 2 Mbps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maximum output power&lt;/td&gt;
&lt;td&gt;0 dBm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operating voltage&lt;/td&gt;
&lt;td&gt;1.9 – 3.6 V&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maximum operating current&lt;/td&gt;
&lt;td&gt;13.5 mA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standby current&lt;/td&gt;
&lt;td&gt;26 µA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logic inputs&lt;/td&gt;
&lt;td&gt;5 V tolerant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Communication range&lt;/td&gt;
&lt;td&gt;100 m (open space)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SPI interface speed&lt;/td&gt;
&lt;td&gt;0–8 Mbps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For the complete electrical specifications, refer to the nRF24L01+ product datasheet.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does the nRF24L01+ Communicate?
&lt;/h2&gt;

&lt;p&gt;The nRF24L01+ operates in the 2.4 GHz ISM band, from 2.400 GHz to 2.525 GHz. This frequency range is divided into channels. At a data rate of 1 Mbps, the channel spacing is 1 MHz, giving 126 available channels from channel 0 to channel 125.&lt;/p&gt;

&lt;p&gt;For two nRF24L01+ modules to communicate, both modules need to be configured to use the same RF channel. For example, if the transmitter is configured for 2500 MHz, corresponding to channel 100, the receiver must use the same frequency.&lt;/p&gt;

&lt;p&gt;This channel-based arrangement also makes it possible to operate multiple groups of nRF24L01+ devices in the same area while reducing interference by assigning different groups to different channels.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiceiver
&lt;/h3&gt;

&lt;p&gt;One of the useful features of the nRF24L01+ is its &lt;strong&gt;Multiceiver&lt;/strong&gt; capability. A single receiver can communicate with up to six different transmitters on the same RF channel.&lt;/p&gt;

&lt;p&gt;The receiver uses six individual data pipes, each with its own address. Although six pipes can be configured, only one data pipe can receive a packet at any particular moment.&lt;/p&gt;

&lt;p&gt;This feature is particularly useful when several Arduino-based nodes need to send information to one central Arduino.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enhanced ShockBurst
&lt;/h3&gt;

&lt;p&gt;The nRF24L01+ also has hardware support for the &lt;strong&gt;Enhanced ShockBurst&lt;/strong&gt; communication protocol. A number of tasks that would otherwise have to be handled by the microcontroller are managed internally by the RF module.&lt;/p&gt;

&lt;p&gt;When transmitting, the module handles packet formation, including the preamble, address, and CRC. When a packet reaches the receiver, the module checks whether the packet is valid before placing the received data into its Rx FIFO.&lt;/p&gt;

&lt;p&gt;The module can also automatically send an acknowledgment to the transmitter after successfully receiving a valid packet. If the transmitter does not receive the expected acknowledgment, it can automatically retransmit the packet.&lt;/p&gt;

&lt;p&gt;These features make communication more reliable and reduce the amount of communication-handling code required on the Arduino.&lt;/p&gt;

&lt;h2&gt;
  
  
  nRF24L01+ Module Variants
&lt;/h2&gt;

&lt;p&gt;The nRF24L01+ is available in several physical configurations. The core nRF24L01+ chip is essentially the same, but the antenna arrangement and additional RF circuitry can differ.&lt;/p&gt;

&lt;h3&gt;
  
  
  nRF24L01+ with PCB Antenna
&lt;/h3&gt;

&lt;p&gt;This is the commonly available compact version of the module. It uses a PCB trace antenna and is suitable for short- to medium-range wireless communication.&lt;/p&gt;

&lt;p&gt;Its typical range can reach around 100 meters in open space, although the actual range indoors can be considerably lower because walls, furniture, and other objects affect the RF signal.&lt;/p&gt;

&lt;h3&gt;
  
  
  nRF24L01+ with SMA Connector
&lt;/h3&gt;

&lt;p&gt;Another version provides an SMA connector for connecting an external antenna. The external antenna can provide better signal performance and can improve communication range and stability, particularly when there are obstacles between the two devices.&lt;/p&gt;

&lt;h3&gt;
  
  
  nRF24L01+ PA + LNA Version
&lt;/h3&gt;

&lt;p&gt;For applications requiring greater range, the PA + LNA version combines an external antenna with additional RF amplification.&lt;/p&gt;

&lt;p&gt;This version includes an RFX2401C range extender that provides Power Amplifier and Low-Noise Amplifier functionality along with transmit/receive switching. With the additional amplification and external antenna, communication distances of up to 1000 meters in open space are possible under suitable conditions.&lt;/p&gt;

&lt;p&gt;The PA + LNA module remains compatible with other nRF24L01+ variants, so it can generally be substituted for the standard module in the same type of Arduino project.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Do PA and LNA Do?
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Power Amplifier (PA)&lt;/strong&gt; increases the strength of the signal being transmitted. This allows the RF signal to travel a greater distance.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Low-Noise Amplifier (LNA)&lt;/strong&gt; works on the receiving side. Signals arriving from a distant transmitter can be very weak, so the LNA amplifies these incoming signals while keeping additional noise low.&lt;/p&gt;

&lt;p&gt;Using both PA and LNA therefore helps the module transmit over longer distances and receive weaker signals more effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  nRF24L01+ Pinout
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6uf06y1pskzeh8lcyvkm.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6uf06y1pskzeh8lcyvkm.webp" alt=" " width="658" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The nRF24L01+ has eight pins: GND, VCC, CE, CSN, SCK, MOSI, MISO, and IRQ.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GND&lt;/strong&gt; is the ground connection. On the module, this pin is marked with a square pad, which can help identify the pin orientation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VCC&lt;/strong&gt; is the power supply pin. The module operates from 1.9 V to 3.6 V and works best at 3.3 V.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CE (Chip Enable)&lt;/strong&gt; is an active-high control pin used to switch the module between active and standby states. When CE is HIGH, the module can operate in transmit or receive mode according to its configuration. When CE is LOW, the module remains in standby mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSN (Chip Select Not)&lt;/strong&gt; is the active-low SPI chip-select pin. It is normally HIGH and is pulled LOW when the Arduino needs to communicate with the nRF24L01+ over SPI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SCK (Serial Clock)&lt;/strong&gt; receives the SPI clock signal generated by the Arduino.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MOSI (Master Out Slave In)&lt;/strong&gt; carries data from the Arduino to the nRF24L01+.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MISO (Master In Slave Out)&lt;/strong&gt; carries data from the nRF24L01+ back to the Arduino.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IRQ (Interrupt Request)&lt;/strong&gt; is an optional active-low interrupt pin. It can be used by the module to notify the microcontroller about events such as received data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two-Way Communication Between Two nRF24L01+ Modules
&lt;/h2&gt;

&lt;p&gt;To test the wireless link, I used two Arduino boards, each connected to an nRF24L01+ module. One Arduino acts as the &lt;strong&gt;initiator&lt;/strong&gt;, while the other works as the &lt;strong&gt;responder&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The initiator sends a message through its nRF24L01+ module. When the responder receives the message, it sends a response back to the initiator. An I2C LCD connected to the initiator displays the communication status.&lt;/p&gt;

&lt;p&gt;This provides a simple way to verify that the two RF modules are correctly configured and that data is being exchanged in both directions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hardware Requirements
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;Remarks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Arduino UNO R3&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Revision R3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LCD 16x2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;I2C support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jumper Wires&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;For Arduino and LCD connections&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USB Cable Type A to B&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;For programming Arduino UNO&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12V Supply Adapter&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;For providing power to Arduino&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;nRF24L01+ Modules&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;For interfacing with Arduino&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Software Requirements
&lt;/h3&gt;

&lt;p&gt;The project uses the Arduino IDE for programming. The required software setup is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arduino IDE version 2.3.4 or above&lt;/li&gt;
&lt;li&gt;LiquidCrystal_I2C library by Frank de Brabander, version 1.1.2&lt;/li&gt;
&lt;li&gt;RF24 library by TMRh20, version 1.5.0&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wiring Connections
&lt;/h2&gt;

&lt;p&gt;There are two wiring setups in this project: one for the &lt;strong&gt;initiator&lt;/strong&gt; and another for the &lt;strong&gt;responder&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The nRF24L01+ connections are the same on both Arduino boards. The main difference is that the initiator also has an I2C LCD connected to it, while the responder sends its received data through the serial port.&lt;/p&gt;

&lt;h3&gt;
  
  
  Initiator Wiring
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc77ptmv4zzprh1p3lbc3.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc77ptmv4zzprh1p3lbc3.webp" alt=" " width="634" height="540"&gt;&lt;/a&gt;&lt;br&gt;
The nRF24L01+ communicates with the Arduino through the SPI bus using the MISO, MOSI, SCK, and CSN pins. In addition to these connections, CE, VCC, and GND are also connected. The IRQ pin is left unused.&lt;/p&gt;

&lt;p&gt;The connections between Arduino Uno and nRF Module are as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;nRF Module&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Arduino Side Pin&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GND (Pin 1)&lt;/td&gt;
&lt;td&gt;GND pin of Arduino&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VCC (pin 2)&lt;/td&gt;
&lt;td&gt;3.3V pin of Arduino&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CE (Pin 3)&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CSN (Pin 4)&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SCK (Pin 5)&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MOSI (Pin 6)&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MISO (Pin 7)&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IRQ (Pin 8)&lt;/td&gt;
&lt;td&gt;Not connected&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When using a base for the nRF module that internally converts 5 V to 3.3 V, the power connection of the base can be connected to the 5 V pin of the Arduino.&lt;/p&gt;

&lt;p&gt;If the nRF24L01+ module is being used without such a base, its VCC should instead be connected directly to the Arduino's 3.3 V pin, as shown in the wiring setup.&lt;/p&gt;

&lt;p&gt;The Arduino uses 5 V logic while the nRF24L01+ operates at 3.3 V. Although the 5 V SPI signals do not necessarily cause immediate failure of the module, exposing the module to these voltage levels can affect its long-term reliability. A voltage level shifter is therefore recommended for industrial or long-term applications. For simplicity, a level shifter is not included in this project.&lt;/p&gt;

&lt;h3&gt;
  
  
  I2C LCD Connections
&lt;/h3&gt;

&lt;p&gt;The I2C LCD requires only four connections to the Arduino: VCC, GND, SCL, and SDA.&lt;/p&gt;

&lt;p&gt;Connect the VCC and GND pins of the I2C LCD to the corresponding VCC and GND pins of the Arduino. The SCL and SDA pins connect to the Arduino's SCL and SDA pins.&lt;/p&gt;

&lt;p&gt;On the Arduino Uno, these correspond to the &lt;strong&gt;A5 and A4 analog pins&lt;/strong&gt; respectively. The SCL and SDA header pins are also connected internally to A5 and A4.&lt;/p&gt;

&lt;p&gt;One important detail is the I2C address of the LCD. Make sure the &lt;strong&gt;A0, A1, and A2 address jumpers are not shorted&lt;/strong&gt;. In this project, the code uses the I2C address &lt;strong&gt;0x27&lt;/strong&gt;, which is obtained when these address jumpers are left open.&lt;/p&gt;

&lt;h3&gt;
  
  
  Responder Wiring
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8jxn3j6e4wgn7nbo4qrv.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8jxn3j6e4wgn7nbo4qrv.webp" alt=" " width="658" height="530"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The responder uses the same nRF24L01+ to Arduino connections as the initiator. Since there is no I2C LCD on this Arduino, the responder has fewer connections.&lt;/p&gt;

&lt;p&gt;The nRF24L01+ is connected through the same SPI pins, with CE connected to Arduino pin 9, CSN to pin 10, SCK to pin 13, MOSI to pin 11, and MISO to pin 12. VCC is connected to 3.3 V and GND to Arduino GND, while IRQ remains unconnected.&lt;/p&gt;

&lt;p&gt;The responder can then receive the wireless message from the initiator and send its response through the serial interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving from Two Devices to Multiple Transmitters
&lt;/h2&gt;

&lt;p&gt;Once the basic two-way communication is working, the same nRF24L01+ platform can be extended to a setup where several transmitter nodes communicate with a single receiver.&lt;/p&gt;

&lt;p&gt;This is where the &lt;strong&gt;Multiceiver&lt;/strong&gt; feature becomes useful. Instead of having one dedicated transmitter and one receiver, multiple nRF24L01+ transmitters can send information to a central receiver using separate data-pipe addresses on the same RF channel.&lt;/p&gt;

&lt;p&gt;If you want to build this configuration, the complete wiring, transmitter and receiver code, and the implementation details are covered in the &lt;strong&gt;Play with Circuit&lt;/strong&gt; project:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://playwithcircuit.com/nrf24l01-module-arduino-wireless-communication-tutorial/" rel="noopener noreferrer"&gt;Communication between Multiple nRF24L01+ Transmitters to a Single Receiver&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The multiple-transmitter setup is a useful next step when moving from a simple point-to-point wireless link toward a small distributed Arduino network.&lt;/p&gt;

</description>
      <category>arduino</category>
      <category>wireless</category>
      <category>communication</category>
    </item>
    <item>
      <title>How to Interface the Reyax RYLR999 LoRa Module with Arduino</title>
      <dc:creator>Play with Circuit</dc:creator>
      <pubDate>Tue, 25 Aug 2026 08:34:01 +0000</pubDate>
      <link>https://dev.to/play_withcircuit_241ef87/how-to-interface-the-reyax-rylr999-lora-module-with-arduino-k21</link>
      <guid>https://dev.to/play_withcircuit_241ef87/how-to-interface-the-reyax-rylr999-lora-module-with-arduino-k21</guid>
      <description>&lt;p&gt;Long-range wireless communication is an important part of modern IoT systems, particularly when connected devices need to exchange small amounts of data over large distances while operating with limited power. Technologies such as Wi-Fi and Bluetooth are convenient for short-range communication, while cellular networks provide wide coverage but generally involve higher power consumption and operating costs.&lt;/p&gt;

&lt;p&gt;LoRa is designed to address this gap. It provides long-distance wireless communication with relatively low power requirements, making it well suited for applications such as environmental monitoring, agriculture, industrial sensing, remote control, and other IoT projects.&lt;/p&gt;

&lt;p&gt;In this project, we explore the Reyax RYLR999 LoRa module and its interface with an Arduino UNO. The setup demonstrates a simple two-way LoRa communication link in which one Arduino acts as the initiator and another works as the responder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;The basic idea is to establish point-to-point communication between two RYLR999 modules connected to separate Arduino UNO boards.&lt;/p&gt;

&lt;p&gt;The first Arduino works as the &lt;strong&gt;initiator&lt;/strong&gt;. It periodically sends the message &lt;strong&gt;“Are you there?”&lt;/strong&gt; through its RYLR999 module. The second Arduino acts as the &lt;strong&gt;responder&lt;/strong&gt;, listening for the incoming LoRa message and returning &lt;strong&gt;“Yes”&lt;/strong&gt; when the request is received.&lt;/p&gt;

&lt;p&gt;This simple exchange provides a practical way to understand how the RYLR999 communicates with a microcontroller through UART and how AT commands can be used to control LoRa transmission and reception.&lt;/p&gt;

&lt;p&gt;The project also demonstrates the difference between the two sides of a wireless communication link: one device generates and transmits the request, while the other receives the request and sends a response.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is LoRa?
&lt;/h2&gt;

&lt;p&gt;LoRa stands for &lt;strong&gt;Long Range&lt;/strong&gt; and is a wireless communication technology developed by Semtech. It is intended primarily for applications where devices need to transmit relatively small amounts of information over considerably longer distances than conventional short-range wireless technologies.&lt;/p&gt;

&lt;p&gt;LoRa is particularly useful for IoT devices because many IoT nodes send only small packets of information.&lt;/p&gt;

&lt;p&gt;Depending on environmental and radio conditions, LoRa communication can typically reach approximately &lt;strong&gt;15 to 20 km in open environments&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;LoRa commonly operates in license-free ISM frequency bands such as &lt;strong&gt;433 MHz, 868 MHz, and 915 MHz&lt;/strong&gt;. It can also operate in the &lt;strong&gt;2.4 GHz&lt;/strong&gt; band for applications requiring higher data rates, although communication range is generally reduced at this frequency.&lt;/p&gt;

&lt;p&gt;An important characteristic of LoRa is the balance it provides between communication range, data rate, and power consumption. It is therefore better suited to small, infrequent data packets than to applications that continuously transfer large amounts of information.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does LoRa Technology Work?
&lt;/h2&gt;

&lt;p&gt;LoRa operates at the physical layer of wireless communication and defines how information is converted into a radio signal for transmission.&lt;/p&gt;

&lt;p&gt;When a microcontroller needs to send information, the digital data is passed to the LoRa transceiver. The radio then uses &lt;strong&gt;Chirp Spread Spectrum (CSS)&lt;/strong&gt; modulation to encode the information into frequency-swept chirp signals.&lt;/p&gt;

&lt;p&gt;These chirps spread the transmitted information across a wider bandwidth. This improves receiver sensitivity and helps the system operate in the presence of noise and interference.&lt;/p&gt;

&lt;p&gt;One of the major advantages of this approach is that a LoRa receiver can detect relatively weak signals. This contributes to the technology's long communication range while allowing the radio to operate at comparatively low power.&lt;/p&gt;

&lt;p&gt;At the receiving end, the LoRa transceiver demodulates the incoming chirp signal and converts it back into digital information. The resulting data is then made available to the connected microcontroller through the module's UART interface.&lt;/p&gt;

&lt;p&gt;LoRa generally works with &lt;strong&gt;low data rates&lt;/strong&gt; and is intended for small packets rather than continuous high-bandwidth communication. This makes it practical for battery-operated devices that can remain in a low-power state between transmissions.&lt;/p&gt;

&lt;p&gt;It is important to distinguish &lt;strong&gt;LoRa&lt;/strong&gt; from &lt;strong&gt;LoRaWAN&lt;/strong&gt;. LoRa describes the radio communication technology at the physical layer, while LoRaWAN is a higher-level networking protocol designed for connecting LoRa devices to wider networks and infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where LoRa Is Used
&lt;/h3&gt;

&lt;p&gt;LoRa is a good choice when the application needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Long-distance communication&lt;/li&gt;
&lt;li&gt;Low power consumption&lt;/li&gt;
&lt;li&gt;Small amounts of transmitted data&lt;/li&gt;
&lt;li&gt;Battery-operated sensor nodes&lt;/li&gt;
&lt;li&gt;Wireless communication in areas without conventional network infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is not intended for applications such as video streaming, audio transmission, or transferring large files because its data rate is comparatively low.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to the RYLR999 Module
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;RYLR999 Lite&lt;/strong&gt; is a long-range wireless communication module developed by REYAX Technology. The module combines &lt;strong&gt;868/915 MHz LoRa communication&lt;/strong&gt; with &lt;strong&gt;2.4 GHz Bluetooth Low Energy (BLE)&lt;/strong&gt; capabilities in a compact transceiver.&lt;/p&gt;

&lt;p&gt;A notable feature of the RYLR999 is that it provides separate UART interfaces for its BLE and LoRa functions. This allows the two wireless communication paths to be handled independently.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;BLE UART interface&lt;/strong&gt; is used for exchanging information with devices such as smartphones, BLE-enabled systems, or compatible microcontrollers. The &lt;strong&gt;LoRa UART interface&lt;/strong&gt;, meanwhile, handles LoRa-related data transmission and reception.&lt;/p&gt;

&lt;p&gt;The module can be configured through &lt;strong&gt;AT commands&lt;/strong&gt;. Parameters such as LoRa addresses, network IDs, operating frequency, and modulation settings can be configured according to the requirements of the application.&lt;/p&gt;

&lt;p&gt;When a transmission command is issued, the module processes the supplied data and sends it wirelessly using LoRa's CSS-based modulation. Another compatible RYLR999 module can receive the transmitted packet and make the received information available through its UART interface.&lt;/p&gt;

&lt;p&gt;Another useful capability of the RYLR999 is its potential to operate as a &lt;strong&gt;BLE-to-LoRa bridge&lt;/strong&gt;. In this type of application, a nearby BLE device can communicate with the module, while the RYLR999 forwards the information through a long-range LoRa connection. This effectively extends the communication reach of a device that would normally be restricted to short-range BLE communication.&lt;/p&gt;

&lt;h2&gt;
  
  
  RYLR999 Pinout
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1pwomsgy1kze5pvewzgl.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1pwomsgy1kze5pvewzgl.PNG" alt=" " width="460" height="540"&gt;&lt;/a&gt;&lt;br&gt;
Understanding the module's pin functions is important because the RYLR999 uses separate UART connections for its BLE and LoRa interfaces.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;VDD (Pin 1):&lt;/strong&gt; This is the module's power supply pin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RST (Pin 2):&lt;/strong&gt; This is the reset input.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TXD_BLE (Pin 3):&lt;/strong&gt; This pin functions as the BLE UART transmit output. It is particularly relevant when the module is being used for BLE-to-LoRa bridging.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RXD_LoRa (Pin 4):&lt;/strong&gt; This is the receiving input of the LoRa UART interface. AT commands and LoRa-related instructions from a microcontroller, PC terminal, or BLE subsystem are supplied through this pin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TXD_LoRa (Pin 5):&lt;/strong&gt; This is the transmit output of the LoRa UART interface. Received LoRa data and status information are provided through this pin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RXD_BLE (Pin 6):&lt;/strong&gt; This pin receives data intended for the BLE subsystem. Commands or information that need to be sent to the BLE section from a microcontroller or PC are supplied through this pin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GND (Pin 7):&lt;/strong&gt; This is the ground connection.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Interfacing RYLR999 with Arduino UNO
&lt;/h2&gt;

&lt;p&gt;The RYLR999 can be connected to an Arduino UNO to create a simple point-to-point LoRa communication system. In the proposed arrangement, two Arduino UNO boards are used, with each board connected to one RYLR999 module.&lt;/p&gt;

&lt;p&gt;The initiator Arduino is responsible for generating the communication request and sending it through its LoRa module. The responder Arduino remains ready to receive the message and sends a response when the expected request arrives.&lt;/p&gt;

&lt;p&gt;The RYLR999 communicates with the Arduino through its LoRa UART interface. Since the RYLR999's digital I/O operates at 3.3 V logic levels, the UART connection requires appropriate voltage-level conversion when interfacing it with the Arduino UNO's 5 V logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Initiator Wiring Concept
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ck215ustx4vbnakqmvk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ck215ustx4vbnakqmvk.PNG" alt=" " width="748" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the initiator side, the Arduino UNO sends LoRa commands to the RYLR999 and can display the communication status on a 16×2 I2C LCD.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;VDD pin of the RYLR999 is connected to the 5V output of the Arduino UNO&lt;/strong&gt;, while the &lt;strong&gt;GND pin is connected to the Arduino GND&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For UART communication, the &lt;strong&gt;TXD_LoRa pin of the RYLR999 is connected to the LV1 pin of the voltage shifter&lt;/strong&gt;, and the corresponding &lt;strong&gt;HV1 output is connected to the Arduino Rx pin&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the opposite direction, the &lt;strong&gt;TX pin of the Arduino is connected to the HV2 pin of the voltage shifter&lt;/strong&gt;, while the corresponding &lt;strong&gt;LV2 output is connected to the RXD_LoRa pin of the RYLR999&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The voltage shifter also requires its power-side connections. The &lt;strong&gt;5V pin of the Arduino is connected to the HV pin of the voltage shifter&lt;/strong&gt;, while the &lt;strong&gt;3.3V pin of the Arduino is connected to the LV pin&lt;/strong&gt;. These connections allow the voltage-level converter to operate correctly.&lt;/p&gt;

&lt;p&gt;The Arduino UNO and RYLR999 LoRa UART connections can therefore be summarized as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Arduino UNO 5V → RYLR999 VDD&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arduino UNO GND → RYLR999 GND&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arduino UNO Rx → RYLR999 TXD_LoRa through the voltage shifter&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arduino UNO Tx → RYLR999 RXD_LoRa through the voltage shifter&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  I2C LCD Connection
&lt;/h3&gt;

&lt;p&gt;The initiator setup can also use a 16×2 I2C LCD to display communication information.&lt;/p&gt;

&lt;p&gt;The LCD &lt;strong&gt;VCC and GND&lt;/strong&gt; connections are connected to the corresponding Arduino power and ground pins. The LCD's &lt;strong&gt;SCL and SDA&lt;/strong&gt; lines are connected to the Arduino's I2C pins.&lt;/p&gt;

&lt;p&gt;On the Arduino UNO, the I2C lines correspond to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SCL → A5&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SDA → A4&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The LCD address configuration is also relevant. When using the address &lt;strong&gt;0x27&lt;/strong&gt;, the &lt;strong&gt;A0, A1, and A2 address jumpers should not be shorted&lt;/strong&gt;. These jumpers influence the I2C address of the display, so their configuration should match the address used by the software.&lt;/p&gt;

&lt;h2&gt;
  
  
  Responder Wiring Concept
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj56lhnd0vm01tyoff2r6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj56lhnd0vm01tyoff2r6.PNG" alt=" " width="716" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The responder side follows the same basic RYLR999-to-Arduino UART arrangement but does not require the LCD.&lt;/p&gt;

&lt;p&gt;The responder Arduino continuously monitors the LoRa UART interface for incoming communication from the initiator. When the expected request is received, the Arduino processes it and sends the appropriate response through its RYLR999 module.&lt;/p&gt;

&lt;p&gt;The main wiring between the Arduino UNO and RYLR999 therefore remains the same:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Arduino UNO 5V → RYLR999 VDD&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arduino UNO GND → RYLR999 GND&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arduino UNO Rx → RYLR999 TXD_LoRa through the voltage shifter&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arduino UNO Tx → RYLR999 RXD_LoRa through the voltage shifter&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The primary difference between the two configurations is that the initiator includes the I2C LCD for displaying communication information, whereas the responder operates without the display.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Communication Flow
&lt;/h2&gt;

&lt;p&gt;The complete communication sequence can be understood as a simple request-and-response cycle.&lt;/p&gt;

&lt;p&gt;First, the initiator Arduino sends an AT command to its RYLR999 module instructing it to transmit the required message. The module converts the data into a LoRa radio signal and broadcasts it to the receiving RYLR999.&lt;/p&gt;

&lt;p&gt;The responder module receives the LoRa packet and forwards the resulting data to its Arduino through the LoRa UART interface.&lt;/p&gt;

&lt;p&gt;After identifying the incoming request, the responder Arduino instructs its RYLR999 to transmit a reply. The second module then sends the response wirelessly back to the initiator.&lt;/p&gt;

&lt;p&gt;The initiator's RYLR999 receives the response and makes the received information available to the Arduino through TXD_LoRa. This completes the two-way communication cycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important Considerations
&lt;/h2&gt;

&lt;p&gt;When working with the RYLR999, the power supply and logic-level requirements should be considered carefully. Although the module requires a 5 V supply within the specified range, its digital I/O uses &lt;strong&gt;3.3 V logic levels&lt;/strong&gt;. Appropriate voltage-level conversion should therefore be used for UART communication with the Arduino UNO.&lt;/p&gt;

&lt;p&gt;The RYLR999 can operate at relatively high LoRa transmit power, with the specified maximum output reaching &lt;strong&gt;+30 dBm (1 Watt)&lt;/strong&gt;. The antenna and RF implementation should therefore follow the module manufacturer's recommendations.&lt;/p&gt;

&lt;p&gt;LoRa's long range should also not be interpreted as unlimited bandwidth. The technology is optimized for small data packets and long-distance communication rather than high-speed data transfer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The RYLR999 provides a practical way to add long-range wireless communication to Arduino-based projects. Its LoRa interface allows small packets of information to travel significantly farther than conventional short-range wireless technologies, while its BLE functionality adds another communication option within the same module.&lt;/p&gt;

&lt;p&gt;By connecting two RYLR999 modules to separate Arduino UNO boards, it is possible to create a straightforward point-to-point communication system. The initiator can send a request such as &lt;strong&gt;“Are you there?”&lt;/strong&gt;, while the responder can return &lt;strong&gt;“Yes”&lt;/strong&gt;, demonstrating the basic principles of LoRa data transmission and reception.&lt;/p&gt;

&lt;p&gt;The module's UART interface, AT-command configuration, long-range capability, and BLE-to-LoRa functionality make the RYLR999 useful for a variety of IoT, sensor, automation, and remote-monitoring applications where reliable long-distance communication is required without depending on conventional Wi-Fi or cellular connectivity.&lt;/p&gt;

&lt;p&gt;For source code Visit: Play with Circuit(playwithcircuit.com)&lt;/p&gt;

</description>
      <category>arduino</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Use the SH-C30L USB-to-CAN Adapter with Arduino UNO and MCP2515</title>
      <dc:creator>Play with Circuit</dc:creator>
      <pubDate>Tue, 18 Aug 2026 06:39:35 +0000</pubDate>
      <link>https://dev.to/play_withcircuit_241ef87/how-to-use-the-sh-c30l-usb-to-can-adapter-with-arduino-uno-and-mcp2515-p8n</link>
      <guid>https://dev.to/play_withcircuit_241ef87/how-to-use-the-sh-c30l-usb-to-can-adapter-with-arduino-uno-and-mcp2515-p8n</guid>
      <description>&lt;p&gt;Controller Area Network (CAN) is one of those technologies that quietly powers a huge number of embedded systems. It is commonly found in cars, EVs, industrial controllers, robotics, and other distributed systems where multiple devices need to exchange data reliably over a shared bus.&lt;/p&gt;

&lt;p&gt;For development and debugging, it is useful to connect that CAN network to a computer. The problem is that a standard computer communicates through USB, while CAN uses a dedicated differential bus. A USB-to-CAN interface solves this problem by translating between the two.&lt;/p&gt;

&lt;p&gt;In this project, we will explore the &lt;strong&gt;DSD TECH SH-C30L USB-to-CAN adapter&lt;/strong&gt;, learn how its different firmware modes work, connect it to a PC, and then use an &lt;strong&gt;Arduino UNO with an MCP2515 CAN module&lt;/strong&gt; to create a simple bidirectional CAN communication setup.&lt;/p&gt;

&lt;p&gt;The goal is not just to make the hardware work, but also to understand what happens between the Arduino, CAN bus, USB adapter, and computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  SH-C30L USB-to-CAN Adapter Overview
&lt;/h2&gt;

&lt;p&gt;The SH-C30L is a compact USB-to-CAN interface designed to connect a computer directly to a CAN network. It is based on an STM32F072C8T6 microcontroller, which contains an integrated CAN controller. This allows the adapter to handle CAN protocol processing without requiring a separate external CAN controller.&lt;/p&gt;

&lt;p&gt;The microcontroller communicates with the computer through USB, while a dedicated CAN transceiver handles the physical CAN interface. The transceiver converts the controller's logic-level signals into the differential &lt;strong&gt;CAN_H&lt;/strong&gt; and &lt;strong&gt;CAN_L&lt;/strong&gt; signals used on a CAN network.&lt;/p&gt;

&lt;p&gt;One of the interesting aspects of the SH-C30L is its firmware flexibility. The adapter can work with &lt;strong&gt;Candlelight firmware&lt;/strong&gt;, which allows it to operate with Linux SocketCAN and compatible CAN applications, or with &lt;strong&gt;SLCAN firmware&lt;/strong&gt;, where it behaves more like a serial CAN interface. This makes the same hardware useful with different operating systems and software environments.&lt;/p&gt;

&lt;p&gt;The adapter supports both CAN 2.0A and CAN 2.0B frames, with CAN speeds of up to 1 Mbps. It also includes a switchable 120Ω termination resistor and a boot switch for entering firmware-update mode.&lt;/p&gt;

&lt;p&gt;For a small development setup, these features make the SH-C30L a useful alternative to more expensive professional CAN interfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Need a Driver?
&lt;/h2&gt;

&lt;p&gt;When you plug a USB-to-CAN adapter into a computer, the operating system needs to know how to communicate with the device.&lt;/p&gt;

&lt;p&gt;On modern Windows systems, the SH-C30L can generally be detected using the operating system's built-in USB support, depending on the firmware installed. Linux provides even stronger native CAN support through SocketCAN.&lt;/p&gt;

&lt;p&gt;If the adapter appears as an unknown USB device, a driver may need to be installed manually. Therefore, the first troubleshooting step should always be checking &lt;strong&gt;Device Manager on Windows&lt;/strong&gt; or the relevant USB/CAN interfaces on Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Software You Can Use
&lt;/h2&gt;

&lt;p&gt;The software required depends on the firmware and operating system.&lt;/p&gt;

&lt;p&gt;On Linux, &lt;strong&gt;SocketCAN&lt;/strong&gt; is particularly useful. The &lt;code&gt;can-utils&lt;/code&gt; package provides utilities such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;candump&lt;/code&gt; for monitoring CAN traffic&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cansend&lt;/code&gt; for transmitting CAN frames&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cansniffer&lt;/code&gt; for observing changing CAN data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;canbusload&lt;/code&gt; for checking bus utilization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Windows, &lt;strong&gt;Cangaroo&lt;/strong&gt; provides a graphical interface for monitoring and transmitting CAN messages. It can also work with DBC files for decoding signals.&lt;/p&gt;

&lt;p&gt;For custom applications, Python is another useful option. The &lt;code&gt;python-can&lt;/code&gt; library provides an interface for sending and receiving CAN messages from Python programs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the SH-C30L with Linux and SocketCAN
&lt;/h2&gt;

&lt;p&gt;Linux is particularly convenient for CAN development because CAN support is integrated into the operating system through SocketCAN.&lt;/p&gt;

&lt;p&gt;When the SH-C30L is running Candlelight firmware, it can appear as a native CAN interface such as &lt;code&gt;can0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With SLCAN firmware, the setup is slightly different because the adapter is exposed through a serial interface and tools such as &lt;code&gt;slcand&lt;/code&gt; can be used to create a CAN network interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the SH-C30L with Python
&lt;/h2&gt;

&lt;p&gt;Python is useful when CAN communication needs to become part of a larger application.&lt;/p&gt;

&lt;p&gt;Instead of manually watching frames in a CAN analyzer, you can write a program that records messages, checks specific CAN IDs, generates test traffic, or communicates with another application.&lt;/p&gt;

&lt;p&gt;The connection method depends on the firmware. A Candlelight-based setup can use a SocketCAN interface such as &lt;code&gt;can0&lt;/code&gt;, while an SLCAN configuration may use a serial port.&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows Testing with Cangaroo
&lt;/h2&gt;

&lt;p&gt;Windows users can use Cangaroo to verify that the SH-C30L is communicating correctly.&lt;/p&gt;

&lt;p&gt;Start by connecting the adapter to the PC and opening &lt;strong&gt;Device Manager&lt;/strong&gt;. With the factory Candlelight firmware, the adapter may appear as a CANable/&lt;code&gt;gs_usb&lt;/code&gt;-type device.&lt;/p&gt;

&lt;p&gt;Next, launch Cangaroo and open its measurement setup. If the adapter is detected correctly, the available CAN interface should appear in the interface list.&lt;/p&gt;

&lt;p&gt;Select the detected interface and configure the CAN bitrate to match the network. For example, if the CAN network operates at 500 kbps, the software must also be configured for 500 kbps.&lt;/p&gt;

&lt;p&gt;Once the interface is active and another CAN node is transmitting, frames should begin appearing in the monitoring window.&lt;/p&gt;

&lt;p&gt;This is a simple way to verify the adapter before connecting it to a more complicated embedded system.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP2515 CAN Module Overview
&lt;/h2&gt;

&lt;p&gt;The Arduino UNO is a popular development board, but it does not include a native CAN controller. To add CAN functionality, an external CAN controller and transceiver are required.&lt;/p&gt;

&lt;p&gt;The commonly available &lt;strong&gt;MCP2515 CAN module&lt;/strong&gt; solves this problem by combining an MCP2515 CAN controller with a CAN transceiver, often a TJA1050 on typical modules.&lt;/p&gt;

&lt;h3&gt;
  
  
  MCP2515 CAN Controller
&lt;/h3&gt;

&lt;p&gt;The MCP2515 handles the CAN protocol itself. It communicates with the Arduino through the SPI bus and takes care of CAN frame transmission and reception.&lt;/p&gt;

&lt;p&gt;It supports standard 11-bit identifiers as well as extended 29-bit identifiers and provides hardware filtering and masking features. These functions are useful when a CAN network contains many different message IDs but the Arduino only needs to process a small subset.&lt;/p&gt;

&lt;p&gt;The MCP2515 also has an interrupt output. When a relevant CAN event occurs, the INT pin can notify the Arduino so that the microcontroller does not have to continuously poll the controller.&lt;/p&gt;

&lt;h3&gt;
  
  
  TJA1050 CAN Transceiver
&lt;/h3&gt;

&lt;p&gt;The MCP2515 cannot directly drive the CAN_H and CAN_L lines. The TJA1050 transceiver handles this physical-layer conversion.&lt;/p&gt;

&lt;p&gt;It converts the digital CAN signals from the MCP2515 into the differential signals used on the CAN bus and converts incoming CAN bus signals back into logic-level signals for the controller.&lt;/p&gt;

&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MCP2515 = CAN protocol controller&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TJA1050 = CAN physical-layer transceiver&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Together, they provide the Arduino with a practical CAN interface.&lt;/p&gt;

&lt;h3&gt;
  
  
  120Ω Termination
&lt;/h3&gt;

&lt;p&gt;CAN networks normally require termination resistors at both physical ends of the bus.&lt;/p&gt;

&lt;p&gt;Many MCP2515 modules include a 120Ω resistor that can be enabled or disabled with a jumper. Whether you should enable it depends on where the module is located in the CAN network.&lt;/p&gt;

&lt;p&gt;If the MCP2515 is one end of the bus, its termination can be enabled. If it is a middle node, the termination should normally be disabled.&lt;/p&gt;

&lt;p&gt;The SH-C30L also has a switchable 120Ω termination resistor, which makes it convenient to create a correctly terminated two-node test network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Crystal Oscillator
&lt;/h3&gt;

&lt;p&gt;The MCP2515 requires a clock reference for CAN timing. Common breakout boards use either an 8 MHz or 16 MHz oscillator.&lt;/p&gt;

&lt;p&gt;This is important when configuring the Arduino library. The oscillator frequency defined in the software must match the actual MCP2515 module.&lt;/p&gt;

&lt;p&gt;Using the wrong oscillator setting can result in CAN initialization or communication problems even when the wiring is correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interfacing Arduino UNO with MCP2515
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0dm0tijuse3dx1d7syey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0dm0tijuse3dx1d7syey.png" alt=" " width="678" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The MCP2515 communicates with the Arduino UNO using SPI.&lt;/p&gt;

&lt;p&gt;For a typical UNO setup, connect:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MCP2515&lt;/th&gt;
&lt;th&gt;Arduino UNO&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VCC&lt;/td&gt;
&lt;td&gt;5V&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CS&lt;/td&gt;
&lt;td&gt;D10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MOSI&lt;/td&gt;
&lt;td&gt;D11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MISO&lt;/td&gt;
&lt;td&gt;D12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SCK&lt;/td&gt;
&lt;td&gt;D13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;INT&lt;/td&gt;
&lt;td&gt;Optional interrupt pin&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The CS pin can be changed in software, but the SPI data pins are normally connected to the UNO's hardware SPI pins.&lt;/p&gt;

&lt;p&gt;After connecting the SPI interface, the Arduino can configure the MCP2515 and exchange CAN frames through it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting the MCP2515 to the SH-C30L
&lt;/h2&gt;

&lt;p&gt;The second part of the setup is the CAN bus connection.&lt;/p&gt;

&lt;p&gt;Connect:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MCP2515&lt;/th&gt;
&lt;th&gt;SH-C30L&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CAN_H&lt;/td&gt;
&lt;td&gt;CAN_H&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CAN_L&lt;/td&gt;
&lt;td&gt;CAN_L&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The CAN_H and CAN_L lines must not be swapped.&lt;/p&gt;

&lt;p&gt;A common ground is also recommended for this non-isolated setup.&lt;/p&gt;

&lt;p&gt;If the MCP2515 and SH-C30L are the two endpoints of the test bus, enable the 120Ω termination on both devices. With two 120Ω resistors in parallel, the measured resistance between CAN_H and CAN_L should be approximately 60Ω when the system is powered off.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the Complete System Works
&lt;/h2&gt;

&lt;p&gt;Once everything is connected, the communication path looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Arduino UNO
     │
     │ SPI
     ▼
  MCP2515
     │
     │ CAN_H / CAN_L
     ▼
  SH-C30L
     │
     │ USB
     ▼
     PC / Laptop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the Arduino sends data, it first transfers the information to the MCP2515 through SPI.&lt;/p&gt;

&lt;p&gt;The MCP2515 packages the information into a CAN frame and passes it to the CAN transceiver. The transceiver places the differential signal onto CAN_H and CAN_L.&lt;/p&gt;

&lt;p&gt;The SH-C30L receives that CAN frame, converts it into a USB-compatible representation, and forwards it to the computer.&lt;/p&gt;

&lt;p&gt;The process also works in the opposite direction.&lt;/p&gt;

&lt;p&gt;A CAN frame generated by the PC is sent through USB to the SH-C30L. The adapter places it on the CAN bus, where the MCP2515 receives it. The Arduino can then read the frame through SPI and process the information in its program.&lt;/p&gt;

&lt;p&gt;This gives us a simple &lt;strong&gt;bidirectional CAN communication link between Arduino and a computer&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  CAN Termination: Don't Skip This
&lt;/h2&gt;

&lt;p&gt;Termination is one of the first things to check when a CAN network does not behave as expected.&lt;/p&gt;

&lt;p&gt;For this two-node test setup, the MCP2515 and SH-C30L represent the two ends of the bus. Therefore, both ends should have 120Ω termination enabled.&lt;/p&gt;

&lt;p&gt;With power removed, measuring between CAN_H and CAN_L should give approximately 60Ω because:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;120Ω || 120Ω ≈ 60Ω
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you measure approximately 120Ω, only one termination resistor is active. If the measurement is significantly different, check the wiring and termination configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting Tips
&lt;/h2&gt;

&lt;p&gt;If no CAN messages are appearing, check the basics before changing the software configuration.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Confirm that CAN_H is connected to CAN_H and CAN_L to CAN_L.&lt;/li&gt;
&lt;li&gt;Make sure all devices use the same CAN bitrate.&lt;/li&gt;
&lt;li&gt;Check whether the MCP2515 module uses an 8 MHz or 16 MHz oscillator.&lt;/li&gt;
&lt;li&gt;Verify that the correct MCP2515 CS pin is defined in your Arduino code.&lt;/li&gt;
&lt;li&gt;Check the termination resistors.&lt;/li&gt;
&lt;li&gt;Confirm that the SH-C30L is detected by the operating system.&lt;/li&gt;
&lt;li&gt;Make sure the selected firmware matches the software interface you are using.&lt;/li&gt;
&lt;li&gt;Use a common ground between the Arduino-side CAN hardware and the SH-C30L.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CAN troubleshooting becomes much easier when you verify one layer at a time: first USB detection, then CAN adapter configuration, then CAN bus signaling, and finally Arduino communication.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where This Setup Can Be Used
&lt;/h2&gt;

&lt;p&gt;This setup is useful for experimenting with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automotive CAN communication&lt;/li&gt;
&lt;li&gt;ECU development and diagnostics&lt;/li&gt;
&lt;li&gt;EV and battery-system communication&lt;/li&gt;
&lt;li&gt;Industrial controllers&lt;/li&gt;
&lt;li&gt;Robotics&lt;/li&gt;
&lt;li&gt;CAN-based sensor networks&lt;/li&gt;
&lt;li&gt;Embedded-system testing&lt;/li&gt;
&lt;li&gt;CAN protocol learning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is particularly useful for students and hobbyists because it provides a practical way to observe how CAN communication moves between an embedded controller and a computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The SH-C30L provides a convenient bridge between a computer and a CAN network, while the MCP2515 gives the Arduino UNO the CAN capability that it lacks internally.&lt;/p&gt;

&lt;p&gt;Putting the three pieces together creates a useful development platform: the Arduino generates or processes CAN messages, the MCP2515 handles CAN protocol communication, and the SH-C30L provides the connection to PC-based monitoring and debugging software.&lt;/p&gt;

&lt;p&gt;The setup also demonstrates an important concept in embedded systems: communication often involves multiple layers. SPI connects the Arduino to the CAN controller, the CAN transceiver handles the physical bus, and USB connects the CAN network to the computer.&lt;/p&gt;

&lt;p&gt;For complete step-by-step instructions, wiring details, code, and additional testing information, you can also refer to the original guide on &lt;strong&gt;Play with Circuit&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://playwithcircuit.com/how-to-interface-servo-motor-with-arduino/" rel="noopener noreferrer"&gt;https://playwithcircuit.com/how-to-interface-servo-motor-with-arduino/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're just getting started with CAN, this project is a good way to move from simply reading about the protocol to actually sending, receiving, and analyzing CAN frames.&lt;/p&gt;

</description>
      <category>esp32</category>
      <category>embedded</category>
      <category>iot</category>
    </item>
    <item>
      <title>Arduino 5V 4-Channel Relay Module: Pinout, Wiring and How It Works</title>
      <dc:creator>Play with Circuit</dc:creator>
      <pubDate>Tue, 11 Aug 2026 05:18:24 +0000</pubDate>
      <link>https://dev.to/play_withcircuit_241ef87/arduino-5v-4-channel-relay-module-pinout-wiring-and-how-it-works-4i16</link>
      <guid>https://dev.to/play_withcircuit_241ef87/arduino-5v-4-channel-relay-module-pinout-wiring-and-how-it-works-4i16</guid>
      <description>&lt;p&gt;An Arduino can easily control LEDs, sensors, displays, and other low-voltage components. But what happens when you need to switch a motor, lamp, fan, or another higher-power load?&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;relay module&lt;/strong&gt; provides a simple interface between the Arduino and the load.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll look at a commonly available &lt;strong&gt;5V 4-channel relay module (HL-52S type)&lt;/strong&gt;, understand its working, and connect it to an Arduino Uno.&lt;/p&gt;

&lt;p&gt;The example uses the relay outputs to control a DC motor and the three channels of a multicolor LED.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Safety:&lt;/strong&gt; Relay contacts can be used with mains voltage. Do not work with 120/230V AC unless you understand mains safety practices. For this example, we'll use DC loads.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  5V 4-Channel Relay Module Pinout
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffpunz539zd2i0vzcnkvb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffpunz539zd2i0vzcnkvb.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Each relay channel has three output terminals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;COM&lt;/strong&gt; — Common&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NO&lt;/strong&gt; — Normally Open&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NC&lt;/strong&gt; — Normally Closed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The module also has the following control connections:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pin&lt;/th&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VCC&lt;/td&gt;
&lt;td&gt;Relay module supply&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;td&gt;Ground&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN1&lt;/td&gt;
&lt;td&gt;Relay 1 control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN2&lt;/td&gt;
&lt;td&gt;Relay 2 control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN3&lt;/td&gt;
&lt;td&gt;Relay 3 control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN4&lt;/td&gt;
&lt;td&gt;Relay 4 control&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How the HL-52S Relay Module Works
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0681vvp2nzqzx0rpj24f.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0681vvp2nzqzx0rpj24f.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The relay board contains four 5V relay coils and driver circuitry.&lt;/p&gt;

&lt;p&gt;On this particular type of module, the control inputs are &lt;strong&gt;active LOW&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;HIGH&lt;/code&gt; → relay de-energized&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LOW&lt;/code&gt; → relay energized&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The input signal controls a transistor in the driver circuit. When the input is pulled LOW, the transistor switches the relay coil and the corresponding relay changes state.&lt;/p&gt;

&lt;p&gt;A flyback diode is connected across each relay coil. Its purpose is to suppress the voltage spike produced when the magnetic field of the coil collapses after the relay is switched off.&lt;/p&gt;

&lt;p&gt;The board also provides LEDs to show the power and individual relay states.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relay Module Specifications
&lt;/h2&gt;

&lt;p&gt;Typical specifications for this 5V 4-channel relay board are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Specification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Supply voltage&lt;/td&gt;
&lt;td&gt;3.75V–6V&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input trigger current&lt;/td&gt;
&lt;td&gt;Approximately 5mA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Relay coil current&lt;/td&gt;
&lt;td&gt;Approximately 70mA per relay&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All four relay coils&lt;/td&gt;
&lt;td&gt;Approximately 300mA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maximum switching current&lt;/td&gt;
&lt;td&gt;10A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maximum contact voltage&lt;/td&gt;
&lt;td&gt;250VAC / 30VDC&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The exact specifications can vary slightly between manufacturers and board revisions, so check the markings or datasheet for your particular module.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the Relay Module with Push Buttons
&lt;/h2&gt;

&lt;p&gt;Before connecting an Arduino, you can also test the relay board using push buttons.&lt;/p&gt;

&lt;p&gt;Connect the relay module's &lt;strong&gt;IN1–IN4&lt;/strong&gt; inputs to four push buttons. The buttons can pull the corresponding inputs to ground.&lt;/p&gt;

&lt;p&gt;Because the module uses active-LOW triggering, pressing a button pulls the input LOW and activates that relay.&lt;/p&gt;

&lt;p&gt;The relay's indicator LED will also turn on.&lt;/p&gt;

&lt;p&gt;When the button is released, the input returns HIGH and the relay returns to its inactive state.&lt;/p&gt;

&lt;p&gt;This is a useful way to understand the relay module without writing any code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting the Relay Module to Arduino Uno
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Components
&lt;/h3&gt;

&lt;p&gt;For a basic setup, you'll need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arduino Uno R3&lt;/li&gt;
&lt;li&gt;5V 4-channel relay module&lt;/li&gt;
&lt;li&gt;9V DC motor&lt;/li&gt;
&lt;li&gt;Common-cathode multicolor LED&lt;/li&gt;
&lt;li&gt;External DC supply/battery for the loads&lt;/li&gt;
&lt;li&gt;Breadboard&lt;/li&gt;
&lt;li&gt;Jumper wires&lt;/li&gt;
&lt;li&gt;USB cable for the Arduino&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the Arduino example, we'll use the following connections:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Relay Module&lt;/th&gt;
&lt;th&gt;Arduino Uno&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VCC&lt;/td&gt;
&lt;td&gt;5V&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;td&gt;GND&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN1 — Motor&lt;/td&gt;
&lt;td&gt;Pin 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN2 — RED&lt;/td&gt;
&lt;td&gt;Pin 3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN3 — BLUE&lt;/td&gt;
&lt;td&gt;Pin 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN4 — GREEN&lt;/td&gt;
&lt;td&gt;Pin 5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The four relay channels are assigned as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Relay 1:&lt;/strong&gt; DC motor&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relay 2:&lt;/strong&gt; Red LED channel&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relay 3:&lt;/strong&gt; Blue LED channel&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relay 4:&lt;/strong&gt; Green LED channel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The relay contacts are then used to switch the external DC supply to the respective loads.&lt;/p&gt;

&lt;p&gt;The Arduino can control each relay independently.&lt;/p&gt;

&lt;p&gt;Because the relay contacts are electrically separate from the Arduino control logic, the load receives power from its own supply rather than directly from an Arduino GPIO pin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A 5V 4-channel relay module is a convenient way to let an Arduino control loads that cannot be driven directly from its GPIO pins.&lt;/p&gt;

&lt;p&gt;For the original circuit diagrams and a more detailed hardware walkthrough, see the full &lt;strong&gt;5V 4-channel relay module with Arduino&lt;/strong&gt; tutorial on &lt;strong&gt;Play with Circuit&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>arduino</category>
      <category>software</category>
      <category>learning</category>
    </item>
    <item>
      <title>Arduino Servo Motor Control</title>
      <dc:creator>Play with Circuit</dc:creator>
      <pubDate>Wed, 15 Apr 2026 09:38:35 +0000</pubDate>
      <link>https://dev.to/play_withcircuit_241ef87/arduino-servo-motor-control-53k0</link>
      <guid>https://dev.to/play_withcircuit_241ef87/arduino-servo-motor-control-53k0</guid>
      <description>&lt;p&gt;When working on robotics or automation projects, one of the most commonly used components is the servo motor. Unlike regular DC motors, servo motors are designed for precise position control, making them ideal for applications like robotic arms, camera positioning systems, and mechanical linkages.&lt;/p&gt;

&lt;p&gt;In this project, we will first understand how to interface a servo motor with the Arduino Uno and control its movement. Along with that, we will also build a simple servo tester, which is extremely useful for checking whether a servo is functioning correctly before using it in a larger system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components Required&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Arduino Uno&lt;br&gt;
SG90 Micro Servo Motor&lt;br&gt;
Breadboard&lt;br&gt;
Jumper wires&lt;br&gt;
10kΩ Potentiometer&lt;br&gt;
16x2 LCD (optional but useful)&lt;br&gt;
220Ω resistor&lt;br&gt;
USB cable or 5V supply&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Servo Motor
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd10idifymdro5ikpskh1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd10idifymdro5ikpskh1.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
A servo motor is a compact device that combines a DC motor, a gear mechanism, and a feedback system. This feedback system continuously monitors the position of the output shaft and adjusts it to match the desired angle. Because of this closed-loop control, servo motors can move to a specific position and hold it steadily.&lt;/p&gt;

&lt;p&gt;Most hobby servo motors, such as the popular SG90, can rotate approximately from 0° to 180°. They are controlled using a PWM (Pulse Width Modulation) signal. Instead of changing voltage, the control is achieved by varying the width of the pulse sent to the signal pin. The internal electronics interpret this pulse width and rotate the shaft accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working Principle of Servo Control
&lt;/h2&gt;

&lt;p&gt;The core concept behind controlling a servo motor is PWM. The Arduino generates a series of pulses, and the duration of each pulse determines the position of the servo shaft. For example, a shorter pulse corresponds to one extreme position (around 0 degrees), a medium pulse places the servo at the center (around 90 degrees), and a longer pulse moves it to the other extreme (around 180 degrees).&lt;/p&gt;

&lt;p&gt;The servo’s internal control circuit continuously compares the received signal with its current position using feedback from the internal potentiometer. If there is a difference, it drives the motor until the desired position is reached. This is why servo motors are highly accurate and stable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Circuit Diagram
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3nmfa1x3zetcbl3deik.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3nmfa1x3zetcbl3deik.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
The circuit for interfacing a servo motor with Arduino is quite simple. The power wire of the servo is connected to the 5V pin of the Arduino, while the ground wire is connected to the GND pin. The control wire is connected to one of the PWM-enabled digital pins, commonly pin 10.&lt;/p&gt;

&lt;p&gt;Once the connections are made, the Arduino sends PWM signals through the control pin, and the servo rotates according to the signal timing. This setup is sufficient for basic control and experimentation.&lt;/p&gt;

&lt;p&gt;However, if you are using multiple servos or require more stable performance, it is often recommended to use an external power supply instead of relying solely on the Arduino’s 5V output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a Servo Tester Using Arduino
&lt;/h2&gt;

&lt;p&gt;A servo tester is a simple yet powerful tool that allows you to manually control and verify the performance of a servo motor. Instead of writing different code snippets repeatedly, a tester provides an intuitive way to check whether the servo responds correctly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xbq625ol7yn9zul4qme.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xbq625ol7yn9zul4qme.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this setup, a 10k potentiometer is used as an input device. The middle pin of the potentiometer is connected to the analog pin A0 of the Arduino. As you rotate the knob, the analog value changes, and the Arduino maps this value to a corresponding servo angle.&lt;/p&gt;

&lt;p&gt;The servo motor is connected in the same way as before, with its signal pin connected to pin 10. When the potentiometer is turned, the servo rotates smoothly, following the input. This gives you direct control over the servo position.&lt;/p&gt;

&lt;p&gt;If you add a 16x2 LCD display, the system becomes even more informative. The Arduino can display the current angle of the servo in real time. This allows you to verify whether the physical movement of the servo matches the expected angle. If the movement is inconsistent or unresponsive, it may indicate a faulty servo.&lt;/p&gt;

&lt;p&gt;This type of tester is particularly useful when working on larger projects where multiple servos are involved, as it helps ensure reliability before integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This project introduces you to both controlling and testing servo motors, which are essential skills in embedded systems and robotics. Understanding how PWM signals translate into physical motion gives you a strong foundation for more advanced designs.&lt;/p&gt;

&lt;p&gt;By building a simple servo tester, you also learn how to validate components efficiently—something that becomes increasingly important as your projects grow in complexity.&lt;/p&gt;

&lt;p&gt;As you move forward, you can expand this concept into multi-servo systems, robotic mechanisms, or even custom-designed hardware using professional PCB services like PCBWay.&lt;/p&gt;

&lt;p&gt;For complete step-by-step instructions, Arduino code, and a detailed servo motor testing setup, check the full guide here:&lt;br&gt;
&lt;a href="https://playwithcircuit.com/how-to-interface-servo-motor-with-arduino/" rel="noopener noreferrer"&gt;https://playwithcircuit.com/how-to-interface-servo-motor-with-arduino/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>arduino</category>
    </item>
    <item>
      <title>Water Level Sensor with Arduino</title>
      <dc:creator>Play with Circuit</dc:creator>
      <pubDate>Fri, 04 Apr 2025 11:21:56 +0000</pubDate>
      <link>https://dev.to/play_withcircuit_241ef87/water-level-sensor-with-arduino-1ic8</link>
      <guid>https://dev.to/play_withcircuit_241ef87/water-level-sensor-with-arduino-1ic8</guid>
      <description>&lt;p&gt;Water wastage due to tank overflow is a common issue faced in many homes and buildings. Fortunately, this problem can be effectively addressed with a simple and affordable solution: a Water Level Sensor. By integrating this sensor with an Arduino, we can monitor the water level inside a tank in real-time and trigger alerts—such as turning on an LED or buzzer—when the tank is about to overflow.&lt;br&gt;
In this tutorial, you'll learn how water level sensors work, how to connect them to an Arduino.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does a Water Level Sensor Work?
&lt;/h2&gt;

&lt;p&gt;A water level sensor detects the presence or height of water in a container by measuring the electrical resistance between exposed conductive traces. When water comes into contact with the sensor, it changes the resistance between these traces, which in turn alters the output voltage.&lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;br&gt;
More water → more conductivity → lower resistance → higher output voltage&lt;br&gt;
Less water → less conductivity → higher resistance → lower output voltage&lt;br&gt;
This analog voltage output is then read by an Arduino analog pin and mapped to represent the water level. The deeper the water covers the sensor, the higher the voltage output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Water Level Sensor Specifications
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Operating voltage: 3 to 5V, &amp;lt; 20mA&lt;/li&gt;
&lt;li&gt;Humidity: 10%-90% non-condensing&lt;/li&gt;
&lt;li&gt;Operating Temperature: 10℃-30℃&lt;/li&gt;
&lt;li&gt;Sensor Type: Analog&lt;/li&gt;
&lt;li&gt;Output Voltage Range: 0 to 3.85V&lt;/li&gt;
&lt;li&gt;Detection Area: 40mm (height) x 16mm (width)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Water Level Sensor Hardware Overview
&lt;/h2&gt;

&lt;p&gt;The water level sensor consists of 10 parallel conductive traces:&lt;br&gt;
5 Power Traces (connected to VCC)&lt;br&gt;
5 Sense Traces (connected to signal output)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3i97hin6soznhg8b7kc9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3i97hin6soznhg8b7kc9.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
These traces are arranged alternately so that each sensing trace is placed between two power traces. When water bridges the traces, it allows current to flow, which is interpreted by the internal circuit as an increase in water level.&lt;br&gt;
The module also contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A power LED to indicate the sensor is powered.&lt;/li&gt;
&lt;li&gt;An NPN transistor for switching behavior.&lt;/li&gt;
&lt;li&gt;Multiple resistors to limit current and protect the components.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pinout of Water Level Sensor
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2y78aebl3p17h2seyy66.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2y78aebl3p17h2seyy66.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;VCC:&lt;/strong&gt; Power supply pin (connect to 5V on Arduino)&lt;br&gt;
&lt;strong&gt;GND:&lt;/strong&gt; Ground connection&lt;br&gt;
&lt;strong&gt;OUT:&lt;/strong&gt; Analog output (connect to Arduino analog pin)&lt;/p&gt;

&lt;h2&gt;
  
  
  Schematic Diagram
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz34w3a62agx7emezf5k3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz34w3a62agx7emezf5k3.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The internal working of the sensor module can be broken down into these parts:&lt;br&gt;
&lt;strong&gt;NPN Transistor (Q1):&lt;/strong&gt; Acts as a switch, turning on when the sensor detects water.&lt;br&gt;
&lt;strong&gt;Resistors (R1, R2, R3):&lt;/strong&gt; Limit the current and protect the components.&lt;br&gt;
&lt;strong&gt;Copper Traces:&lt;/strong&gt; The power traces are connected to VCC through resistors, and sense traces go to the transistor's base.&lt;/p&gt;

&lt;p&gt;**Working Principle: **When water bridges the traces, it creates a voltage at the transistor’s base. This allows current to flow from collector to emitter, effectively turning the transistor ON. As a result, the signal pin provides an analog voltage output that increases with water level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wiring a Water Level Sensor to Arduino
&lt;/h2&gt;

&lt;p&gt;The circuit diagram is shown as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh2s2yzllmk6hfoe0b590.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh2s2yzllmk6hfoe0b590.PNG" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wiring:&lt;/strong&gt;&lt;br&gt;
Sensor VCC → Arduino 5V&lt;br&gt;
Sensor GND → Arduino GND&lt;br&gt;
Sensor OUT → Arduino A0 (analog pin)&lt;br&gt;
SCK and SDA pins of LCD → I2C pin of the Arduino&lt;/p&gt;

&lt;h2&gt;
  
  
  Arduino Code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* 
Interfacing Water Level Sensor with Arduino UNO using Analog Output pin of Module
by www.playwithcircuit.com
Using this code we will know the Analog Value when water level is very low and when it is very high.
*/
#include &amp;lt;LiquidCrystal_I2C.h&amp;gt;  // Library to Run I2C LCD
// define the size of filter array
#define FILTER_SIZE 20
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Define the analog pin for the soil moisture sensor
const int WaterSensorPin = A0;
// Analog Value filter
int Filter(int sensorValue);
void setup() {
  // initialize the lcd
  lcd.init();
  // Turn on the Backlight
  lcd.backlight();
  // Clear the display buffer
  lcd.clear();
  // Print a message to the LCD
  lcd.setCursor(0, 0);
  lcd.print("Analog Value:");
}
void loop() {
  // Variable to store sensor values
  int sensorValue;
  // Variable to store filtered values
  int filteredValue;
  // Read the value from the soil moisture sensor
  sensorValue = analogRead(WaterSensorPin);
  filteredValue = Filter(sensorValue);
  // Display the filtered Analog Value on the LCD
  lcd.setCursor(0, 1);
  lcd.print(filteredValue);
  // Clear Previous Data
  lcd.print("   ");
  // Wait for 50ms before the next loop
  delay(50);
}
// Averaging filter to filter Analog Values
int Filter(int sensorValue) {
  static int analogArray[FILTER_SIZE] = { 0 };
  int filteredValue = 0;
  int i;
  // Shift the Elemnent removing the oldest value stored at index 0
  for (i = 0; i &amp;lt; (FILTER_SIZE - 1); i++) {
    analogArray[i] = analogArray[i + 1];
  }
  // Put the current value in the last element of Array i.e at index FILTER_SIZE-1 
  analogArray[FILTER_SIZE-1] = sensorValue;
  for (i = 0; i &amp;lt; FILTER_SIZE; i++) {
    filteredValue += analogArray[i];
  }
  // Return Filtered Analog Value
  return (filteredValue / FILTER_SIZE);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To learn how to create a water level indicator checkout: &lt;a href="https://playwithcircuit.com/water-level-sensor-arduino-tutorial/" rel="noopener noreferrer"&gt;https://playwithcircuit.com/water-level-sensor-arduino-tutorial/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>arduino</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
