PROGRAMMING SCHOOL
Arduino Uno-F5 / T5 (F/T)
1. I2C - ULTRASOUND SENSOR 5v18. ULTRASOUND SENSOR (DIGITAL)
2. LIDAR - laser distance sensor19. COLOR SENSOR - BLACK LINE
3. STEP MOTOR20. COLOR SENSOR - COLORS
4. I2C - LCD 2 x 1621. MAGNETIC SENSOR (DIGITAL)
5. CAR + ULTRASONIC SENSOR22. HEAT SENSOR (ANALOGUE)
6. BARRIER: Photo sensor + Micro Switch23. IR SENSOR (ANALOGUE)
7. I2C COMMUNICATION24. IR SENSOR (DIGITAL)
8. GPS + LCD display 16x2 (2)25. DC MOTOR - SPEED CONTROL (ANALOGUE)
9. GPS + LCD display 16x226. DC MOTOR - TWO WAYS ROTATION (DIGITAL)
10. LED light - Audio sensor27. DC MOTOR - ONE WAY ROTATION (DIGITAL)
11. COMMUNICATION - NRF24L0128. DC MOTOR (DIGITAL)
12. ENCODER MOTOR - HALF STEP - BETTER PRECISION29. PHOTO SENSOR - LED LIGHT (ANALOGUE)
13. ENCODER MOTOR - STEP - LESS PRECISE30. PHOTO SENSOR - LED LIGHT (DIGITAL)
14. RX - TX COMMUNICATION (UART) (SOFT)31. LED LIGHT - MICRO SWITHCH (ANALOGUE)
15. RX - TX COMMUNICATION (UART) (HARD)32. LED LIGHT (ANALOGUE)
16. SERVO MOTOR33. LED LIGHT - MICRO SWITCH (DIGITAL)
17. ULTRASOUND SENSOR (ANALOGUE)34. LED LIGHT (DIGITALY)

I2C - ULTRASOUND SENSOR 5v
Uno_spoj_35.jpg

I2C ultrasonic sensor connected to 5V. The sensor measures the distance in millimeters. For example, the LED lights up when the sensor detects an obstacle at a distance of less than 100 mm.

LIDAR - laser distance sensor
Uno_spoj_34.jpg

LIDAR - laser sensor for reading distances. The laser sensor is more accurate than the ultrasonic one. Distances can be measured in millimeters. Example of detecting a distance of less than 100 mm by lighting a red LED.

STEP MOTOR
Uno_spoj_33.jpg

Example of stepper motor control in FULL step mode and HALF step mode. The speed is adjusted with the delay command. For this example, we used a motor that runs at 5V and supports a maximum of 180 steps for full speed. A step counter should be placed in the program for accurate control. Stepper motors are big consumers and care should be taken not to draw too much electricity as the drivers will get very hot. We use a voltage of 5V to power the shield and Uno.

I2C - LCD 2 x 16
Uno_spoj_32.jpg

Display data on LCD. We use the LCD library to communicate with. As an example, we made a timer, showing minutes and seconds.

CAR + ULTRASONIC SENSOR
Uno_spoj_31.jpg

Car avoiding obsticles with support of ultrasonic sensor. Turn left or right decides with RANDOM function. Motors are controled with PWM ( analogwrite()) control. Right motor ( look from back side ) is connected to outputs 10 and 11. Left motor on outputs 6 an 9. Red light is connected to output 3 and green on output 5. Ultrasonic sensor is connected to 5V supply. Signal wire are connected to input 0 (black) and input 1 (blue). On Uno-F5 signal wire are connected to input 2 (black) and input 7 (blue). If you use Uno-F5, then do not forget to change this input numbers in program.

BARRIER: Photo sensor + Micro Switch
Uno_spoj_30.jpg

Barrier open when light source is cut. After two seconds, barrier start to close. DC motor is connected to outputs 3 and 5. Sensor light is connected to output 9. Photo sensor is connected to input A5. Micro switch ,under the motor, is connected to input A0 and Micro swithc under barrier on input A2.

I2C COMMUNICATION
Uno_spoj_29.jpg

In this example, we use the PCF8574 8 bit I / O module for signal reading. If we use PCF8574 as an input module, through eight I / O pins the signals are converted to one 8 bit value that we can read. Alternatively, we can use it as an output module, but this will be shown in another example. Module address is 0x20. The values we read (calculated) are 1 and 2. The switch gives a value of 1 and the photo sensor 2.

GPS + LCD display 16x2 (2)
Uno_spoj_28.jpg

The GPS module is connected to the Uno-F5. Module is connected to a 5V output power supply. Communication is serial (TX-RX) 9600 bps. The example shown shows the GPS position (longitude, latitude). In addition to position information, the GPS module also sends the current time.

GPS + LCD display 16x2
Uno_spoj_27.jpg

The GPS module is connected to the Uno-F5. Module is connected to a 5V output power supply. Communication is serial (TX-RX) 9600 bps. The example shown shows the GPS position (longitude, latitude).

LED light - Audio sensor
Uno_spoj_26.jpg

The example shows the control of the LED light via an audible signal (beep, applause, ...).

COMMUNICATION - NRF24L01
Uno_spoj_25.jpg

