Category :Arduino Projects

Byamber

Package List — Starter Learning Kit for Arduino


Authorzied Amazon Seller

Buy from US Buy from CA Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

Packing List

UNO x1
LED Pack(6 x Bright White, 6 x Red, 6 x Yellow, 6 x Green) x1
Push Buttons x5
Positive Buzzer x1
Potentiometer(10kilohm adjustable resistor) x3
Photoresistor(light sensor) x3
TMP36 x1
Tilt sensor x1
Infrared Remote Controller and Receiver(VS1838B) x1
1-digit 7 Segment LED Display(Common cathode) x1
4-digit 7 Segment LED Display(Common cathode) x1
Alphanumeric I2C LiquidCrystal Display(16×2 LCD ) x1
Stepper Motor+Bridge x1
SG90 Micro Servo Motor x1
Resistors Package (20 x 200ohm, 20 x 1Kohm, 20 x 10Kohm, 5 x 1Mohm) x1
Jumper Wires Pack(M/M Jumper x 20,F/F Jumper x 20, M/F Jumper x 20) x1
Full Size Breadboard x1
A to B USB Cable x1
Capacitors (100nF x 5, 10nF x 5)
74HC595 x 2
555 Timer IC
2-Channel Relay Module
PIR Motion Sensor
Sound Detection Sensor
Ultrasonic Sensor HC-SR04
DHT11 Sensor
8×8 LED Matrix
RGB LED
Battery Clip
Acrylic test stand
Phillips screwdriver
Byamber

Graphical Programming Tutorial for Arduino – Basic Car Robot

Introduction

In the previous course, we learned how to use the Arduino development board and how to drive a DC motor. Now, we will use this kit to build a basic car robot. We will burn the pre-edited program to the UNO board. Once the robot gets power, it will go straight or rotate along a set trajectory.

Preparations

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • DC Motors x 2
  • L293D x 1
  • Wheels x 2
  • Breadboard
  • Acrylic experimental platform
  • Screws/Screw caps
  • Metal Motor Holders
  • Universal wheel
  • Battery Box with DC Connector
  • Batteries(7~12V DC)
  • F/M jumpers
  • USB Cable x 1
  • PC x 1

Hardware Installation

Place the acrylic platform as shown below. Fix the UNO board and breadboard to the acrylic platform.

Turn the acrylic platform over and install the universal wheel.

Note: When installing the screw, the force should be uniform so as not to damage the acrylic plate.

Install the corresponding screws.

Fix the metal motor holders.

Install wheels

Fix DC motor to the acrylic platform.

Extend the wire from the hole in the motor。

Flip the acrylic platform and insert the L293D chip into the breadboard。

Byamber

Graphical Programming Tutorial for Arduino – Simple Number counter

Introduction

This project demonstrates how you can use Arduino to count the number of people that come in and out of a mall using two sensors。

Sensors need to be placed at the entrance and exit points of the park to work as expected. Basically, you increase the number of times everyone comes in, and decrease the number of times they go out.

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • I2C LCD 1602 Display x 1
  • PIR Motion Sensors
  • F/M jumpers
  • USB Cable x 1
  • PC x 1

Connection

Before you write the code you have to build the circuit. To do this, connect the LCD pins as follows:

Osoyoo UNO LCD1602
GND GND
5V VCC
A4 SDA
A5 SCL

Note:

  • For Mega2560: the I2C connections are on SDA=20 and SCL=21. So go ahead and wire these up, along with the two power leads to the 5V and GND terminals.
  • For Arduino Leonardo: connect SDA to digital pin 2 and SCL to digital pin 3 on your Arduino.

Overhere, we connect the first PIR sensor to D2 of the UNO board, the other to D3. From sketches of Fritzing, you can look at the connections to be done in a simpler way:

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

Click Save aftogramming is done. Select the board type and serial port to upload the code to the UNO board.

Running Result

Every visitor comes in(D2 triggers interruption), the number of parks on the display is increased by one. Every time a visitor goes out(D3 triggers interruption), the number of parks on the display is reduced by one..

Byamber

Graphical Programming Tutorial for Arduino – IR Track Sensor

Introduction

