## 3 Implementation  
The educational resource proposed in this manuscript offers an automated, reproducible and simple method that uses Lego Ev3 and a micro:bit board as control device units. Currently, there is no commercial laser diode that can be connected directly to the Lego intelligent brick, so the individual wires of an Ev3 cable were used to power and control it. These wires are shown in Figure 3a. The white wire (1) carries an analog output (AO) connected to the positive terminal of the laser diode (LD), while black (2) and red (3) wires are used as electric ground (GND). The programming of the Ev3 smart brick was carried out using the \"Education Ev3 classroom v1.2.2\" software based on block programming. The control of the laser was carried out in the same way that the speed of a Lego motor is modulated, as shown in Figure 3b. In order to determine the polarization angle \(\theta_{P}\) in which the reflected beam is almost extinguished, the color recognition function in the AI camera was used (the reflected beam is not directly observed by the camera but will be projected onto a white screen). When the spot of the reflected beam is not detected (using an ID1 variable indicator), an analog signal will be sent to the Ev3 intelligent brick that will stop the rotation of the motor and will save the current position angle. Figure 4a shows the connection diagram between the machine vision camera, the micro:bit and the Ev3 connector that will send an analog input signal to the smart brick when the variable \"ID1\" is not detected (there is a preset minimum intensity in color detection that makes the camera unable to detect an object. This threshold cannot be  
Figure 3: (**a**) Laser diode connected to the Ev3 cable, (**b**) the block coding used to power the laser. Figure 2: Schematic diagram of a typical setup for measuring the polarization angle using a power meter. modified by the user), as if it came from an Ev3 color sensor (ambient light intensity in port 1). Figure 4b shows a section of the block code used to choose the color recognition function programmed in MakeCode for the micro:bit (Figure 4b-1) and the verification of its detection using the variable ID1 (Figure 4b-2). If this identification was carried out successfully, an analog signal will be sent to an output port of the micro:bit with a value of 1023 (Figure 4b-3); otherwise, the analog output signal will have a value of 0 (Figure 4b-4). The general schematic setup of the proposed implementation is depicted in Figure 5. This figure shows the most important parts of the experimental setup, such as the modified Lego laser diode (MLDD, with its polarization parallel to the surface), the smart brick (LIB), the servomotor (LSM), the observation screen, the micro:bit board and the machine vision camera (Huskylens). The normal to the surface under test, the incident angle, and the reflected angle of the beam displayed on a screen are also shown. By knowing the polarization angle \(\theta_{P}\) at which the intensity of the reflected beam is almost zero, and according to the conditions of the experiment \(n_{1}\approx 1\) (air as the first medium), it is possible to estimate the refractive index of the object under test by solving \(n_{2}\) from Equation (6). \[n_{2}=n_{1}\frac{\sin\theta_{P}}{\cos\theta_{P}}=n_{1}\tan\theta_{P}. \tag{7}\]  
Once \(\theta_{P}\) is detected, the LSM will return to its initial position, waiting to repeat the experiment with the same or another reflective surface. The calculation of \(\theta_{P}\) and the refractive index of the material (\(n_{2}\)) will be displayed on the Ev3 Smart Brick screen, avoiding the use of additional electronic components. Figure 4: (**a**) Connection between the camera, the micro:bit and an input port of the Ev3. (**b**) Segment of the color recognition program.