Two Arduino UNO moduls with NRF24L01 modul. Sending and reciving data. Program samples are for two LEDs (red and green) and two switches. If you use Uno-F5, not forget to change numbers of INPUTs on which are switches connected (SEND program).

ENCODER MOTOR - HALF STEP - BETTER PRECISION
Uno_spoj_24.jpg

We count the state changes (values 1 and 0). This method is better accurate than the previous one (STEP). The number of impulses we will count depends on the program itself. If the program only controls the engine, or still performs other operations. In the second case, especially at higher engine speed, the program will not be able to read all pulses.

ENCODER MOTOR - STEP - LESS PRECISE
Uno_spoj_23.jpg

We only count impulses (value 1). So we need to put a little pause to prevent multiple sensor readings. This method is less precise. The number of impulses we will count depends on the program itself. If the program only controls the engine, or still performs other operations. In the second case, especially at higher engine speed, the program will not be able to read all pulses.

RX - TX COMMUNICATION (UART) (SOFT)
Uno_spoj_22.jpg

In this example, we use software serial communication. We can use any "INPUT" pins for communication. Software communication does not interfere with program loading. Remember, in addition to connecting the TX -> RX and RX -> TX outputs to the interfaces, connect the GND -> GND. In the example, there are two programs, one for sending and the other for receiving data.

RX - TX COMMUNICATION (UART) (HARD)
Uno_spoj_21.jpg

In this example, we use serial communication (0 and 1), which is also used by Arduino UNO to upload programs. This means that our connection must be disconnected while the program is loading. Otherwise, loading will be disabled. Remember, in addition to connecting the TX -> RX and RX -> TX outputs to the interfaces, connect the GND -> GND. In the example, there are two programs, one for sending and the other for receiving data.

SERVO MOTOR
Uno_spoj_20.jpg

Servo motor control example. Turning the servo motor lever by 45 and 90 degrees.

ULTRASOUND SENSOR (ANALOGUE)
Uno_spoj_19.jpg

Using the ultrasonic sensor, we can measure the distance to the object in front of the sensor. Depending on the sensor, larger or smaller maximum distances can be read. The LED illuminates less when the distance from the sensor to the subject is smaller and vice versa.

ULTRASOUND SENSOR (DIGITAL)
Uno_spoj_18.jpg

With the help of an ultrasonic sensor we can detect an object when it is at a distance less than the one set in the program (the LED lights up). If the object is at a greater distance, the program will not register it.

COLOR SENSOR - BLACK LINE
Uno_spoj_17.jpg

The readings for white and black are usually different enough, so that with the help of two color sensors we can make robot car that follows the black line.

COLOR SENSOR - COLORS
Uno_spoj_16.jpg

The color sensor reads colors as values (analog). According to the apparent color value, a certain color of the LED lights up. The readings are VERY dependent on the conditions (illumination) and may vary even though the color patterns are the same

MAGNETIC SENSOR (DIGITAL)
Uno_spoj_15.jpg

A magnetic sensor detects a magnetic field. By approaching the sensor to a magnetic field (permanent or electromagnet), the LED lights up.

HEAT SENSOR (ANALOGUE)
Uno_spoj_13.jpg

By heating the thermal sensor to a certain temperature, the LED lights up. We heat the thermal sensor with light bulb.

IR SENSOR (ANALOGUE)
Uno_spoj_12.jpg

By analogous reading of the IR sensor, a white surface can be detected at a distance of several centimeters.

IR SENSOR (DIGITAL)
Uno_spoj_11.jpg

Depending on the IR sensor readout, the LEDs light up. The white surface gives the reading 1 and the black (line) 0.

DC MOTOR - SPEED CONTROL (ANALOGUE)
Uno_spoj_10.jpg

Program, changes the rotation speed of the DC motor. Lower rotation speed, usually means lower engine power.

DC MOTOR - TWO WAYS ROTATION (DIGITAL)
Uno_spoj_09.jpg

Pressing the switch A and B, alternates the direction of rotation of the DC motor (both directions).

DC MOTOR - ONE WAY ROTATION (DIGITAL)
Uno_spoj_08.jpg

By pressing switch, the DC motor starts to rotate in one direction.

DC MOTOR (DIGITAL)
Uno_spoj_07.jpg

The DC motor starts rotating in one direction for 100 ms. It stops for 2 seconds and then repeats the action.

PHOTO SENSOR - LED LIGHT (ANALOGUE)
Uno_spoj_06.jpg

The LEDs light up depending on the value read by the PHOTO sensor.

PHOTO SENSOR - LED LIGHT (DIGITAL)
Uno_spoj_05.jpg

The LEDs light up when the PHOTO sensor is sufficiently illuminated.

LED LIGHT - MICRO SWITHCH (ANALOGUE)
Uno_spoj_04.jpg

By pressing the button, the bright LEDs light up.

LED LIGHT (ANALOGUE)
Uno_spoj_03.jpg

The program slowly increases the brightness of the LED.

LED LIGHT - MICRO SWITCH (DIGITAL)
Uno_spoj_02.jpg

Pressing the switch, the LED lights up.

LED LIGHT (DIGITALY)
Uno_spoj_01.jpg

The LED lights up and goes out at half-second intervals.