The OSOYOO IR Track Sensor is essentially an IR LED and an IR detector. It works by transmitting a beam of IR light downward toward the surface. In this lesson, we will show you how the IR Track Sensor works and how to use it with the Osoyoo Uno board.

Preparations

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • IR Track Sensor x 1
  • Jumpers
  • USB Cable x 1
  • PC x 1

About OSOYOO IR Track Sensor

The OSOYOO IR Track Sensor is essentially an IR LED and an IR detector. The IR emission tube of track sensor constantly emits infrared light. Since the black absorbs light, when the IR emission tube shines on a black surface, the reflected light is less and so less IR rays are received by the receiving tube. It indicates the resistance is large; then the comparator outputs high and the indicator LED goes out. Similarly, when it shines on a white surface, the reflected light becomes more. So the resistance of the receiving tube is lower; thus, the comparator outputs low and the indicator LED lights up.

When the infrared transmitter emits rays to a piece of paper, if the rays shine on a white surface, they will be reflected and received by the receiver, and pin D0 will output low level; If the rays encounter black lines, they will be absorbed, thus the receiver gets nothing, and pin D0 will output high level.

This acts like a simple switch when it gets close to a white / black object. You can adjust the sensitivity with the potentiometer. It uses a LM393 Comparator chip and track sensor for clean outputs.

Sensitivity: About 1 inch (2.5cm) from white paper, about 1 cm from a person’s finger.

Examples

IR LINE TRACKING

In this experiment, we will use an IR track sensor module and the on-board LED to build a simple circuit to make a tracking line. Since the LED has been attached to pin 13, connect the pin D0 to digital pin 2 of the Uno board. When the tracking sensor detects reflection signals (white), the LED will be on. Otherwise, it will be off (black line).

Note: The sensitivity of the infrared sensor is adjustable – you may adjust it by the potentiometer.

CONNECTION

Build the circuit as below digram:

OSOYOO UNO Track Sensor
+5V VCC
GND GND
D2 D0

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

Select the serial device of the Arduino board from the COM menu. Upload the code to the UNO board.

RUNNING RESULT

A few seconds after the upload finishes, set it down on a piece of paper with a dark line (at least ½” wide). You may use a Sharpie Marker, electrical tape, or dark paint. When the module gets on a black line, it output high and the corresponding LED stays off, the Serial Monitor output: “Detect: Black!”;

when it meets a white area, it outputs low and the LED lights up, the Serial Monitor output: “Detect: White!”.

Note: The black line should be wider than the IR track sensor.

Byamber

Graphical Programming Tutorial for Arduino – Electronic Candle

Introduction

LED candles are very common these days. It’s easy to see the attraction — there’s no fire danger and they never need to be replaced (just batteries). But there’s such a wide variation in price and quality that it’s hard to know what to purchase. Some store-bought candles flicker very realistically, others just seem to blink. Some use plain white LEDs, some look like real flames.

In this lesson, we’ll show you how to use sound sensor, light sensor and LED with OSOYOO UNO to build an electronic candle.

Connection

You connect the components as shown in the diagram below. Connect the LED to pin 9 of the Arduino. The 200 ohm resistor is current limiting resistor. One lead of the photo resistor is connected to 5V, the other to one lead of the 10k ohm resistor. The other lead of the 10k ohm resistor is connected to ground. This forms a voltage divider, whose output is connected to pin A0 of the Arduino. Use the A1 as the analog pin to connect with the sound sensor’s A0 pin.

As the light impinging on the photoresistor gets stronger, the resistance decreases, and the voltage output of the divider increase. The reverse happens, when the impinging light gets weaker.

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

Click Save aftogramming is done, then upload the code to the UNO board.

Running Result

When the brightness is dark, the candle “lights up”, the flame flashes, and the sound of blowing the candle, the candle extinguishes.

Byamber

Graphical Programming Tutorial for Arduino – Acousto-optic Light Control

Introduction

In this lesson, we will show how to use the photoresistor and sound sound sensor to work with the OSOYOO UNO board to control an LED. This project effectively simulates the acoustooptic light control in our daily life. In the daytime, when the corridor is not dim in the sunshine, even if the sound is loud, the corridor light will not turn on; in the night, as long as the sound exceeds the set value, the light will turn on.

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • Breadboard x 1
  • Photoresistor x 1
  • Sound Sensor Module x 1
  • 10k ohm resistor x 1
  • 200 ohm resistor x 8
  • LED x 8
  • Jumpers
  • USB Cable x 1
  • PC x 1

