Open Access Paper
17 September 2019 F0-Lab: the simple tool for laboratory experiments in measurement and instrumentation
Author Affiliations +
Proceedings Volume 11144, Photonics and Education in Measurement Science 2019; 111440K (2019) https://doi.org/10.1117/12.2530621
Event: Joint TC1 - TC2 International Symposium on Photonics and Education in Measurement Science 2019, 2019, Jena, Germany
Abstract
Platform F0-Lab including LEO (Little Embedded Oscilloscope) was designed and developed to substitute a professional set of instruments in experiments concerning electronics, measurement, and instrumentation. It is based on a microcontroller, which includes the sufficiently fast ADC. It enables to realize (in connection with PC) a simple DC voltmeter, a digitizing oscilloscope, a waveform recorder, and a PWM signal generator. The microcontroller can be placed in a solderless breadboard where the student realizes experimental circuits. The PC controls this virtual instrument, displaying results and supplying the power of the entire set using USB. F0-Lab is successfully used for three years and more than 300 various implementations have been already realized.

1.

INTRODUCTION

The regular low-cost instruments (DMMs, scopes, generators, power supply, etc.) are currently used for laboratory education. Nevertheless, two problems can arise:

  • In the case of many students taught simultaneously it is difficult to guarantee such a set for each of them individually (especially scopes and generators).

  • The use is restricted to equipped laboratories, so students cannot execute experiments elsewhere (e.g. solving homework).

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 TEACHING

During 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.1

Selection of microcontroller

The 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:

  • 32 kByte FLASH

  • 6 kB SRAM

  • 12 bit ADC (up to 1 MS/s)

  • Crystal-less USB interface

  • Package TSSOP20

  • Supply: 2 – 3.6 V

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.2

Circuit structure

The 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.

Figure 1.

The basic connection of the virtual instrument

00028_PSISDG11144_111440K_page_2_1.jpg

3.

REALIZATION OF VIRTUAL INSTRUMENT FUNCTIONS

The 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.1

Oscilloscope

The 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.2

Voltmeter

The 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.3

PWM generator

Considering 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.4

Further variants for the realization of virtual instrument functions

The 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 INSTRUMENT

The 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:

  • 4 channel voltmeter with averaging + 4 channel voltage recorder;

  • 4 channel oscilloscope (sampling rate max. 750 kS/s, record length max. 1 kS);

  • 4 channel logic analyzer (sampling rate max. 8 MS/s, record length max. 1 kS);

  • counter for frequency and pulse-width measurement.

  • 2 channel PWM generator;

Figure 2.

The basic function of MLI

00028_PSISDG11144_111440K_page_4_1.jpg

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.

Figure 3.

The 4 channels voltmeter

00028_PSISDG11144_111440K_page_5_1.jpg

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.

Figure 4.

The 4 channels oscilloscope

00028_PSISDG11144_111440K_page_6_1.jpg

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.

Figure 5.

The 4 channels logic analyzer

00028_PSISDG11144_111440K_page_6_2.jpg

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.

Figure 6.

The counter

00028_PSISDG11144_111440K_page_7_1.jpg

The PWM generator mentioned in paragraph 3.3 was realized in this case in 2 channel version (its virtual panel see figure 7).

Figure 7.

The PWM generator

00028_PSISDG11144_111440K_page_7_2.jpg

5.

CONCLUSION

The 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.

REFERENCES

[1] 

Donore, 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

[2] 

Digilent inc., “Analog Discovery 2,” (2018) https://analogdiscovery.com/ Google Scholar

[3] 

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

[5] 

[6] 

CTU – FEE Prague, “SDI - Software Defined Instrumentation,” (2019) https://embedded.fel.cvut.cz/sdi Google Scholar

[7] 

Dibelka, J., “Software defined multifunctional laboratory instrument,” Diploma thesis CTU-FEE, Prague (2018). Google Scholar

[8] 

Arm Limited, “Mbed OS5,” (2018) https://os.mbed.com/ Google Scholar

[9] 

Toulson, R. and Wilmshurst, T., Fast and Effective Embedded Systems Design: Applying the ARM mbed, Elsevier Ltd, Newnes (2017). Google Scholar
© (2019) COPYRIGHT Society of Photo-Optical Instrumentation Engineers (SPIE). Downloading of the abstract is permitted for personal use only.
Jan Fischer, Jan Holub, and Vladimír Haasz "F0-Lab: the simple tool for laboratory experiments in measurement and instrumentation", Proc. SPIE 11144, Photonics and Education in Measurement Science 2019, 111440K (17 September 2019); https://doi.org/10.1117/12.2530621
Advertisement
Advertisement
RIGHTS & PERMISSIONS
Get copyright permission  Get copyright permission on Copyright Marketplace
KEYWORDS
Computer programming

Signal generators

Logic

Control systems

Data processing

Electronic circuits

Multiplexing

Back to Top