Arduino Starts With Lighting a Night Light - Getting Started With Arduino

by unikeyic in Circuits > Arduino

16 Views, 1 Favorites, 0 Comments

Arduino Starts With Lighting a Night Light - Getting Started With Arduino

Step9.jpg

If you’re new to Arduino and eager to dive into the world of electronics, this tutorial is your perfect starting point. Focused on building a simple night light, it breaks down essential Arduino basics in a hands-on way—from understanding the motherboard and core components (like LEDs, buttons, and resistors) to assembling and simulating your first circuit. Whether you’re curious about how LEDs light up with a button press or want to explore more advanced ideas like measuring light intensity photoresistor Arduino and using an Arduino light intensity sensor, this guide walks you through each step clearly. No prior experience needed—just a desire to learn and experiment. Let’s light up your Arduino journey!

Supplies

Lately, I've been playing around with Arduino, which is very cool and a great way to learn about electronics. In this tutorial, I will teach you the basics of Arduino, including:

  1. LEDs
  2. Pushbuttons
  3. Potentiometers
  4. Resistors
  5. Measure light intensity photoresistor Arduino
  6. Arduino light intensity sensor

Motherboard

Step2.jpg

The controller can be divided into several simple parts. The colors correspond to the images.

The green box provides power to the Arduino and has the USB cable plugged in.

The orange color provides 5V or 3.3V power to the breadboard and serves as the ground.

The red port is used to power the Arduino when there is no USB connection and the voltage is 7-12V.

Purple is the reset button for the microcontroller.

Light blue is the brain of the operation.

Yellow is the digital pins.

Dark blue is analog.

The turquoise LED indicates the presence of power.

Finally, the cyan TX and RX LEDs blink rapidly when you upload sketches/code.

You don't have to memorize all the names, but the advantage is that everything is ambiguous.

Components

Step3.jpg

A component is anything contained in a circuit. This could be a lamp, a motor, or a potato!

Components have different ways of being presented:

Realistic illustrations are images or drawings of components that look like components.

Schematics use symbols to represent components.

In this section, I will present some of the basic components that will end up being used in our project.

LEDs

Step4.jpg

The image on the left is a schematic, and the picture on the right is the actual schematic.

You will notice that one leg of the LED is longer than the other. The longer leg is called the anode and is connected to the power source, while the shorter leg is called the cathode.

Hint - (Black - usually grounded in the circuit, red+ is the power source.)

What is an LED?

An LED is a diode that lights up when current is passed through it.

LED = Light Emitting Diode

Buttons

Step5.jpg

A button is a switch that will complete the circuit when pressed. Buttons can also be read in a program so that you can start a sequence by pressing a button.

How does this work?

Pushbuttons work by separating two pieces of conductive metal from each other. In the middle of them is another piece of metal which, if pushed down, will complete the circuit.

How is it detected?

When current flows, you can convert it to a digital signal so you can read the current.

Resistors

Step6.jpg

A resistor stops current flow and reduces the output voltage.

How does this work?

Electricity is an energy source. Like all energy, you can convert it to other types of energy. Resistors work by heating up very slightly, therefore converting electricity into heat (a different kind of energy).

Why do we need it?

We need resistors because not all components will run at the same current, because there is too much current.

There are many different colors on resistors!

What are these? The colors on the resistors are a code that tells us how much energy they will absorb from the circuit.

Here's a resistor decoder to help you find this out.

Potentiometers

Step7.jpg

A potentiometer is a component that you can twist to an angle that you can read.

How does this work?

Inside the potentiometer is a round metal disk that sits between the first two legs. The knob in the center is a piece of metal that contacts the ring at the point where it faces the ring.

Finally, the third leg reads the resistance between the two legs and the knob.

All of this leads us to read the angle of the knob.

The Breadboar

Step8.jpg

Breadboards are great for prototyping and do not require soldering.

The breadboard has many horizontal wires. They will act as connectors when the components are inserted.

In the picture above, you can see that the circuit continues only when there is a component between the two strips.

Getting Started

Step9.jpg

Let's get hands-on! Place the Arduino and breadboard on your workbench to start your journey into the world of electronics.

Next, connect the 5V wire to / positive and then ground to - / negative.

You can color the wires, but if you don't, it won't affect the circuit.

Measure Light Intensity Photoresistor Arduino

Step10.jpg
Step11.jpg

To measure light intensity photoresistor arduino, you'll need to connect a photoresistor to your Arduino. A photoresistor changes its resistance based on the amount of light it detects, making it perfect for light-sensitive projects. Connect one leg of the photoresistor to 5V and the other leg to ground, with a resistor in between to create a voltage divider. The junction between the photoresistor and the resistor connects to an analog input pin on the Arduino. This setup allows you to read the changing voltage, which corresponds to the arduino light intensity sensor values.

Buttons

Step12.jpg

You will then need to connect the 220-ohm resistor to the button.

Without a resistor, 5V is too large for the button and LED.

The resistor must also be connected to the positive terminal, as it can be energized.

You can change the resistance of the resistor in the upper right corner as shown.

LED!

Step13.jpg

In this step, the LED is added to the board, which rotates it so that the long leg (anode) is connected to the power supply.

You can rotate the LED in the upper left corner.

Place the wire between the button and the anode leg, then from the cathode to the negative (ground)

The Tinkercad allows you to explore the Arduino without the risk of blowing a circuit!

Now we're all done.

Click Run Simulation, then press the button, and your LED will light up!

Now You Are Done!

Step14.jpg
Step15.jpg

This is a great build that is easy to change or edit. You can even expand it by adding a measure light intensity photoresistor arduino setup to create a night light that automatically adjusts based on ambient light levels using the arduino light intensity sensor.


I hope you had as much fun following this Arduino tutorial as I did creating it. Remember, the world of electronics is yours to explore!