|
1.INTRODUCTIONThe regular low-cost instruments (DMMs, scopes, generators, power supply, etc.) are currently used for laboratory education. Nevertheless, two problems can arise:
The basic instrument – simple low-cost handheld digital multimeter is mostly at an affordable price accessible for everybody. It makes possible to realize static measurements only [1]. The problem arises in the case of generating and recording time-variable signals when scope must be used. The virtual USB scopes, which are suitable for this purpose, are available at the market [2], nevertheless their obtaining has some restrictions, especially for individual work at home or in the case when many students solve the similar task parallelly. This situation had to be solved at the CTU-FEE, Dept. of Measurement, both in the subject “Industrial electronics laboratory”, where 20–30 students solve a similar task parallelly, and in the intensive preparatory course “Practical Electronics”, which is determined especially for school-leavers of secondary schools and a similar number of students (2 x 20–30) take part in. In both cases, it is for a lot of students the first practical meeting with electronic circuits and corresponding experiments. Therefore, for some of them, the time spent in laboratories is not enough to finish the tasks. These need to have a possibility to work at home without any fuss, too. Besides, considering a high number of participants, the capacity of special laboratories for electronic education equipped with scopes and generators is not enough and computer laboratories have to be used. The facts mentioned above led to the demand to design and develop a suitable tool for laboratory teaching based on PC and USB connection, which should serve not only for generating and recording time-variable signals but also for supplying of experimental circuits. F0-Lab can be used as a simple DC voltmeter, a digitizing oscilloscope, a waveform recorder (3-channels in all cases) and a PWM signal generator. 2.DESIGN OF THE LOW-COST TOOL – VIRTUAL INSTRUMENT – FOR LABORATORY TEACHINGDuring the design of the low-cost tool for laboratory teaching, it was necessary to take into consideration besides the functions mentioned above also a possibility to acquaint students with fundamentals of microcontroller technology, interfacing, and programming. It was demanded, to be possible to realize the tool also by students without special knowledge and without using special paid software. The main instruments, which should be realized, were a virtual scope and a generator. To use a low-cost powerful microcontroller with embedded fast ADC and USB interface and develop the necessary firmware for the microcontroller and corresponding PC application was chosen as an optimal solution. 2.1Selection of microcontrollerThe microcontroller STM32 with the ARM Cortex-M core was selected from many other powerful ones. The support of the company STMicroelectronics was a significant factor for it. The low-cost kit NUCLEO F303RE (approx. 10 Euro) with the microcontroller STM32F303RE was applied in the first version of LEO – Little Embedded Oscilloscope. No additional circuits were used in this case. Although in comparison with similar solutions [3], where additional components are applied, the input voltage is limited in the range 0 – 3.3 V. Nevertheless, it was (despite this limitation) successfully tested in laboratory education several years ago (especially considering only 5 V supply from USB port was available in this case, thus this limitation was not significant). Based on these experiences a simpler and low-cost solution for mass education was searched. The final goal was to realize a more universal virtual instrument using one microcontroller only and with minimum cost directly on the solderless breadboard. The low-cost (approx. 2 Euro) microcontroller STM32F042 [4] with ARM Cortex – M0 core was finally selected for this application. Its basic parameters are:
The internal loader enables to download the firmware in internal flash not only using USART interface but also using USB DFU (USB Device Firmware Upgrade standard). It makes it possible to use the microcontroller without any next special components. The microcontroller is soldered on the adaptor TSSOP20/DIL20, which enables to use it directly on the solderless breadboard. A possibility to create own programme in C/C++ using online IDE Mbed is the next advantage of this solution. 2.2Circuit structureThe basic connection of the virtual instrument for laboratory teaching is very simple (see figure 1). Thanks to it each student can connect it on the solderless breadboard himself without a problem. The 5 V supply from the USB port is at disposal in the board and the microcontroller is supplied using the stabilizer 3.3 V. This voltage is also distributed in the board and both voltages can also be used for experiments realization. 3.REALIZATION OF VIRTUAL INSTRUMENT FUNCTIONSThe approach Software Defined Instruments (SDI), where all virtual instrument functions were realized by software using circuits on the chip of the microcontroller only, was applied. The possibilities and properties of the realization are depended on the software used. The function realized in the last version of the presented virtual instrument is described below. 3.1OscilloscopeThe realization of the oscilloscope function was the main demand. The internal ADC, SRAM memory and DMA controller are applied for it. The circular buffer, which serves for the continual store of data from ADC, is realized using RAM. The microcontroller processes the data contemporary and finds the fulfillment of the trigger condition. The trigger level and the rising or the falling edge can be set for the selected channel. The pretrigger can also be set. At the moment, when the trigger condition was fulfilled, the next data according to the pretrigger setting are recorded yet, and the sampling is finished. After that, the recorded data are transferred offline using the USB port in the PC, which enables the following data processing and visualization. Since only one ADC is implemented in the used microcontroller, the input must be multiplexed using the 2 or 3 channel mode. Therefore, while the sampling rate is 600 kS/s and the record length 1024 samples, for 2-channels mode it is 300 kS/s and for 3-channels mode it is 200 kS/s only, and the record length is one-half or one-third in comparison with the single channel mode. 3.2VoltmeterThe 3-channels voltmeter is also realized applying the internal ADC, but using 100 Sa/s. The resolution is 0.8 mV, for suppression of noise and disturbances the averaging can be applied (usually average from 40 samples is used). Considering the supply voltage of ADC (VDDA) is contemporarily used as its reference voltage, and the supply voltage is not precisely defined, the uncertainty of measurement thanks to this fact increased. To improve the accuracy, the used firmware includes the correcting subroutine, which corrects the measured value based on the measured value of internal reference that is embedded in the microcontroller. Considering the ADC input is single-ended, only the voltage in relation to GND can be measured. Nevertheless, a differential input can be realized using 2 multiplexed inputs and the implemented function, which realized difference V1 – V2. Further, the voltmeter function enables also the record of measured voltages. The mode “recording” makes it possible to display the time course of the measured voltage. This record can be also exported in the file in the CSV format for the following processing using Excel. The data are transferred online using the USB port in the PC in this case and the record length is not limited by internal SRAM. 3.3PWM generatorConsidering the microcontroller STM32F042 does not include DAC, the function generator cannot be implemented. Nevertheless, the pulse signal can be generated. It enables to realize the PWM generator with an adjustable period and pulse width. Its maximum frequency is 12 MHz, the setting of the period and pulse-width is possible with the step of 20.83 ns (the system clock 48 MHz). 3.4Further variants for the realization of virtual instrument functionsThe virtual instrument functions mentioned above were realized using firmware for microcontroller STM32F042, which cooperates with the corresponding graphical PC application created using Qt [5]. However, independently were also developed the simpler variants SDI, which used the PC with the terminal software package PuTTy. It concerns single-purpose functions e.g. a voltmeter, a logical probe, a pulse generator, etc. The development runs continuously and further information of application in the other university labs can be found in [6]. 4.THE PROGRAMME MLI - MULTIFUNCTIONAL LABORATORY INSTRUMENTThe new software variant named MLI - Multifunctional Laboratory Instrument was solved in the diploma work [7] based on the previous experience. Its basic functions (see figure 2) are:
The 4 channels voltmeter with averaging and the 4 channels voltage recorder was also implemented (see figure 3). This record can be also exported in the file with the CSV format for the following processing using Excel. For simple experiments, the graph in the PNG format can be exported. The scope uses the 8-bit or the 12-bit resolution of ADC; the sampling rate is adjustable up to 750 kS/s in the single channel mode. The record length is again limited with the internal RAM and it is 1 kS for 8-bit resolution. The virtual control panel of the scope is presented in figure 4. Considering a need for observation of the digital data flow the 4 channels logic analyzer was implemented -figure 5. The sampling rate is up to 8 MS/s and the record length 1 kS for 4 channels. The trigger is derived from the edge (rise/fall) in the selected channel. The primary application concerns the digital data flow analysis in the case of microcontroller interfaces as IIC, SPI, etc., which are applied in many microcontrollers and intelligent sensors e.g. Raspberry Pi, Arduino, etc. The channel UART can also be easily monitored. The counter for frequency and pulse-width measurement was also implemented as a fully new function - figure 6. Its resolution is 20.83 ns (the system clock 48 MHz) for a period and pulse-width measurement. The averaging is also possible according to “period count” setting. The PWM generator mentioned in paragraph 3.3 was realized in this case in 2 channel version (its virtual panel see figure 7). 5.CONCLUSIONThe simple tool for laboratory experiments in electronics mentioned in the paper was primarily developed for education in electronics. However, it can also be used for the teaching of embedded programming in C/C++. The microcontroller STM32F042F6P6 used here is supported by online IDE Mbed [8]. There is only one difference contrary to the kit Nucleo STM32F042K6, which is supported with Mbed directly, the smaller number of pins. Therefore, it is possible to use only these pins, which are at disposal also in the TSSOP20 case. Other parameters (the flash memory, RAM, peripheries, etc.) are the same. Thanks to this fact, the kit Nucleo STM32F042K6 can be virtually selected in Mbed and only these pins, which are at disposal in the TSSOP20 case, are used by programming. Considering the microcontroller STM32F042F6P6 contains USB interface including programming support of the boot loader, the software developed by means of Mbed can be loaded from the corresponding Mbed web site and using STM Cube programmer is uploaded directly into the microcontroller using USB. There are not necessary any special software and components, thus it is possible to realize the similar tasks like those ones, which are presented in [9]. The equipment mentioned above was realized already in several hundreds of pieces. It was used as in the intensive preparatory course “Practical Electronics” designed for school-leavers of secondary schools, so in two subjects in regular laboratory teaching. Thanks to the support of the company STMicroelectronics we can lend the describing kits not only to bachelor students but also students of secondary school, who attend our Embedded Technology Club. The number of laboratory tasks in the electronics branch was created, where the described equipment is successfully used for more than 3 years. It helps both to understand theoretical knowledge gained in lectures and to obtain practical experience by design and development of simple electronics circuits in the framework of individual projects. REFERENCESDonore, J. V., Yenkar V. R. and Mankar V. H.,
“Interactive Learning through Hands-on Practice using Electronic Mini - Lab (EML): a Case Study,”
J. of Eng. Science & Manag. Educ, 5
(I), 357
–362
(2012). Google Scholar
Digilent inc.,
“Analog Discovery 2,”
(2018) https://analogdiscovery.com/ Google Scholar
Katona1, R. and Dénes, F.,
“Texas Instruments MSP430 microcontroller based portable multi-purpose instrument for Android platforms,”
in Proc. of EDERC 2014: European Embedded Design in Education and Research Conference,
1
–5
(2014). Google Scholar
STMicroelectronics, STM32F042K6,
(2018) https://www.st.com/en/microcontrollers/stm32f042k6.html Google Scholar
Qt Group,
“Qt,”
(2019) https://www.qt.io/developers/ Google Scholar
CTU – FEE Prague,
“SDI - Software Defined Instrumentation,”
(2019) https://embedded.fel.cvut.cz/sdi Google Scholar
Dibelka, J.,
“Software defined multifunctional laboratory instrument,”
Diploma thesis CTU-FEE, Prague
(2018). Google Scholar
Arm Limited,
“Mbed OS5,”
(2018) https://os.mbed.com/ Google Scholar
Toulson, R. and Wilmshurst, T., Fast and Effective Embedded Systems Design: Applying the ARM mbed, Elsevier Ltd, Newnes
(2017). Google Scholar
|