Arduino Light Sensor – Circuit and Code Example

This Arduino Light sensor circuit is a simple example that shows you how to connect light sensors such as photoresistors, photodiodes, and phototransistors, to an Arduino.

In this quickstart guide, you’ll learn how to connect a photoresistor to an Arduino board and read out the voltage. You’ll first use the Serial Monitor to learn about how the light sensor behaves, then you build a circuit that automatically turns on a light when it gets dark.

This is a great practice circuit when you’re learning Arduino. The code is straightforward and the light sensor connections are simple.

Parts Needed

* A photodiode or phototransistor will also work.

Arduino Button – Circuit and Code Example

This Arduino button circuit is a simple example that shows you how to connect buttons to an Arduino.

In this quickstart guide, you’ll learn how to connect a button to an Arduino board and read a HIGH or LOW depending if the button has been pushed or not. You’ll use the Light-Emitting Diode (LED) that is included on the board to turn on and off with the button so that you can verify that your button press code is working properly.

This is a great practice circuit to build as you’re learning Arduino. The code is straightforward and the connections are simple.

Parts Needed

  • Arduino Uno
  • Breadboard (and some breadboard wires)
  • Resistor 10 kΩ (R1)
  • Resistor 470 Ω (R2)
  • Pushbutton or Switch
  • Wires

Arduino Button Circuit

To connect a button to an Arduino, you’ll need a pull-down or a pull-up resistor. This is to make sure that when the button is not pushed, it has a defined value. In this example, we’re using a pull-down resistor of 10 kΩ.

Arduino Potentiometer – Circuit and Code Example

This Arduino Potentiometer circuit is a simple example that shows you how analog inputs work, and how you can use the Serial Monitor to learn about what is going on inside the chip.

In this quickstart guide, you’ll learn how to connect a potentiometer to an Arduino board and read out the voltage. This is a great practice circuit when you’re learning Arduino. The code is straightforward and the potentiometer connections are simple.

Parts Needed

Arduino Potentiometer Circuit

To connect a potentiometer to an Arduino, connect the middle pin of the potentiometer to an analog input pin on the Arduino. Then connect the outer pins to 5V and GND.

What is Arduino and How Do I Get Started?

Arduino is a microcontroller board that makes it really easy to program electronics. It’s an easy way to get started with microcontrollers that I highly recommend since it lets you jump right into the code and do stuff from the start.

You can use it both for building simple things like a blinking LED – and advanced stuff like building an internet-connected robot. With Arduino, it’s simple to build really cool electronics projects without learning a bunch of theory. And it’s fun!

It has several inputs and outputs that are controlled by simple commands that you write into a program on your computer.

Arduino UNO board

Arduino Blink LED – Circuit and Code Example

The Arduino blink LED circuit is a simple circuit that works great for starting to learn Arduino. Both the code and the connections are straightforward so that you can understand it with little to no background.

In this quickstart guide, you’ll learn how to connect an LED to an Arduino board and make it blink.

Parts Needed

Arduino Blink LED Circuit

To connect an LED to an Arduino, you need a resistor in series with the LED. This is to limit how much current the LED pulls out of the Arduino pin. The value isn’t crucial but should be between 220 Ω and 1000 Ω.

Arduino Laser Module: Connecting KY-008 to Arduino

In this tutorial, you’ll learn how to connect an Arduino laser module to Arduino. I’ve used the KY-008 as an example, but most low-power laser modules will work the same way.

Blinking laser module with Arduino

Table of Contents:

The KY-008 Arduino Laser Module

The KY-008 is a laser transmitter module that creates a dot-shaped laser beam that can be used as a laser pointer or to create mini laser shows. It is compatible with Arduino, Raspberry PI, ESP32, and other popular microcontrollers.

From Arduino Prototype to Manufacturable Product

The Arduino is an ideal platform for proving your product concept. However, there is still a lot of engineering work required to turn it into a product that can be manufactured and sold. The best way to progress from an Arduino prototype to a consumer product that is ready for sale is to use the

Club de Arduino – Week 5: Finishing the Robot

Thomas was right. It was impossible to get anyone to do anything in December in Medellin. So I continued on my own.

There was one challenge left before I could assemble it all and program the robot: The ultrasonic sensor.

I hadn’t tested it yet, so I had no idea how well it would work.

Club de Arduino – Week 4: Moving Back and Forth

This week we got a new member. So we revised what we’ve done so far with our new member:

The first week we looked at different robot platforms. We wanted to be able to go forward, backward, and make turns. And we wanted it as cheap as possible. We looked at different platforms at the local store, then settled for one with three wheels, three levels and two motors.

Club de Arduino – Week 3: H-bridge and the Bluetooth

Robot platformWe made progress on our robot this week! Check out the video at the end of this post.

This is what happened:

During this week I figured out that our H-bridge circuit did not work as intended.

The problem was the TIP12x transistors. They have a huge voltage drop from collector to emitter of 2V. With two of them in the H-bridge design, there was only 1V left for the motor.

I thought the problem was the design. That we needed to increase the current or something to reduce the voltage, but I was unable to do it.

Club de Arduino – Week 2: Building an H-Bridge

H-bridge prototype on breadboardToday we tried to build an H-bridge to control the motors.

An H-bridge is a circuit that makes it easy to control a motor to go backward or forward, for example from an Arduino.

We used TIP120 and TIP127 transistors and built the following circuit using 5V as VCC:

Club de Arduino – Week 1: Initial meeting and planning

We started out as a group of three people.

Eduardo, Jefferson, and me.

Today, we discussed what to build.

We wanted to build something that would be fun, and that we could finish within the time frame I’m going to stay here (~2 months).

And it should be based on an Arduino.

Jefferson wanted to build a CNC mill.

But such a machine is a bit complex, so we decided to discard that for now.

Then Eduardo suggested building a sumo robot.

How to build a robot – Club de Arduino

It was sunny and hot.

I was wearing a backpack and I could feel the sweat building up on my back.

But I had to walk fast.

Because I was late.

And because the locals had told me to be careful in the center.

I had emailed with Thomas, the founder of the makerspace Göra, before coming here.

We had discussed electronics workshops but decided that it would be better to meet in person to figure out the details.

I did not know what to expect.

Across the street, I saw it.

Arduino oscilloscope with 7 lines of code

The Updated Arduino OscilloscopeIn the video below I will show you how to build an Arduino oscilloscope in 2 minutes using only 7 lines of code.

This is possible because of an update in the Arduino software.

New to Arduino? Check out What Is Arduino?

In the newest version of the Arduino software, there’s a tool that makes it super easy to build a simple oscilloscope!

It’s called Serial Plotter and it works like this:

It listens on a serial port, and it plots every number that it sees.

That means, to create an oscilloscope, all you need to do is to write code that prints out the voltage value from an analog input, and the arduino plotter will take care of the rest.

I only used 7 lines of code to make this work!

A Really Simple Arduino Oscilloscope Tutorial

Arduino Oscilloscope

This Arduino oscilloscope is perfect if you need an oscilloscope right now, but all you have is an Arduino.

Update: There’s an even easier way to do this now. Check out my new article on how to build an Arduino oscilloscope with 7 lines of code.

I needed an oscilloscope to debug my Radar Arduino library.

The code worked perfectly when it was not in “Arduino library”-form. But when I modified it into a library, it just didn’t work at all.

Since the radar module (from https://www.xethru.com) was using the UART, I didn’t have any way of checking what was going on.

So I needed an oscilloscope to check if there was actually any action on the UART lines.