Geschwindigkeitsmessstrecke mit Arduino

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen


Author: Syed Rafsan Ishtiaque
Category: Part of Main Internship
Duration: 02.05.2023 - 31.05.2023
Supervisor: Prof. Dr.-Ing Ulrich Schneider


Objective

Developing the speed measuring unit for any car project

Requirement

Tabelle 1: Functional Requirement
ID Topic Checked by Date Comment (if any)
1 Sensors measuring data M.E. 13.10.2022
1 Sensors measuring data M.E. 13.10.2022
1 Sensors measuring data M.E. 13.10.2022
1 Sensors measuring data M.E. 13.10.2022
5 Der Sensor soll die Entfernung zum Ball korrekt erfassen. Marius Erdmann 13.10.2022 Niklas Reeker 14.10.2022
6 Der Arduino soll den Servomotor ansteuern. Marius Erdmann 13.10.2022 Niklas Reeker 14.10.2022
7 Es soll ein passender Regler ausgewählt werden. Marius Erdmann 13.10.2022 Niklas Reeker 14.10.2022
8 Die gewählte Regelung muss passend parametriert werden. Marius Erdmann 13.10.2022 Niklas Reeker 14.10.2022
9 Die LED soll eine visuelle Rückmeldung geben, wenn der Ball in der Mitte ist. Marius Erdmann 13.10.2022 Niklas Reeker 14.10.2022

Table 2 checks Non-Functional Requirements.

Hardware

Sensor

Sharp 2D120X F 09

The Sharp distance measuring sensor is used to determine the speed/ velocity of the car unit. In this case, two identical sensors were used. According to the manufacturer SHARP [1], the range of the sensor is 4 cm to 30 cm, typical response time apprx. 39 ms, typical start up delay apprx. 44 ms, Average Current Consumption: 33 mA. The operating temperature is -10°C to 60°C, so that is ideal for this project as it is initially an indoor project. according to the stamp on the sensor, the manufacturing date was September 2016. According to the data sheet, the sensor should be mounted on any frame in such way that it gives the optimum result. For that the general instructions are available on the Data Sheet [1].

Display

LED Based 8 segment display

A simple LED based 8 segment display was implemented for the project last time. For reference, the LED tutorial [2] guide for Micro-controller was used. But it had limitation. So we are now upgrading the display with C547B transistor [3] . An initial model is developed with C547B transistor. The test run is not done yet. The hardware setup is archived in the data base.

[Update]
1. The circuit for LED display worked. It was tested for one segment, consisting two LED. The supply voltage was 5V, base resistor 1K ohm, collector resistor 470 Ohm.
2. We finalized the complete circuit setup for the LED display. But we will now implement a LCD display. The reason for doing that, a digital LCD display will enable us to showcase more data related to the speed tracking sensor. Also the data can be transferable and possible to store it for future reference.

LCD Display Blue with I²C

The LCD display we will use is QAPASS LCD I²C. This is a variant of the normal LCD display. It is combined with an I²C module [4]. This will enable us to add further feature to the system. The next development of I²C is I³C. Both I²C and I³C were designed as "Controller" and "Target" bus system (previous master & slave bus concept). The two signal lines for I²C are SCL: Serial Clock and SDA: Serial Data line. But we have to consider the distance of the data transmission while using the I²C. The LCD display is functional. It is receiving messages and displaying them. Next step will be optimizing the sensor data and making a robust system.

Future development

Instead of using a led based display we can implement MQTT protocol to get the end result from the sensor in our smartphone with help of raspberry pi. That will allow to record the result more conveniently. During the implementation of MQTT protocol, the raspberry pi module will work as MQTT broker and both Arduino and Smartphone will be MQTT client. The broker will receive sensory data from the Arduino (1st client) and then it will forward the message to the smartphone (2nd client). As the system will only be used to receive the data collected by the sensor and processed by the arduino and not to control the sensor, it will be uni-directional; that means we will opt out the part to control any sensor from the smartphone application.

LCD Display Holder

To mount the LCD on the main structure, we have designed a holder in Solidworks and printed it in 3D printer. The holder model can be updated based on requirements.

Source Code

The arduino code for the sensor and LCD displays are developed and implemented. We used median filters to cancel out/ limit the noise. We will made two separated arrays for the median filter. For each array there will be separate index pointers. So the two sensors data will be filtered out separately, in that way one's noise will not affect the other.
[Update] We are modifying the code so that the speed tracker can measure the speed from both direction

Test Run

We tested our measurement setup the remote controlled car and it worked good for uni-directional way. For bi-Directional, we still are in development phase.

Literature