Connection

You connect the components as shown in the diagram below. Connect the LED to pin 9 of the Arduino. The 200 ohm resistor is current limiting resistor. One lead of the photo resistor is connected to 5V, the other to one lead of the 10k ohm resistor. The other lead of the 10k ohm resistor is connected to ground. This forms a voltage divider, whose output is connected to pin A0 of the Arduino. Use the A1 as the analog pin to connect with the sound sensor’s A0 pin.

As the light impinging on the photoresistor gets stronger, the resistance decreases, and the voltage output of the divider increase. The reverse happens, when the impinging light gets weaker.

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

Click Save aftogramming is done. Select the board type and serial port before uploading. For instause a Uno board, just select Arduino/Genuino Uno: if you use a Mega2560, select Arduino/Genuino Mega or Mega2560.

Select the serial device of the Arduino board from the COM menu. This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.

Next,upload the code. If the uploading fails, check and correct the code according to the prompts.

Finally, the staus will change to ‘Upload success!’.

Running Result

A few seconds after the upload finishes, when the light is dim and the sound in the environment is louder than the set value, the LED will be lit up.

Byamber

Graphical Programming Tutorial for Arduino – Infrared Remote Control the Lamp

Introduction

In this lesson, we will show how to use the IR control an LED. When we press the “OK” button, the LED will be turned on, and when we press the “OK” button again, the LED will be truned off.

Preparations

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • Infrared Receiver x 1
  • Remote Controller x 1
  • LED x 1
  • 200 ohm Resistor x 1
  • Breadboard x 1
  • Jumpers
  • USB Cable x 1
  • PC x 1

Connection

Build the circuit as below:

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

Click Save aftogramming is done. Select the board type and serial port before uploading. For instause a Uno board, just select Arduino/Genuino Uno: if you use a Mega2560, select Arduino/Genuino Mega or Mega2560.

Select the serial device of the Arduino board from the COM menu. This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.

Next,upload the code. If the uploading fails, check and correct the code according to the prompts.

Finally, the staus will change to ‘Upload success!’.

Running Result

A few seconds after the upload finishes, press the “OK” button of a remote controller, the LED attached connected to D12 will be light up. Then press “OK” again, and the LEDs will go out.

Byamber

Graphical Programming Tutorial for Arduino – IR Remote Receiver Module and Controller

INTRODUCTION

IR, or infrared, communication is a common, inexpensive, and easy to use wireless communication technology. IR light is very similar to visible light, except that it has a slightlty longer wavelength. This means IR is undetectable to the human eye – perfect for wireless communication. For example, when you hit a button on your TV remote, an IR LED repeatedly turns on and off, 38,000 time a second, to transmit information (like volume or channel control) to an IR photo sensor on your TV.

This tutorial will first explain the inner workings of common IR communication protocols. Then we will go over three examples that will allow you to transmit and receive IR data using an Arduino. In this example, we will read incoming IR data from a common remote control using the 1838B IR photo sensor.

Preparations

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • Infrared Receiver x 1
  • Remote Controller x 1
  • Jumpers
  • USB Cable x 1
  • PC x 1

About the IR

WHAT IS IR?

Infra-Red light is actually normal light with a particular colour. We humans can’t see this colour because its wave length of about 950nm is below the visible spectrum. That’s one of the reasons why IR is chosen for remote control purposes, we want to use it but we’re not interested in seeing it. Another reason is because IR LEDs are quite easy to make, and therefore can be very cheap, thus making it ideal for us hobbyists to use IR control for our own projects.

We need to konw there are many more sources of Infra-Red light. The sun is the brightest source of all, but there are many others, like: light bulbs, candles, central heating system, and even our body radiates Infra-Red light.

A common modulation scheme for IR communication is something called 38kHz modulation. There are very few natural sources that have the regularity of a 38kHz signal, so an IR transmitter sending data at that frequency would stand out among the ambient IR. 38kHz modulated IR data is the most common, but other frequencies can be used.

When you hit a key on your remote, the transmitting IR LED will blink very quickly for a fraction of a second, transmitting encoded data to your appliance.

If you were to hook an oscilloscope up to your TV remote’s IR LED, you would see a signal similar to the one above. This modulated signal is exactly what the receiving system sees. However, the point of the receiving device is to demodulate the signal and output a binary waveform that can be read by a microcontroller. When you read the OUT pin of the VS1838B with the wave from above, you will see something like the second.

Modulation

As everything that radiates heat, also radiates Infra-Red light. Therefore we have to take some precautions to guarantee that our IR message gets across to the receiver without errors.Modulation of the signal on a carrier frequency is the answer to make our signal stand out above the noise. With modulation we make the IR light source blink in a particular frequency. The IR receiver will be tuned to that frequency, so it can ignore everything else.

In the picture below you can see a modulated signal driving the IR LED of the transmitter on the left side. The detected signal is coming out of the receiver at the other side.

(Thanks to SBProjects.com for the gif and excellent IR resource!)

TECHNICAL DETAILS OF VS1838B IR RECEIVER

  • Model Number : VS1838B;
  • Working Voltage :2.7V to 5.5V
  • Reception Distance : 18M;
  • Reception Angle : ± 45 Degree;
  • Low Level Voltage : 0.4V
  • High Level Voltage : 4.5V;
  • Body Size : 7 x 7 x 5mm / 0.27″ x 0.27″ x 0.2″(L*W*T);
  • Pin Length : 22.5mm / 0.88″
  • Pitch : 2mm / 0.08″;

THE PINOUT FOR VS1838B IR RECEIVER:

ABOUT THE IR CONTROL

Infrared remotes are still the cheapest way to wirelessly control a device. We have designed the remote to be small, very simple, and low-cost.There are many different IR remote controls. all of these may have different encoding methods and number of physical buttons, and different codes received when a button is pressed.

Examples

READ CODES FROM IR REMOTE

This example will show you how to read IR remote codes from any IR remote using the VS1838B IR receiver and an Arduino. Once you can receive codes from individual button presses, your remote control and Arduino become a general purpose, short range, communication interface!

Connection

Build the circuit as below:

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

Drag out the IR Control block from the Communications.

Connect the IRreceive PIN to D3.

Click Save aftogramming is done. Select the board type and serial port before uploading. For instause a Uno board, just select Arduino/Genuino Uno: if you use a Mega2560, select Arduino/Genuino Mega or Mega2560.

Select the serial device of the Arduino board from the COM menu. This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.

Next,upload the code. If the uploading fails, check and correct the code according to the prompts.

Finally, the staus will change to ‘Upload success!’.

Running Result

The sketch will automatically decode the type of remote you are using and identify which button on your remote is pressed. Open the Serial Monitor in the Mixly at 9600 bps and hit different buttons on your remote.

The Serial Monitor displaying random button presses on my remote. Different buttons show different codes:

If you use the sketch above and count the 17 buttons from left to right and top to bottom, the codes received are these: (NOTE: Receiving “FFFFFFFF” means “repeat” if you hold the button down.)

1 FFA25D
2 FF629D
3 FFE21D
4 FF22DD
5 FF02FD
6 FFC23D
7 FFE01F
8 FFA857
9 FF906F
10 FF6897
11 FF9867
12 FFB04F
13 FF18E7
14 FF10EF
15 FF38C7
16 FF5AA5
17 FF4AB5

Byamber

Graphical Programming Tutorial for Arduino – Use the Push-Button as a Switch

Introduction

After the tutorial Using a Button, you might think, if we want to turn on the LED in this way, the hand cannot leave button, it is not convenient.How to control the lights as normal , click on the light, then press out? We can improve the program, which can realize the result that will modify the program for the following code, and then upload to the Osoyoo Arduino board.

Preparations

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • Breadboard x 1
  • Switch Button x 1
  • 10k ohm resistor x 1
  • M/M jumpers
  • USB Cable x 1
  • PC x 1

Connection

Although the bodies of the buttons are square, the pins protrude from opposite sides of the button. This means that the pins will only be far enough apart when they are the correct way around on the breadboard.Build the circuit as below:

Notice:

Generally, the button is directly connected in an LED circuit in order to turn on or off the LED. This connection is relatively simple. However, sometimes the LED will light up automatically without pressing the button, which is caused by various interferences. In order to avoid these external interferences, a pull-down resistor is used, that is, to connect a 1K–10KΩ resistor between the button port and GND. It is used to consume external interferences while connected to GND for as long as the button switch is turned off.

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

In this program, we use the “setup” block. Compared with the program under it, the “setup” block only executes once during the whole process of running the program.

In the “setup” block, we use the module that defines variables. The name of the variable is state, which is a Boolean variable, that is, its value has two kinds of “high” and “low”.

Click Save aftogramming is done. Select the board type and serial port before uploading. For instause a Uno board, just select Arduino/Genuino Uno: if you use a Mega2560, select Arduino/Genuino Mega or Mega2560.

Select the serial device of the Arduino board from the COM menu. This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.

Next,upload the code. If the uploading fails, check and correct the code according to the prompts.

Finally, the staus will change to ‘Upload success!’.

Running Result

After the program is compiled and uploaded, you can achieve: click the button to turn on the LED, and then press this button, the LED will be turned off.

Byamber

Graphical Programming Tutorial for Arduino – Digital Dice

Introduction

Dice is a squire type solid box which contains 6 different numbers on all of its sides. We throw dice on a surface to get a random number while playing the games. In this lesson, we will build a dice that is shaken by holding the button in and thrown by releasing the button. The shake, throw and number thrown are animated and displayed on a seven segment display. A 74HC595 IC is used to interface the 7-segment display to the Arduino, using only 3 Arduino digital pins.

Preparations

HARDWARE

  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • One digit 7-Segment LED Display x 1
  • 200 ohm Resistor x 8
  • 10k ohm Resistor x 1
  • Push Button x 1
  • 74HC595 x 1
  • Breadboard x 1
  • Jumpers
  • USB Cable x 1
  • PC x 1

SOFTWARE

  • Arduino IDE (version 1.6.4+)

Find more information about interfacing the 74HC595 IC to the Arduino in the Arduino Lesson – 74HC595 article from the Osoyoo website. The circuit diagram uses the same Arduino pins as this article. If you want to get more info about the switch button please check the Arduino Button example, more info about the one digit 7-segment LED display please check the Arduino Lesson – one digit 7-segment LED display.

Connection

The circuit diagram is shown below. The seven segment display could have been directly interfaced to the Arduino, but by using the 74HC595, only 3 Arduino pins are used.

CODE PROGRAM

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.Open the Graphical Programming software Mixly and follow the next operations:

Note: The code will be a little long You’re recommended to open the developed code example to check.

Declare the variables and array.

The text list is: 252, 96, 218, 242, 102, 182, 190, 224, 254, 246, 238, 62, 156, 122, 158, 142

This function is to display the number in dataArray[] on the 7-segment display. Pin 12 connected to ST_CP of 74HC595:

Store values read from pin 2.

Check if the pushbutton is pressed. If yes, the corresponding pin is high level, then num adds 1.

If Num >1. clear the valueIs to prevent repeated pressing. So just count it as once no matter how many times you press.

Print the Num on the Serial Monitor:

When the pushbutton is pressed.

Generate a random number between 1 and 7, and show the RandNumber on the 7-segment:

When theres no button (pin 2)pressed, the program stops here, and keeps it displaying the last random number. Then read the state of the button again.

Check if the pushbutton is pressed. If yes, run the code below.

Turn on/off the LED.

Clear the Num.

If the button has not been pressed, show random numbers at 100 microseconds intervals.

Click Save aftogramming is done. Select the board type and serial port before uploading. For instause a Uno board, just select Arduino/Genuino Uno: if you use a Mega2560, select Arduino/Genuino Mega or Mega2560.

Select the serial device of the Arduino board from the COM menu. This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.

Next,upload the code. If the uploading fails, check and correct the code according to the prompts.

Finally, the staus will change to ‘Upload success!’.

Running Result

A few seconds after the upload finishes, you should now see the 7-segment display jump between numbers from 1 to 6. Press the button, and the jumping will slow down until it stops three seconds later. Press the button again, and the process will repeat.