The digitalization of the economy is one of the drivers of the fourth industrial revolution. This trend is already heavily permeating biology laboratories and rapidly moving into chemistry as well. Notably, automated laboratories enhance process quality and intensification while freeing researchers from repetitive tasks. With these societal changes in place, students need to be prepared for the advanced digitization of chemistry and science by teaching fundamental chemistry concepts in combination with emerging Industry 4.0 technologies, including programming and automation. We describe an undergraduate classroom exercise at the interface of chemistry, computer science and engineering based on the development of an autonomous titration platform. Following an inquiry learning ansatz, the exercise focuses on standard titration experiments which are first executed manually, then automatically and finally in full autonomy by a student-designed robotic platform. We demonstrate that the exercise introduced in this work enables students to learn fundamental concepts in analytical chemistry, naturally integrates basic aspects of programming and automation, and as a consequence promotes and reinforces the detailed understanding of experimental processes and measurements. The exercise is designed in a collaborative active learning framework to encourage complex critical thinking and creative problem solving and thus prepares students for the next-generation chemistry laboratories.