Tag Archives: Arduino

Arduino Tutorial 66: Controlling DC Motor, Speed and Direction with a Remote

IR Control DC Motor
Circuit for IR Remote Control of DC Motor

In this lesson we develop a project that allow Remote Control of the speed and direction of a DC Motor. We use an Arduino Nano, and components from the Elegoo Kit. Also, to facilitate a clean build, we use Straight Jumper Wires.

The motor is connected according to this schematic:

DC Motor Controller
Connection Diagram for a DC Motor Controller using the L293 Control Chip

Also, the remote control receiver is connected as follows: R on Remote to 5V, G on Remote to Ground, and Y on the Remote to Arduino Digital Pin 9. Go back and check out Tutorial 65 if you need more details on the Remote Module Connections.

In this video we will take you step by step through the build and coding for the project.

The code below is the software we developed in the video.

 

Arduino Tutorial 64: Understanding and Using the Infrared (IR) Remote to Control a Project

IR Remote
Simple Demonstration of IR Remote Control of Arduino

The Elegoo Kit contains a simple IR module and remote which allow you to add remote control to your arduino project. In this lesson we show you how to connect the remote, and then how to send signals to the arduino using the remote unit. This video takes you through the process step by step.

The code below will get you started, and then you can expand the code to map all the buttons to simple string commands.

We are building this with parts from our Elegoo Kit , and our actual build is using an Arduino Nano, which allows the project to be built on a single breadboard. You can get the neat jumper wires HERE.

Arduino Tutorial 60: Add a Go Button to your Distance Sensor

Ultrasonic Distance Sensor
This is our completed build of a portable, ultrasonic distance sensor.

In this lesson we add a “GO” button to our portable distance measurement system. Note that from the work done in Lesson 59, we are only left with digital pin 13. The problem is that pin 13 is connected to the on-board diode, so trying to use pin 13 as a button pin will not work.

Never fear we can use one of the analog in pins. To use an analog in pin as the button pin, in the void setup, you need to declare the pin as an INPUT, and then digitalWrite the pin to HIGH. This will connect it to 5V through a pullup resistor. Now you just have to do a digital read to that pin. When button is untouched, you will read a “1”, and when you press the button, you will read a “0”.

We are building this with parts from our Elegoo Kit , so if you get this kit, you will be using the same hardware we are using.

A challenge with this project is to keep the build neat and compact, which is much easier if you use an Arduino Nano, which allows the project to be built on a single breadboard. The build neatness is also facilitated by using small straight jumper wires, which you can get HERE.

This video takes you through the explanation step-by-step:

This is the code used in this project:

 

Arduino Tutorial 59: How To Build a Portable Distance Sensor Ultrasonic Sensor

Ultrasonic Distance Sensor
This is our completed build of a portable, ultrasonic distance sensor.

This Lesson picks up where Tutorial 55 left off. You want to take the basic distance measurement capability you built, and make it portable. In order to make it portable, you will need to add an LCD display, and figure out a way to power it. The easiest way to get portable power is to connect the Arduino to a USB power bank.

The sensor is part of our Elegoo Kit , so if you get this kit, you will be using the same hardware we are using.

A challenge with this project is to keep your build nice and neat, as there are lots of connections, and if any are not completely secure, you will get unpredictable performance in your device. For this build we will be using an Arduino Nano, which allows the project to be built on a single breadboard. You can use the Arduino Uno if you do not have a Nano, and things will work out the same. The build neatness is also facilitated by using small straight jumper wires, which you can get HERE.

The first task will be to lay out your components in preparation for the build. Carefully consider all the connections you will have to make, and then organize so that the connections can be made with minimum confusion. This means minimize the number of crossing wires, and try to have needed connections in the same general area.

The LCD will need to be wired up according to the following Schematic:

Arduino LCD Schematic
This schematic will allow you to connect the LCD to the Arduino

Now, you will also need to connect the HC-SR04 Ultrasonic Sensor.

HC-SR04 PinArduino Pin
VCC5 V
GNDGND
Trigdigital 2
Echodigital 3

This video takes you through the build and programming step-by-step.


In this video we developed the following code: