Thursday, 23 October 2025

Understanding the Clocked JK Flip-Flop

The Clocked JK Flip-Flop is a versatile sequential logic circuit that overcomes the limitations of earlier flip-flop designs, such as the SR flip-flop. It is widely used in digital electronics for applications like counters, memory units, and frequency dividers.

What Is a Clocked JK Flip-Flop?

A Clocked JK Flip-Flop is an edge-triggered bistable multivibrator with two inputs: J and K, and two outputs: Q and Q̅. Unlike the SR flip-flop, it eliminates the invalid state when both inputs are high. When both J and K are high, the flip-flop toggles its output on each clock pulse, making it a universal flip-flop.

Truth Table

J K Q(t+1) Description

0 0 Q(t) No change

0 1 0 Reset

1 0 1 Set

1 1 Q̅(t) Toggle


Working Principle

The Clocked JK Flip-Flop operates based on the clock signal. It changes its state only on the triggering edge of the clock pulse, ensuring synchronized operation in digital systems. This edge-triggered behavior prevents unwanted changes during the clock's high or low periods.

Advantages

  • No Invalid States: Eliminates the invalid state present in SR flip-flops.
  • Versatility: Can be configured to perform the functions of other flip-flops like SR, T, and D.
  • Edge-Triggered: Ensures synchronized operation in digital systems. 

Applications

  • Counters: Used in digital counters for counting applications.
  • Memory Units: Stores binary data in memory circuits.
  • Frequency Dividers: Divides the frequency of clock signals.
  • Digital Systems: Serves as a fundamental building block in various digital systems.

Build a Indoor UWB Positioning System with ESP32 and DWM3000

Traditional GPS struggles indoors due to signal attenuation by walls and ceilings. Ultra-Wideband (UWB) technology overcomes this by measuring the time it takes for radio pulses to travel between devices, achieving centimeter-level accuracy. This UWB Indoor Positioning System using ESP32 demonstrates how to build a UWB indoor positioning system using the Qorvo DWM3000 UWB module and ESP32 microcontrollers, capable of tracking devices with 10 cm precision.

Components Required

  • Qorvo DWM3000 UWB Module: Provides high-accuracy location and ranging capabilities.
  • ESP32-WROOM Development Board: Handles SPI communication and processing.
  • Micro-USB Cables: For programming and powering each ESP32.
  • Breadboard / PCB: For mounting and connecting the DWM3000 with ESP32.
  • 5V USB Power Source / Power Bank: To power each ESP32 module.



How It Works

  • Anchor Placement: Position 3 or more UWB anchors at known locations in your environment to ensure optimal coverage.
  • Tag Initialization: The mobile UWB positioning device (tag) initiates ranging with the anchors.
  • Distance Measurement: Using Double-Sided Two-Way Ranging (DS-TWR), distances between the tag and anchors are measured.
  • Trilateration: With distances to at least three anchors, the tag's position is determined using trilateration.
  • Data Transmission: The tag sends distance or raw timing data over Wi-Fi or serial to a computer.
  • Position Calculation: A Python script processes the data to compute and visualize the tag's position in real-time.

Future Upgrades

  • Extended Range: Implementing more anchors to cover larger areas.
  • Enhanced Visualization: Developing more sophisticated visualization tools for better user experience.
  • Integration with Other Systems: Connecting the positioning system with other IoT devices for automation purposes.

Thursday, 18 September 2025

How to Interface a Thermal Printer with ESP32 – Print Receipts, QR Codes & Image


Want to add printing to your ESP32 projects, receipts, invoices, barcodes, even logos—without using a full PC? Using a thermal printer like the PNP-500 with an ESP32 lets you do just that. Thermal printers are popular because they print quietly, need no ink, are simple to interface, and work fast. In this guide, you’ll learn how to wire up a thermal printer to an ESP32, use ESC/POS commands, print text, images, barcodes & much more.

What Is a Thermal Printer & Why Use It?

Thermal printers use heat on special thermal paper to produce text or graphics. Since there are no rollers or ink cartridges, they’re cheaper in maintenance and more compact. You’ll often find them in:

  • Receipt printers in shops
  • Label printers for barcodes
  • Small embedded displays in IoT devices

With ESP32 thermal printer, you can create custom printing applications, say a QR code receipt printer, smart home logs, industrial data logs, and so on.

