5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10



STM32 Visual Tracking Car Tutorial 3.9 Camera vision tracking

Posted by Fiona Su on

9.STM32 platform------- Camera vision tracking

1) Preparation

image.png 

 1-1 STM32 expansion board

image.png 

1-2 STM32 smart car

image.png 

1-3  OV7670

2)Purpose of Experimental

After the STM32 MCU is powered on, press the start button next to the PS2 mark, the car will automatically walk the black line. In this experiment, the camera has higher requirements for light. When the car is placed on the black line, you will be able to see the scene captured by the camera by the 0.96-inch OLED screen. If the light is too bright or too dark, there will be some clutter on the camera, which is the black point that does not match the black line. At this time, we have to adjust the light to make sure that only the black line is visible on the screen.

Note! ! ! ! !

After the car is powered on, if the car can't normally patrol the line, then you need to fine-tune the code, you can modify the camera height, angle, camera threshold, servo median, etc. The servo median and camera threshold need to be modified in the program.

3)Principle of experimental

The camera used in this experiment is OV7670. The camera saves the data of the black line track to an array, and then binarizes the data. According to the position of the black line in the image, it can judge the position of the car in the black line track. Finally,  we can calculate the deviation between the car and the black line track, and then calculate the angle of the servo by the PD algorithm to realize the car inspection function.

4)Experimental Steps

4-1 About the schematic

image.png 

4-1 STM32 main control board circuit diagram

image.png 

4-2 OV7670 interface

4-2  According to the circuit schematic:

SID D(OV7670)-----PA11(OV7670)

SID C(OV7670)-----PA12(OV7670)

RCK(OV7670)-----PC6(OV7670)

OE(OV7670)-----PB1(OV7670)

RRST(OV7670)-----PC5(OV7670)

VSVYNC(OV7670)-----PA8(OV7670)

WR(OV7670)-----PC7(OV7670)

WRST(OV7670)-----PB0(OV7670)

D0(OV7670)-----PB8(OV7670)

D1(OV7670)-----PB9(OV7670)

D2(OV7670)-----PB10(OV7670)

D3(OV7670)-----PB11(OV7670)

D4(OV7670)-----PB12(OV7670)

D5(OV7670)-----PB13(OV7670)

D6(OV7670)-----PB14(OV7670)

D7(OV7670)-----PB15(OV7670)

4-3  About the code

Please see the folder named Camera vision tracking in the code folder.

The code of the experiment:  9.Camera_vision_tracking.rar

STM32 Visual Tracking Car Tutorial Overview

2.Development environment

3.Experimental tutorial

4. About battery

5. About installation

Download

Buy the STM32 Visual tracking robot car

 

0 comments

Leave a comment

Please note, comments must be approved before they are published