Course 9:

Data acquisition for robots

Collecting data and using the data to make decision is an essential part of robotics. In this course you will learn how to gather sensor data into a database and how to use it.

Intermediate level
Category: Robotics 💬 English

What Will I Learn?

  • Learn to collect sensor data into Text files.
  • Learn to control your robot using Text files.
  • Learn to install a database server.
  • Learn to collect data from the robot into SQL.
  • Learn to control your robot from a database.
  • Learn to use SQL data to make control decisions.


Start this course

Curriculum For This Course

In this lecture you will learn, how to collect sensor data into text files. Your task will be to write code, that will receive events from an IR remote, and will create a text file in a directory for each event. The text will contain data from the event. In this case it will store which button on the IR remote was pressed.
Robot systems are often controlled by other software. Every software can create text files as output. In this lecture you will learn how to control a robot using commands written into a text file. You will set up a directory, where you can place a text file. Your robot will check this directory periodically and if a file appears, it will pick it up, read it and follow the instructions in it.
In this lecture you will learn how to collect information received from a sensor (in our case the ultrasonic distance sensor) and how to save this information into a spreadsheet. The spreadsheet can be opened by Microsoft Excel, WPS Office or any other spread sheet management software. You will also learn to build a carrot measuring device from Lego.
This lecture is about database servers. You will learn, how SQL database servers store information. You will learn how you can connect to such a database server, how you can save, delete and query information. In this lecture you will install a MySQL database server, and you will connect your Ozeki 10 system to it. These skills can be applied to other database servers, such as Oracle, Microsoft SQL server, etc.
Database servers store information in database tables. In order to save information provided by the sensors of your robot into a table, first you need to be able to create a table. In this lecture you will learn about database table creation. You will learn how you can define columns with different data types. You will also learn how to list the already created tables and how to modify a table definition or how to delete a table. You will also learn about the SQL insert and the SQL select commands.
In this lecture you will learn how to send data into a database table from a robot control code written in SNAP. You will use the IR remote and the IR sensor and save the IR remote button press events into a database. You will also set up different tables to store IR beacon angles in the database.
In conveyor line systems and industrial robots, various events can trigger data collection procedures. Saving data is often tied to a detected object or a sensor reading. In this lecture you will build a robot that will read the value of the color sensor when a button is pressed. After the value is read, it will store the color name in a database. This lecture teaches you the most common set up for robot data acquisition systems.
In this lecture you will learn about using database tables with multiple columns. You will define a table with two columns, the first column will store the sensor value, the second will store the time stamp of the measurement. You will also learn how to use functions in your SQL queries. For saving time stamp, you will use the now() function instead of a value received from the robot. You will also how to set a threshold and to save a sensor reading into a database only if the sensor value changes by the defined value.
When you work with databases, it is also important to be able to receive robot control instructions from you database server. In this lecture you will learn how to read a database table periodically and when a robot control command is found how to forward it to your robot.
When reading sensors values in a loop a very large number of data might be collected. To make decision often aggregated values, such as average, spread, etc should be used. In this lecture you will learn how to use the mathematical functions offered by database servers to get aggregated information in order to make good robot control decisions.


  • This course is designed to suit users of either the EV3 home edition or the EV3 education edition.
  • Users are required to have a Windows 10 PC with Bluetooth. (Most Windows 10 laptops have built in bluetooth support)
  • Users will need to download Ozeki 10 from
  • Users will need to know the basics of Ozeki 10 and Lego robots. Read more information in this course.


The sensors of the robot provide a huge amount of data per second, and it can be very useful if that data can be stored into a text file or a database, where you can analyze these data, and your robot can make real time control decisions according to the collected data.

With this course you will get an introduction to the basics of collecting, analyzing and manipulating data. The first few lectures will show you how you store sensor data into a text file and how you can control your robot by reading a text file. Then you are going to build your MySQL server where you can collect and read the data from the sensors into tables. With databases you will be able to not only control the robot but use the database to make robot control decisions.

As all the courses before this one is also provides an easy to follow step-by-step instructions and quiz questions. Enjoy the course!

Who is the target audience?

This course is designed for learners who don't get scared of some bigger amount of data and can collect and analyze the data from the robot with enthusiasm.


Copyright © 2000- |Ozeki Ltd | |
Page: 6060 | | | Login