Hardware You’ll Need

  • ESP32 Development Board 
  • PNP-500 thermal printer module
  • 2 Push Buttons 
  • 2-cell Li-ion battery 
  • Resistors 


How to Wire the Printer to ESP32

  • Use the TTL (UART) interface of the printer. This is simpler than RS232 in many cases.
  • Connect the TX/RX pins of ESP32 UART2 to the printer’s RX/TX pins.
  • Power the printer from a stable voltage (around 7-9V preferred; 5V works for simple text).
  • Optionally, add buttons: one button to move through demo image printing, another for full format/demo prints.


Make sure to use pull-ups on signal lines if wires are long to reduce noise, and common ground.

Applications & Use Cases

Here are some ideas where an ESP32-thermal printer combo can be useful:

  • Printing sales invoices / receipts
  • IoT monitoring dashboards that print logs spontaneously
  • Barcode/QR code tickets or labels
  • Smart lockers or access control systems printing QR codes
  • Portable printing for outdoor data collection

Wednesday, 3 September 2025

Raspberry Pi Pico GPS Tracking Project with SIM800L & Neo-6M – Step by Step Guide

Cellular GPS Tracker with Raspberry Pi Pico


The Raspberry Pi Pico makes it easy to create your own real-time GPS tracking system. With just a few parts and some basic programming, you can build a fully functional IoT GPS tracker thanks to reasonably priced GPS and GSM modules.

We'll demonstrate how to construct a Raspberry Pi Pico GPS tracker in this tutorial using:
  • Neo-6M GPS module to gather location data in real time,
  • cellular communication using the SIM800L GSM module, and
  • Data can be sent to the cloud and shown on an interactive map using the GeoLinker API.


After following this tutorial, you will have a GPS tracker that can record and send real-time location updates, even with offline buffering in case of network outages.

Components Required

Component

Description

Quantity

Raspberry Pi Pico / Pico W

Microcontroller (RP2040)

1

SIM800L Module

GSM/GPRS module for internet access

1

Neo-6M GPS Module

For GPS data Collection

1

GPS Antenna

External GPS antenna with SMA/UFL

1

GSM Antenna

External GSM antenna

1

LED

Red, Yellow, Green

3

SIM

2G Capable SIM (Airtel)

1

Jumper Wires, Breadboard

For prototyping

as needed


How Does It Work?

Pico GPS Tracker concept


  • Neo-6M GPS Module picks up latitude & longitude from GPS satellites and sends them as NMEA sentences.
  • Raspberry Pi Pico reads these values over UART and parses them.
  • SIM800L GSM Module transmits this data to the internet using HTTP POST requests.
  • GeoLinker Cloud API stores the location data and plots it on a real-time map.
  • If the GSM connection drops, data is stored offline and automatically synced once the network is back.

This way, no GPS point is lost even in areas with weak coverage.

Applications of Raspberry Pi Pico GPS Tracker

Pico GPS Tracker with Offline Data Sync

This tracker can be adapted for many real-world uses:
  • Vehicle Fleet Tracking – monitor cars or delivery vans in real-time.
  • Asset Tracking – keep an eye on shipments, parcels, or equipment.
  • Pet Locator – attach it to a collar to track pets.
  • Bike/Scooter Tracking – prevent theft and track movement.
  • Emergency Alert System – send SOS + live location on button press.
Building a Raspberry Pi Pico GPS Tracker, SIM800L, and Neo-6M GPS is not only affordable but also highly customizable. The GeoLinker library removes most of the complexity, letting you focus on logic instead of low-level AT commands.

GitHub Repository with Arduino Code and Circuit for Raspberry Pi Pico GPS Tracker

Thursday, 21 August 2025

SR Latch in Digital Electronics: Working, Truth Table, and Variants

SR latch tutorial

If you are diving into digital electronics, and you might have came across latches. In digital electronics, computers remember things with the help of simple circuits called latches which are the simplest memory elements. They store a single bit of binary data and play a key role in sequential circuits and memory design. One of the most fundamental types is the SR Latch (Set-Reset Latch), which operates with two inputs, Set (S) and Reset (R).

In this article, we will explore what an SR latch is, how it works, its truth table, and the differences between the basic SR Latch, Gated SR Latch, and Clocked SR Latch (SR Flip-Flop).

What is an SR Latch?

SR latch


