{'fraction_non_alphanumeric': 0.030977996431853814, 'fraction_numerical': 0.017651511055846895, 'mean_word_length': 5.004707028079857, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 5, 'lorem ipsum': 0, 'www.': 7, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A novel time-lapse imaging method for studying developing bacterial biofilms

In nature, bacteria prevailingly reside in the form of biofilms. These elaborately organized surface-bound assemblages of bacterial cells show numerous features of multicellular organization. We recently showed that biofilm growth is a true developmental process, which resembles developmental processes in multicellular eukaryotes. To study the biofilm growth in a fashion of eukaryotic ontogeny, it is essential to define dynamics and critical transitional phases of this process. The first step in this endeavor is to record the gross morphological changes of biofilm ontogeny under standardized conditions. This visual information is instrumental in guiding the sampling strategy for the later omics analyses of biofilm ontogeny. However, none of the currently available visualizations methods is specifically tailored for recording gross morphology across the whole biofilm development. To address this void, here we present an affordable Arduino-based approach for time-lapse visualization of complete biofilm ontogeny using bright field stereomicroscopy with episcopic illumination. The major challenge in recording biofilm development on the air–solid interphase is water condensation, which compromises filming directly through the lid of a Petri dish. To overcome these trade-offs, we developed an Arduino microcontroller setup which synchronizes a robotic arm, responsible for opening and closing the Petri dish lid, with the activity of a stereomicroscope-mounted camera and lighting conditions. We placed this setup into a microbiological incubator that maintains temperature and humidity during the biofilm growth. As a proof-of-principle, we recorded biofilm development of five Bacillus subtilis strains that show different morphological and developmental dynamics.


Scientific Reports
| (2022) 12:21120 | https://doi.org/10.1038/s41598-022-24431-y www.nature.com/scientificreports/ recording of time-lapse videos due to water condensation on Petri dish lids. In our experience, this is a prominent problem especially in the situation where low-magnification images are captured using bright field stereomicroscopy with episcopic (reflected) illumination ( Fig. 1, Supplementary Video 1). The same condensation-induced photo blurriness was noticed previously in a comparable effort to record bacterial colony growth by time-lapse visualization 23 and in attempts to photograph plant tissues cultured in Petri dishes 24 .
To address this issue, an earlier study suggested placement of a tick polymer disc with low thermal conductivity on the lid of a Petri dish that contains cultured plant tissues 24 . Although this approach reduced the condensation on the inner surface of the lid, it concomitantly increased condensation on the Petri dish side walls, which is an undesirable situation because it leads to excessive water dripping directly on the culturing media 24 . Another shortcoming of this solution is that adding a tick polymer disc in the optical path inevitably changes optical clarity, especially in the low-magnification setup with episcopic illumination that we used. Similarly, another study placed at the bottom and at the top of a Petri dish transparent glass heaters to avoid water condensation 25 . This approach was useful for recording transmission fluorescent signals during biofilm development, but it required a specialized and expensive fluorescence microscope for large object fields and a custom-built environmental chamber to maintain a constant temperature during growth 25 . In addition, glass heaters further reduce the light transmission and obstruct the optical path, especially if reflected illumination is applied.
An obvious solution to the lid-condensation problem would be to entirely remove the lid during the filming process. This approach also provides the least obstructed optical path if the bright field stereomicroscopy with episcopic illumination is applied. However, it also compromises the experiment by increasing desiccation and contamination of the agar medium in a Petri dish. In our experience, this leads to the reduction of usable recording time to at most three days. To address these tradeoffs, in our previous work we applied a brute-force approach by manually opening, filming and subsequently closing the Petri dish lid during the experiment 14 . However, this solution is rather impractical, or even prohibitive, as it required engagement of substantial workforce over the weeks-long filming sessions of biofilm development, which required shooting in 15-min intervals. Another drawback associated with this solution is that frequent opening and closing of the incubator door leads to temperature and humidity fluctuations, which in turn must be carefully controlled. In addition, the same procedure increases the probability of airborne contaminants in the incubator space.
To address these issues, we here present an Arduino microcontroller-based solution for time-lapse visualization of developing biofilms at solid-air interfaces using bright field stereomicroscopy with episcopic illumination. As a proof-of-concept, we recorded time-lapse videos of developing biofilms in five B. subtilis strains that show distinct biofilm morphologies and developmental dynamics.

Results and discussion
Technical aspects of the method. In a closed incubator environment, the standard growth temperature for mesophilic bacteria, which cover the majority of common environmental bacteria and human pathogens, ranges between 20 and 45 °C 26 . This relatively high incubator temperature causes an extensive water evaporation from agarose-based growth media, which often directly affects the growth of bacterial colonies. During standard bacterial incubations this excessive evaporation is prevented by a Petri dish lid. However, slight temperature differences between the lid and the inner Petri dish space often lead to moisture condensation on the inner Petri dish lid surface 24 . In the majority of microbiological experiments this phenomenon is of no concern, but in biofilm macrocolony photography and time-lapse video production, the vapor condensation on the transparent lid causes considerable difficulties in taking clear biofilm photographs (Fig. 1, Supplementary Video 1). This is also clearly visible in some time-lapse videos of a previous methodological paper that deals with bacterial macrocolony photography 23 .
To overcome these obstacles, we constructed an Arduino-controlled biofilm visualization setup (Fig. 2). The core of this setup, which consists of a camera mounted on top of a stereomicroscope (Fig. 2E) and an Arduino   (Fig. 2F), is placed inside a microbiological incubator ( Fig. 2A). The basic logic behind this apparatus is to automatize the Petri dish lid opening, synchronize this step with the automated camera shots of a growing biofilm, and perform these actions under tightly controlled temperature, humidity and lightning conditions. The main functional part in our setup is a small, acrylic robotic arm controlled by an Arduino microcontroller (Fig. 2F). The sole purpose of this robotic arm, which is firmly attached to the Petri dish lid, is to open and close the Petri dish in short, preprogramed photo-intervals that allow visually unobstructed shooting of a biofilm that grows on an agar plate (Fig. 3). During the whole experiment the robotic arm is firmly attached to a Petri dish lid. In the resting periods-i.e., before the start of the experiment, after the last photo has been taken, and between the two recording steps-the robotic arm keeps the lid in a closed Petri dish position (Fig. 3B, Supplementary Video 2), thus preventing unnecessary medium desiccation and contamination. The Arduino microcontroller starts the time-lapse recording    (Fig. 4E).
One second later, the robotic arm attached to the lid first moves several centimeters vertically, and then performs a side move to get the lid out of the camera's field of view (Fig. 3C, Table 1, Supplementary Video 2). During these movements the lid keeps an approximately parallel position to the Petri dish that contains a growing biofilm. At the moment when the robotic arm stops in the opened Petri dish position (Fig. 3C, Table 1, Supplementary Video 2), the microcontroller takes a photo of the biofilm via the remote shutter (Fig. 2J, 4O) connected to the camera (Fig. 2E, 4P). After the photo has been recorded, the Petri dish is closed again by the same robotic arm movements, but in the opposite direction. One second after the closed Petri dish position is reached, the Arduino microcontroller switches off the light-ring (   www.nature.com/scientificreports/ time required for one arm movement cycle is around 14 s, a value that we empirically adjusted (Table 1). In our experience, faster arm movements lead to lower motion accuracy and consequently dysfunctional behavior. The next cycle of time-lapse recording is repeated depending on the time interval entered in the code that drives the microcontroller (Table 1).
To further minimize the dehydration of agar media during the filming of biofilm growth, we placed four square-shaped plastic containers filled with distilled water on the bottom of the incubator covering approximately 78% of the bottom area. These water-filled containers were performing the role of a humidifier, which allowed us to maintain relative air humidity within the incubator at approximately 85% during the visualization experiments that lasted up to 21 days. In the case a longer experimental growth period would be needed, our setup can be easily upgraded with the previously described double-decker agar hydration design 23 . Although relatively high humidity could potentially compromise functions of the electronic components in our setup, we had no problems of this type during the two years of its development and application. Nevertheless, the further improvements of the apparatus could include a protective enclosing for the microcontroller and the camera to prevent potential humidity-related issues.
To control the water level in water containers, we connected a water-level sensor to the Arduino microcontroller (Figs. 2K, 4H). In situations when the water level dropped below the critical threshold and the water containers needed refilling, the Arduino microcontroller sounded an alarm over the passive buzzer (Fig. 4G). We prevented unnecessary electrode corrosion of the water-level sensor through electrolysis by connecting it through a relay module (Fig. 4I), which switched on the sensor only during the measurement time.
In order to detect an occasional camera focus loss due to biofilm growth in three dimensions and to prevent eventual mechanical misbehaviors of the system, it is necessary to occasionally control the activity of the setup during the filming session. However, to avoid the frequent opening of the incubator door, which in turn leads to temperature, humidity and lighting fluctuations within the incubator chamber ( Fig. 5), we connected an external monitor to the camera that allows real-time monitoring of biofilm growth and setup behavior (Fig. 2B). As our camera can simultaneously take shots and provide a live image on the external monitor over a HDMI socket, there was no need to manually switch between these two modes. The real-time image of the biofilm was visible on the monitor only during the recording cycle because the light is only turned on during this period, whereas during the resting period between the recording cycles the incubator chamber is in dark. Nevertheless, this periodic availability of the real-time image was sufficient for the eventual inspection of biofilm growth or apparatus malfunctions.
Before the start of our visualization experiments, we sterilized the inner parts of the incubator, its atmosphere and the whole apparatus by a UV sterilizer that we added in the incubator chamber (Fig. 2D). This procedure allowed us to largely prevent contamination of agar media during the experiments. Nevertheless, we had to occasionally open the incubator during the experiment to manually correct the focus of the stereomicroscope that became suboptimal due to changes in the biofilm 3D morphology, or to refill the water containers. In the vast majority of experiments this was not a problem, but occasionally a spore contamination was unavoidable. However, from our experience, the air-borne fungal contamination was not visible on the agar-plates before two weeks of continuous recording (Supplementary Video 3). In order to further minimize the fungal or bacterial spore contamination of the agar-plates and temperature and humidity fluctuations (Fig. 5), an automated stereomicroscope focusing mechanism, as well as an automated water container refill mechanism, should be added to the setup in the future.
Proof of concept: Strain-specific development in Bacillus subtilis. To demonstrate our time-lapse visualization method, we recorded developmental and morphological changes during the biofilm growth of five distinctive B. subtilis strains (Fig. 6).
We independently photographed the biofilm development of every strain in six-minute intervals. This recording frequency allowed us to produce detailed time-lapse videos with an optimal frame rate (30 fps). We recorded 1,681 photos for every of the four B. subtilis strains (102, 100, NCIB3610, and 108) that we grew for seven days. In addition, we collected 5,041 photos of a slowly developing strain (106) that we grew for 21 days. To give an overview of the recording process, we show seven representative photos recorded during seven-day period for all five strains (Fig. 6). However, as the full dynamics of biofilm growth and the changes in its morphology are only possible to grasp from time-lapse videos, we also assembled our photo collections into five time-lapse videos that show the biofilm growth of every strain independently (Supplementary Videos 3, 4, 5, 6 and 7). For comparative purposes, we also compiled two additional videos that show the growth of two strains (102, 106) and four strains (102, 100, NCIB3610 and 108) in parallel (Supplementary Videos 8 and 9). Finally, to show that our method has enough processivity to allow recording in replicates, which could be useful in assessing the morphological variability of biofilm development within a strain, we filmed the growth of strain 108 three times. We assembled these three time-lapse photo collections, which covered biofilm growth over three days, into three independent time-lapse recordings and joined them together into a single video (Supplementary Video 10).
The first obvious difference among the observed B. subtilis strains, which could be grasped by browsing their biofilm videos in a slow-motion mode, was their growth speed (Fig. 6, Supplementary Video 8). Although all observed strains grew under the same standardized environmental conditions (1.5% w/v agarose, 30 °C and 85% relative humidity), they showed rather different growth dynamics (Fig. 6, Supplementary Video 8 and 9). For instance, strain 102 showed the fastest biofilm expansion, in contrast to the 106 strain which showed the slowest growth within the seven-day timeframe (Fig. 6, Supplementary Video 9). Except the fastest growth, strain 102 showed a specific star-shaped morphology in the early phase (7 h) of biofilm growth that was absent in other strains (Fig. 6 www.nature.com/scientificreports/ Besides the growth rate, in our time-lapse videos one could also look at the changes in colony morphology, which is considered one of the hallmarks of B. subtilis biofilms 28 . In our previous work we showed that typical wrinkled biofilm morphology in the NCIB3610 strain starts to develop in the transition stage during the second day of biofilm growth, which correlates with dramatic changes in expression patterns 14 . In this study we were able to reproduce this pattern in the same strain using our automated apparatus recording. The time-lapse video shows that wrinkles first start to appear in the center of the NCIB3610 biofilm at the onset of the second day of biofilm growth (Supplementary Video 7). In comparison to the NCIB3610 strain, the wrinkles in other four strains showed different morphology in terms of density, timing of their first appearance, and three-dimensional structure (Fig. 6, Supplementary Videos 8 and 9). This developmental variability between strains suggests differences in underlying expression patterns that could be further explored by time resolved sampling and subsequent transcriptomic and proteomic analysis 14 . In contrast to differences between the strains, the visual comparison of three replicates (strain 108) showed highly comparable morphological dynamics during the three-day biofilm growth (Supplementary Video 10). . During the course of automated filming process temperature and humidity values were measured every 6 min. The incubator door was continuously closed except for one focus adjustment and water container refill at 3 h and 54 min. In contrast, during the manual recording process we opened the incubator door, manually removed the Petri dish lid, took a photo, closed the Petri dish, closed the incubator door and measured the temperature and humidity. This process, which lasted approximately 10 s, was repeated every 6 min. We collected in total 121 temperature and humidity measurements per experiment (Supplementary File 1). We tested difference in the average temperature using two-tailed t-test.  14 . This entails that it is very unlikely that optimal results would be achieved by simply taking a limited number of randomly or evenly distributed samples along biofilm ontogeny (Fig. 7A). Hypothetically, one could make a very dense equidistant sampling to avoid the problem (Fig. 7A). However, the costs of transcriptomic and proteomic experiments additively grow with the number of samples, especially when replicates are included in an experimental design. Regardless of the costs, it is good to keep the total number of the samples at reasonable level because a large number of samples impose substantial computational burden on the bioinformatic pipelines for transcriptomic and proteomic analysis. However, without knowing in advance the global gene expression profiles, it is hard to optimally decide on the temporal distribution of biofilm sampling. Inspired by expression studies in animals 16 , we reasoned that if we follow morphological changes during biofilm growth, we will probably catch the most important transition in gene expression levels. Indeed, in Futo et al. we showed that morphology and expression profiles generally correlate during B. subtilis development 14 .
However, in this previous study, we faced the problem of filming biofilm gross morphology over long periods. As we already explained, water condensation on the lid was the major problem, but we also had difficulties to properly set the focus and lightning conditions through the lid. We ad hoc solved this problem by manually opening and closing the Petri dish during the filming of biofilm growth. This strategy worked, but at very high manpower cost, which prevented us from regularly applying it (Table 2). In addition, we struggled to keep temperature and humidity values during filming session as close as possible to the levels maintained during biofilm growth for omics sampling (Fig. 5). Our automated apparatus for time-lapse biofilm growth recording largely solved these problems. By reducing more than 30 times the manpower costs (Table 2), it makes time-lapse recording more processive and reproducible, while by stabilizing temperature and humidity values during the filming process (Fig. 5), it helps in keeping comparable environmental conditions between the biofilm sampling and filming experiments.

Time-lapse videos in guiding biofilm sampling for omics analysis. To detect relevant time points
that show morphological change, in our previous work 14 we visually browsed back-and-fort through a timelapse movie of biofilm growth in a slow-motion mode. In this process we relied on the visual pattern recognition of a trained researcher because this is how morphological developmental changes were usually defined in animal development. As an example of this procedure, we selected the time points of biofilm development (strain 108) which we think are suitable for analysis in downstream transcriptomic and proteomic experiments (Fig. 7B).
However, we are also aware that bacterial biofilms are especially amenable for morphometric analysis, which could move the decision-making process related to biofilm sampling from a qualitative to quantitative level. In contemporary studies biofilm morphometrics is predominantly performed on 3D fluorescence images that are gathered by confocal microscopy 29 . Consequently, the state-of-the-art morphometric software, like BiofilmQ, is mainly designed for the analysis of these image types 29 . Although confocal microscopy and light sheet microscopy 30 are powerful visualization techniques that are applied for biofilm analysis 25,29,31 , they require www.nature.com/scientificreports/ florescent labeling and a substantially more sophisticated setup. Nevertheless, from the perspective of our application, which aims to improve biofilm sampling, these prerequisites may represent a disproportionate effort. In addition, transgenic florescent labeling is not always possible to perform, for instance in environmental bacterial strains where genetic protocols have not been established. In this context, it was necessary to first check if our 2D images obtained by bright field stereomicroscopy with episcopic illumination were suitable for processing in BiofilmQ software.
To test this, we took six representative images obtained during time-lapse filming of the 108 strain (replicate No. 2, Supplementary Video 10, Fig. 8A), imported them into BiofilmQ and performed segmentation of their biosurface. Segmentation is a critical process in the image analysis of biofilms that partitions an image into a biologically relevant part (biofilm) and the rest of the image (background and noise) 29,32 . An overly pronounced background, low image sharpness, unintended objects and any kind of noise are factors that all decrease and complicate the segmentation process. However, it turned out that the segmentation of our time-lapse biofilm images, due to their visual quality, is quite straightforward. As an output the segmentation process in BiofilmQ yields a collection of squares (pseudo-cells) that define the biological object (biofilm). These squares have quantitative attributes like spatial position and light intensity that could be further processed. As an example, by using BiofilmQ visualization module we made a 4D scatterplot that shows the spatial position of squares (pseudocells) and their corresponding light intensity values for six selected stages of biofilm growth (Fig. 8B). Under the assumption that a square-specific light intensity value reflects the biofilm thickness at a particular spatial position, it is clear that after one day of biofilm development the center of the biofilm is increasingly getting thinner (deep Dense sampling is the best approach, but incurs high costs in downstream experiments, e.g. transcriptome sequencing and protein quantification, especially if the sampling includes replicates and covers long biofilm ontogenies. If the number of sampling timepoints is limited for any reason, e.g. to seven samples, one could choose an equidistant or eventually random sampling approach. In both cases, it is uncertain how these samples will reflect underlying expression dynamics. (B) In the case of limited number of samples, we suggest that a better option is to follow morphological change of biofilm development and to adjust sampling timepoints accordingly. By browsing time-lapse videos, timepoints relevant for biofilm development could be determined. For instance, we analyzed here the time-lapse video that covers biofilm development of the B. subtilis strain 108 during seven days (Supplementary Video 6). We selected seven time-points that we consider relevant for sampling: 12 h-early biofilm development, the inoculation droplet circle is visibly filled with cells, the first regions with ticker cell layers already start to appear; 1d-the cells start to spread outside of the inoculation droplet circle to from a ring, at the edge of inoculation droplet circle an irregular ridge made of ticker cell layers is formed; 1d 12 h-the ring continues to enlarge, the outer edge of the ring starts to thicken, inner circle shows additional ridges and wrinkles; 2d-the ring further continues to enlarge, first radial wrinkles across the ring start to appear, the outer belt of the ring becomes the thickest structure; 2d 12 h-the ring further continues to enlarge, radial wrinkles become prominent, inner part of the biofilm becomes obviously thinner compared to the outer belt; 3d-the biofilm continues to grow, has lace appearance, shows strong radial wrinkles and a curvy edge; 5d-at the upper-right sector of the biofilm edge a secondary growth becomes visible.  . The developmental timepoints of these images correspond to the timepoints that we marked as morphology-relevant for the strain 108 in Fig. 7B. (B) 4D scatterplot generated in BiofilmQ-a software for quantitative biofilm analysis and visualization 29 . We first pre-processed and segmented six biofilm images in BiofilmQ (see Methods) and then depicted the spatial position of the resulting squares (pseudo-cells) and their corresponding light intensity values (arbitrary unit).
Under assumption that square-specific light intensity reflects biofilm thickness at a particular spatial position, it is clear that after one day of biofilm development the center of the biofilm is increasingly getting thinner (deep blue color), while a belt shaped region located close to the outer biofilm edge becomes the thickest part (bright yellow color).
Scientific Reports | (2022) 12:21120 | https://doi.org/10.1038/s41598-022-24431-y www.nature.com/scientificreports/ blue color). Altogether, this demonstrates that images obtained with our automated time-lapse recording apparatus for bright field stereomicroscopy with episcopic illumination are suitable for downstream morphometric analysis. Moreover, the increased processivity of our automated time-lapse filming method, compared to the manual approach, opens possibility for a more detailed and robust morphometric analysis.

Conclusions
We developed a novel automated time-lapse imaging method for studying the gross morphology of developing bacterial biofilms over long time periods, which solves the problem of condensation-induced photo blurriness in bright filed stereomicroscopy with episcopic illumination. As our method is based on an easily programmable Arduino microcontroller platform, it is highly flexible in terms of controlling photo periods for time-lapse photography. In addition, our setup could be easily upgraded with various additional elements such as diverse kinds of sensors that might come useful in different experimental setups. Although our visualization setup is primarily developed for visualization of biofilms or macrocolonies that grow on solid-air interfaces, with minimal modifications it could be also used for visualization of biofilms that float on liquid-air interfaces as pellicles.
Due to the relatively low cost of its main components, this method is an affordable solution for microbiological time-lapse recording in various scientific and educational environments. The quality of the time-lapse videos that could be produced by this setup was already acknowledged with an Honorable mention award at the 2021 Nikon Small World in Motion Competition 33 . subtilis environmental strains were isolated from a topsoil sample collected from Ruđer Bošković Institute backyard following the procedure described below. The five grams of topsoil were mixed with 45 mL of re-distilled, filter-sterilized water and vortexed for 3 min in a 50 mL falcon tube at room temperature (RT). After the soil precipitate has sedimented for 10 min at RT, the supernatant was serially diluted in 10 -1 , 10 -2 and 10 -3 steps. 100 μL of the undiluted and three diluted supernatants were plated out on 90 mm Petri dishes containing biofilm-promoting MSgg agar (5 mM potassium phosphate pH 7, 100 mM MOPS pH 7, 2 mM MgCl 2 , 700 μM CaCl 2 , 50 μM MnCl 2 , 50 μM FeCl 3 , 1 μM ZnCl 2 , 2 μM thiamine, 0.5% glycerol, 0.5% glutamate, 50 μg/mL tryptophan, 50 μg/mL phenylalanine solidified with 1.5% agar) using a Drigalski spatula in 10 replicates each. In total 40 inoculated MSgg plates were incubated for 24 h at 30 °C. After incubation, all plates were visually inspected using a Stemi C-2000 stereo microscope (Zeiss). In total, 14 single-standing colonies that showed a morphologically elaborate colony structure were isolated and inoculated on a fresh MSgg plates, each in three replicates. After 24 h of incubation at 30 °C, a single colony from each of the 14 samples was taxonomically analyzed using the MALDI-TOF Biotyper mass spectrometry system (Bruker Daltonik). To perform taxonomic identification this instrument compares the mass spectrum of a focal microorganism with a reference library, and returns spectral similarity scores. These spectral similarity scores were calculated using the Bruker's pattern-matching algorithm 34 . According to the manufacturer, a similarity score of ≥ 1.80 represents a high confidence match. In practice, numerous studies have shown that score values ≥ 2.0 provide accurate identification at the species level 35,36 . We annotated four samples that had top-two matches to B. subtilis with score values above 2.0 as B. subtilis and used them for the downstream visualization experiments. These isolated strains were arbitrary named as strain 100, 102, 106, and 108 and were stored in 25% glycerol stocks at -80 °C.

Material and methods
Growth conditions before and during the visualization experiments. Two days before each visualization experiment, the bacteria from the − 80 °C glycerol stock were plated on a LB agar plate (1% Bacto tryptone, 0.5% Bacto yeast extract, 1% NaCl, 1 mM NaOH solidified with 1.5% agar) and incubated for 24 h at 30 °C. 10 mL of liquid LB medium were inoculated with a single colony and incubated overnight (16 h) (Fig. 2D). Following the incubator surface-sterilization, the Petri dish lid was removed and the MSgg agar plate was inoculated with 5 μL of the bacterial overnight culture. With the help of live image projected on the external monitor (Fig. 2B), we pipetted this 5 μL drop in the middle of the field of view and focused the image using the focus nob of the stereomicroscope. Subsequently, the inoculated plate was covered with a Petri dish lid attached to the robotic arm (Fig. 3B, Supplementary Video 2). We started the experiment by turning the Arduino microcontroller ON and closing the incubator. During the filming experiments, biofilms were grown at 30 °C, for 3 days (strain 108 in three replicates), 7 days (strains 100, 102, 108 and NCIB 3610), and 21 days (strain 106), while the relative air humidity inside the incubator was maintained at around 85%.
Arduino controlled time-lapse photography setup. The robotic arm. We performed visualization of five B. subtilis strains using the time-lapse automated setup (Figs. 2 and 4). The whole setup was operated by an Arduino Uno R3 microcontroller board (Arduino) (Fig. 4D). The Arduino digital pins 5, 6 and 9 were connected to three SG90 servomotors (Fig. 4L-N). The servomotors were moving a simple, acrylic robotic arm in three axes. We purchased this robotic arm from Keyestudio (https:// www. keyes tudio. com/ produ cts/ keyes tu- www.nature.com/scientificreports/ dio-4dof-acryl ic-toys-robot-mecha nical-arm-claw-kit-for-ardui no-diy-robot) and assembled it according to the provided instructions (https:// wiki. keyes tudio. com/ Ks0198_ keyes tudio_ 4DOF_ Robot_ Mecha nical_ Arm_ Kit_ for_ Ardui no_ DIY). To allow a direct attachment of the claw servo plate to the lid of Petri dish with an adhesive tape we did not attach the apical robotic claw and its servomotor. All three servomotors were powered by a DC 5 V power-source (Fig. 4B) running separately from the main DC 5 V line that powered the microcontroller and the modules (Fig. 4A).
Light, temperature and humidity. To achieve optimal lightning conditions, we mounted an episcopic 144 LED light-ring (Fig. 4F) on the stereomicroscope objective (Figs. 2E, 3). The microcontroller-mediated solid-state relay module (Omron) (Fig. 4E), which was opening and closing the DC 12 V light-ring circuit (Fig. 4C), was controlling the light-ring ON/OFF switching. This relay was connected to the microcontroller via digital pin 2. The optimal temperature for bacterial growth was provided by the microbiological incubator (Termomedicinski aparati-TMA) ( Fig. 2A). All bacterial strains were grown at 30 °C. The air-humidity in the incubator was maintained by evaporation from four water containers placed in the incubator and filled with redistilled water (Fig. 2K). The water level in the containers was controlled with a water level sensor (Fig. 4H). The sensor was connected to the microcontroller's analog input pin A0. The 5 V DC current powering the sensor was periodically switched ON/OFF by the 5 V DC KY-019 relay module (Fig. 4I). The relay module was connected to the analog input pin A1 of the microcontroller. Digital pin 3 was connected to a passive buzzer (Fig. 4G). The humidity was monitored with a HM16 thermo/hygrometer (Bauer GmbH) placed within the incubator.
For the purpose of comparing temperature and humidity fluctuations within the incubator interior during manual and automated time-lapse photo recording (Fig. 5), we upgraded our Arduino system described in Fig. 4 with two additional elements ( Supplementary Fig. 1). An Arduino-compatible data logging shield (Velleman), which enabled temperature and humidity measurements to be stored onto a SD card, was mounted onto the microcontroller board ( Supplementary Fig. 1D), and a digital temperature and humidity sensor AM2302 DHT22 was connected via the logging shield to the Arduino digital pin 8.
The photography and camera settings. The photographs of growing biofilms were recorded using a SONY alpha 7 II mirrorless camera (Fig. 4P) mounted on a Stemi C-2000 (Zeiss) stereo microscope using a T2 adapter (Fig. 2E). Digital pins 4 and 7 of the microcontroller board were connected to two DC 5 V KY-019 relay modules (Fig. 4J,K). Once triggered by a signal received from the microcontroller, the two relay modules (Fig. 4K,L), one after the other with 1 s delay, closed the two 1.5 V DC circuits of the remote shutter MC-36B (Neewer) (Figs. 2J,  4O). This action imitated a physical finger-push on the shutter release trigger and as a result sent a signal to the camera via a USB connection. The photographs were taken in six-minute intervals during three days (strain 108 in three replicates), four days (strain 108 recorded through the Petri dish lid), seven days (strains 100, 102, 108 and NCIB3610) and 21 days (strain 106). The magnification of the stereomicroscope was set to 0.8 x. The camera was set to the "Aperture Priority" mode with the following parameters: image size: 24 M; image quality: RAW + J; image resolution: 6000 × 4000 px, 350 dpi; drive mode: single shooting; flash compensation: ± 0.0; focus area: center; exposure compensation: ± 0.0; light sensitivity ISO: 50; metering mode: multi; white balance: AWB; creative style-"Clear" while the D-Range Optimizer and flash were set to "off ".
Production of time-lapse videos. The time-lapse videos of developing biofilm macrocolonies were produced from series of JPEG photographs using the Adobe After Effects CC 2017 software. The time-lapse videos of B. subtilis developing biofilms that correspond to 102, 100, NCIB3610 and 108 strains were rendered from four photo collections each containing 1,681 photographs. The time-lapse video of the 106 strain was rendered using 5,041 photographs, while the videos of the 108 strain that were recorded in three replicates were rendered from 721 photographs each. The rendering settings were set to: "Best", video size was 1920 × 1080 px in full resolution, auto input was switched off. The frame rate in all videos was set to 30 fps, the video format was QuickTime, and the codec was MPEG-4.

Data availability
The videos presented in this paper are available for immediate viewing on the private YouTube links and for viewing and download in the original size on the FigShare links provided in below table. The code driving the Arduino microcontroller and the Python script for photography time-tagging are available at the GitHub link https:// github. com/ bacil lus-biofi lms/ time-lapse-imagi ng.