## 7 Migrating Existing OSH Designs to SensoTube Architecture
### Development Steps of a Functional Expansion Shield  
As an example of designing a SensoTube-based shield, we describe the considerations and the development steps of a DCL functional shield. This shield will be used for agricultural applications. For this reason, it will have the necessary circuitry for the interfacing with an external air temperature/humidity sensor, and the circuitry for the interfacing with soil moisture sensors using the SDI-12 commercial standard (a 1-wire bus). The specific development steps are:  
1. _Creation of a new design project_: Open a new design project in the electronic design application software tool (EDA tool), adding to this the two sheet symbols and their associated schematic files (see Figure 34). These drawing files contain the connections and parts regarding the implementation of the S-BECs, the P-BEC, and the J-BEC ad they can be used as it is, without making any change or extra work. 2. _Initiation of the new shield circuitry design_: Create a new sheet symbol for the accommodation of the particular circuits of the DCL shield. 3. _Consideration and establishment of required signals_: Create the sheet port entities reflecting the particular signal pins requirements of the specific DCL shield. Regarding the temperature/humidity sensor, we have used the popular DHT22 device. This sensor will be installed outside of the system's enclosure and will interface with the DCL shield through two digital signal pins, namely the clock and the data. This sensor requires a +5 Vdc level power supply. Regarding the soil moisture sensors interface, just one digital signal pin will be required according to the SDI-12 bus. Similarly, thus interface requires +5 Vdc and ground signals from the DCL shield. For the MCU of the shield, we decided to use an AVR Atmega328 due to the fact that it is the basic MCU used by Arduino main-boards. After flashing the MCU with the Arduino bootloader firmware, the MCU will act as an Arduino main-board and the developers can use the Arduino IDE software tool for the application firmware of the shield. As Figure 34 illustrates, on the bottom left side of the DCL sheet symbol, five sheet ports have been added, namely the SDI-12, the TH_CLK (DHT 22 clock), the TH_DATA (DHT 22 data), and +5 Vdc and ground for both interfaces. The rest of the sheet's ports entities are the remaining available signals of the MCU that can be routed to the S-BEC 1 in order to be exploited in various application scenarios. 4. _Making the power management decisions_: The next step is to make the necessary connections for the power management of the DCL shield. For the particular shield, we connect +5 Vdc in the P_Out \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Platform Name** & **Brand Name** & \(I_{fa}\) **(mA)** & \(I_{ds}\) **(mA)** & \(I_{mcm}\) **= (\(I_{fa}-I_{ds}\)) (ma)** \\ \hline Arduino Uno Rev. 3 & Arduino & 46.85 & 33.17 & 13.68 \\ Nucleo STM32L152 & ST & 56.95 & 50.24 & 6.71 \\ FRDM-KL25Z & Freescale/NXP & 36.06 & 34.16 & 1.90 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Current measurements in full active and in deep sleep states of the MCU of three different popular open-source hardware platforms. Figure 33: Current consumption of the MCU circuitry (the green parts of pies) and current consumption of the auxiliary circuitry of three different open-source hardware platforms. port of the sheet symbol. With this option the shield can be monitored and controlled by other dedicated shields (e.g., ETL shields) in terms of its energy consumption. Alternatively, we create the +5 Vdc and GND_5V sheet ports in order the shield to be able to be powered from the generic power signal pins of the S-BEC 2. The aforementioned ports and connections are illustrated in Figure 34.
5. _Considerations regarding the programming and debugging of the shield's MCU:_ in our example, for the programming and debugging of the AVR MCU just the UART TX and RX signal pins are required together with the Reset pin of the MCU.