The SR Latch is a basic circuit that stores one bit of information. It has two inputs:

  • Set (S): Makes the output high (Q = 1)
  • Reset (R): Makes the output low (Q = 0)

Once set, the output remains stable even if the inputs are removed, which is why it’s used as a memory element.

SR latches can be built using NOR gates or NAND gates. The only difference is that the NAND version uses active LOW inputs, while the NOR version works with active HIGH inputs. 

Gated SR Latch

The Gated SR Latch is similar to the basic SR latch but includes an Enable input.

  • When Enable = 1, the latch responds to S and R inputs.

  • When Enable = 0, the output stays unchanged, regardless of inputs.

This provides more control and is often used in situations where the latch should only update at specific times.


Clocked SR Latch (SR Flip-Flop)

When a clock signal is introduced, the SR latch becomes edge-triggered, and is commonly called an SR Flip-Flop.

Here’s how it works:

  • S = 1, R = 0 → Q = 1 (Set)

  • S = 0, R = 1 → Q = 0 (Reset)

  • S = R = 0 → Previous state (No change)

  • S = R = 1 → Invalid condition

The clock ensures that the output only changes on a rising or falling edge, making it more reliable for sequential circuits.



Applications of SR Latch

  • Basic memory storage elements
  • Control circuits in microcontrollers and processors
  • Debouncing switches in digital systems
  • Building blocks for more advanced flip-flops (D, JK, T)

Wednesday, 30 July 2025

Static IP on Raspberry Pi Made Simple

 

How to Set a Static IP on Raspberry Pi

When working with Raspberry Pi on local networks, the device’s IP address can often change after every reboot or network change. This creates problems while accessing your Pi remotely or connecting it to services. To solve this, assigning a Static IP address ensures your Pi always stays at the same address on your network.

In this guide, you'll learn how to configure a static IP on Raspberry Pi OS using a simple configuration file method. This is useful for IoT projects, web servers, or remote SSH access, where a consistent IP is required.

Steps to Set a Static IP

  • Check your current IP using hostname -I
  • Edit the DHCP configuration:
  • Use sudo nano /etc/dhcpcd.conf
  • Add static IP settings
  • Save and reboot using sudo reboot

Why Use a Static IP on Raspberry Pi?

  • Easy remote access via SSH or VNC
  • Ensures consistent device identification in home automation
  • Helps when assigning port forwarding on your router
  • Ideal for Raspberry Pi running servers or cloud services

Setting a static IP is a small but crucial step for a stable Raspberry Pi network setup. It prevents connection errors and is especially handy in larger home or lab networks. Just make sure the IP address you assign doesn’t conflict with other devices.

Tuesday, 8 July 2025

Learn to Build Your Own Gas Leak Detector with Arduino – Simple DIY Safety Project

Ever thought about how devices can sniff out gas leaks and keep you safe, without you lifting a finger? That’s where a gas leakage detector comes in. It's a simple yet useful project you can build yourself using Arduino. In this guide, we will walk you through how to make your own gas detection system with all the schematics and code you need to get started.

What is a Gas Leakage Detector?

A gas leakage detector uses MQ-5 gas sensor to identify the presence of combustible gases such as LPG, methane, and smoke in the air. When gas concentration exceeds a certain threshold, it triggers a buzzer and alerts users through a connected display or indicator.

Components Required

To build this project, you will need:

  • Arduino Uno
  • MQ-5 Gas Sensor
  • Buzzer
  • LED
  • 16x2 LCD Display (with I2C Module)
  • Resistors
  • Jumper Wires & Breadboard
  • 5V Power Supply

Gas Leakage Detector Using Arduino Project


Circuit Diagram of Gas Leakage Detector Using Arduino

The MQ-5 sensor’s digital output goes to pin A2, while a buzzer (on A0) and an LED (on A1) provide alerts when gas is detected. A common ground is shared, and you can also power the system using USB or a regular adapter. When gas is detected, the Arduino turns on a buzzer and LED.

Circuit Diagram of Gas Leakage Detector Using Arduino

Applications of Gas Leakage Detectors

  • Home safety and kitchen monitoring
  • Industrial gas leak detection
  • Smart home automation systems
  • Educational electronics and IoT projects

Click here to explore the project in detail: How to Build a Gas Leakage Detector Using Arduino: Complete DIY Guide