In this post we’ll study how to control a relay using Arduino on Tinkercad using NPN Transistor Control.
As we know Arduino have only limited output voltage and current from its pins.
So when we want to control a motor or a bulb we need to first control a relay to control that bulb or motor.
But also the relay coil draws relativily high current from that Arduino can supply.
That’s why we use the NPN transistor as a switch.

Here is the complete circuit that controls the transistor from Arduino to control the relay which supplies voltage to the bulb.
Code

Here is the simulation video on Tinkercad
https://www.tinkercad.com/things/bRRLalBRMhR-arduino-relay-button-npn-control
as we see in this video see we control relay from Arduino to power some high power stuff like a bulb from higher voltage from Arduino.
as we know Arduino cannot control high power devices it only supplies 5 volts with limited current, so we use relays in between to control motors and bulbs with a high voltage.
this relay cannot be directly controlled from Arduino because it throws current from its coil, now we know it only supplies 5 voltage with limited current, so we use that transistor NPN as a switch, this is the emitter base and collector we use it as a switch between the Arduino and the relay base
It is directly controlled by the Arduino output pin so it rings he 5 voltage to the relay terminal to control it’s open and close, let’s see how this circuit work this is the code here we can see that it has the code to control the pin button number 8 to take the action from the pin button.
as we have seen in the previous posts this relay the output pin number 2 it starts with the state relay low and a state button, this uses the bounce to to filter the input from the button and it makes some delay in between>
so let’s start the emulation and see how it’s working, let’s press Start simulation and find that there are three volts coming to the Bulb and controlled by the relay which is controlled by that transistor controlled by the Arduino>
let’s press the button then bulb lights on we can see high current and then pours off let’s see it again it’s powered up then it’s powered down t’s powered up then powered down .
Recent posts
- The “Secretary of War” and the Beast: Why the Doomsday Plane Just Landed at LAX
On January 8, 2026, the Boeing E-4B Nightwatch, known as America’s “Doomsday Plane,” made a rare appearance at Los Angeles International Airport. It transported Secretary of War Pete Hegseth during his “Arsenal of Freedom” tour, aimed at reviving the defense industrial base, sparking debate over its high operational costs amidst its significant Cold War legacy. - Build a Pinguino Egypt: A PIC-Based Arduino Clone (Complete Guide + Resources)
I wanted to build my own Arduino. Here’s a project where you can build Arduino Compatible with your favorite Microchip PIC Microcontroller. - Why I Built This App: Stepping Away From Screens to Come Back to Ourselves
Lately, I’ve been spending time reading posts on Reddit. Not the funny ones or the viral threads—but the honest ones. People talking about how isolated they feel. How unproductive. How days blur together behind screens. How they feel connected to everyone and no one at the same time. What struck me wasn’t laziness or lack… Read more: Why I Built This App: Stepping Away From Screens to Come Back to Ourselves - US ‘Doomsday Plane’ Spotted Today: What It Is, Why It Matters, and What We Know So Far
The U.S. Air Force E-4B “Doomsday Plane” was sighted landing at LAX, attracting public attention due to its rare visibility. Designed as a National Airborne Operations Center, it ensures military command during crises. However, today’s appearance likely reflects routine operations rather than an emergency, emphasizing its role in military preparedness. - Why Arduino Ultrasonic Sensor Gives Random Values ? (And 3 ideas to Fix It)If your Arduino ultrasonic sensor gives random, unstable, or jumping distance values, you are not alone. This is one of the most common Arduino beginner problems, both in real hardware and even in Tinkercad simulation. In this article, we’ll explain: What “Random Values” Really Means When people say random values, they usually mean: These symptoms… Read more: Why Arduino Ultrasonic Sensor Gives Random Values ? (And 3 ideas to Fix It)
- The Advantages and Disadvantages of Quantum AIrtificial Intelligence (AI) has already changed the way we live, work, and solve problems. But when you combine AI with quantum computing, a new frontier opens — one that could transform industries at a speed and scale we’ve never imagined. This powerful combination is called Quantum AI. Like any disruptive technology, Quantum AI carries both… Read more: The Advantages and Disadvantages of Quantum AI
- How to Save Money with AI: A Practical Guide
Artificial Intelligence (AI) is transforming not only industries but also personal finance. Beyond hype, AI tools can directly help you save money, cut waste, and make smarter everyday decisions. Here are seven practical ways to use AI for financial savings: 1. Smarter Shopping AI-powered apps and extensions automatically find coupons, discounts, and cheaper alternatives online.… Read more: How to Save Money with AI: A Practical Guide - My Experience at the First Alexandria Quantum Hackathon
Today, I had the incredible opportunity to attend the first Alexandria Quantum Hackathon — a landmark event in Egypt and the wider region dedicated to quantum computing education and innovation. The event was hosted at the iconic Bibliotheca Alexandrina, making it even more inspiring to witness the future of computing being discussed in such a historic place… Read more: My Experience at the First Alexandria Quantum Hackathon
