Quick viewing(Text Mode)

Sensotube: a Scalable Hardware Design Architecture for Wireless Sensors and Actuators Networks Nodes in the Agricultural Domain

Sensotube: a Scalable Hardware Design Architecture for Wireless Sensors and Actuators Networks Nodes in the Agricultural Domain

sensors

Article SensoTube: A Scalable Hardware for Wireless Sensors and Actuators Networks Nodes in the Agricultural Domain

Dimitrios Piromalis 1,2,* and Konstantinos Arvanitis 1

1 Department of Natural Resources Management and Agricultural , Agricultural University of Athens, Iera Odoos 75, Athens 11855, Greece; [email protected] 2 Department of Automation Engineering, Piraeus University of Applied Sciences (TEI of Piraeus), P. Ralli and Thivon 250, Egaleo 12244, Greece * Correspondence: [email protected]; Tel.: +30-697-232-9223

Academic Editor: Kemal Akkaya Received: 14 April 2016; Accepted: 29 July 2016; Published: 4 August 2016

Abstract: Wireless Sensor and Actuators Networks (WSANs) constitute one of the most challenging technologies with tremendous socio-economic impact for the next decade. Functionally and optimized hardware systems and development tools maybe is the most critical facet of this technology for the achievement of such prospects. Especially, in the area of agriculture, where the hostile operating environment comes to add to the general technological and technical issues, reliable and robust WSAN systems are mandatory. This paper focuses on the hardware design of the WSANs for real-world agricultural applications. It presents the available alternatives in hardware design and identifies their difficulties and problems for real-life implementations. The paper introduces SensoTube, a new WSAN hardware architecture, which is proposed as a solution to the various existing design constraints of WSANs. The establishment of the proposed architecture is based, firstly on an abstraction approach in the functional requirements context, and secondly, on the standardization of the subsystems connectivity, in order to allow for an open, expandable, flexible, reconfigurable, energy optimized, reliable and robust hardware system. The SensoTube implementation reference model together with its encapsulation design and installation are analyzed and presented in details. Furthermore, as a proof of concept, certain use cases have been studied in order to demonstrate the benefits of migrating existing based on the available open-source hardware platforms to SensoTube architecture.

Keywords: wireless; sensors; actuators; networks; open-source; expandable platforms; Arduino; ARM; energy management; agriculture

1. Introduction Wireless Sensors and Actuators Networks (WSANs) is an established and challenging technology, with a great potential impact on the measurement, communication and control applications to a variety of activities of the modern postindustrial society. According to market analyses, WSAN node sales will constitute a multi-trillion market in the next few years [1,2]. Given the fact, during the last 25 years, the agricultural production sector has been transformed from a traditional labor-intensive sector into a technology-intensive one, it has been strongly considered as a very prosperous potential area for WSAN technology use. Indeed, a vast range of existing and future WSAN applications in agriculture have been identified and reported by many researchers [3–5]. Moreover, relatively-new terms have been introduced in current terminology, in order to express the trends in modern agriculture, such as: precision agriculture; precision farming; variable-rate management; etc. On the other hand,

Sensors 2016, 16, 1227; doi:10.3390/s16081227 www.mdpi.com/journal/sensors Sensors 2016, 16, 1227 2 of 59 the majority of WSAN deployments in agriculture are taking place on a short-scale research and development basis, rather than on a large-scale commercial solutions basis. The massive expansion of WSAN technology in agriculture appears to lag behind the market’s expectations. Many researchers haveSensors reported 2016, 16 certain, 1227 technological causes for this, which relate to hardware design issues,2 of 59 such as standardization in protocols and development tools, configurability, expandability, scalability in computingplace on , a short-scale and memory research capacity and development [3,6–9]. basis, rather than on a large-scale commercial solutions basis. The massive expansion of WSAN technology in agriculture appears to lag behind the Examining the idiosyncrasy of the real-world (real-life) WSAN applications, the most common market’s expectations. Many researchers have reported certain technological causes for this, which criticalrelate features to hardware found are:design the issues, operation such inas thestandardization real environmental in protocols and and spatiotemporal development conditionstools, (far awayconfigurability, from the expandability, lab), the systems scalability are on in the computing end-users power, hands, and thememory energy capacity autonomy, [3,6–9]. the need for long-termExamining serviceability the idiosyncrasy and management, of the real-world the maintainability, (real-life) WSAN the expandability, applications, the the most reconfigurability, common the reusability,critical features the robustness found are: the and operation ruggedness, in the the real long-standing environmental reliability and spatiotemporal and the low conditions cost per (far WSAN nodeaway [10]. from Therefore, the lab), any the single systems factor, are on which the end-us can negativelyers hands, the affect energy one autonomy, or more of the the need aforementioned for long- features,term couldserviceability jeopardize and management, the success the of themaintainabilit whole WSANy, the expandability, implementation. the reconfigurability, Regarding agriculture, the thesereusability, features have the robustness greater impact and ruggedness, to the success the long-standing of WSAN applications, reliability and because,the low cost traditionally, per WSAN this sectornode requires [10]. Therefore, scalable wireless any single networks factor, which comprised can negatively by large affect number one or of more nodes of the covering aforementioned huge physical features, could jeopardize the success of the whole WSAN implementation. Regarding agriculture, remote areas, capable of measuring a variety of physical parameters [11]. Furthermore, very often, the these features have greater impact to the success of WSAN applications, because, traditionally, this harshsector operating requires environment scalable wireless has been networks reported, comp byrised many by experts, large number as a major of sourcenodes covering of implementation huge problemsphysical [12 remote,13]. Extreme areas, capable temperatures, of measuring humidity, a variety rain, of physical snow, wind,parameters and [11]. sunlight Furthermore, , very can all seriouslyoften, threatthe harsh the operating normal operationenvironment of has WSAN been hardwarereported, by systems, many experts, which, as ina major their vastsource majority, of haveimplementation been designed problems for indoor [12,13]. environments Extreme temper (labs,atures, offices, humidity, etc.) rain, [6,9 snow,,14–16 wind,]. Unfortunately, and sunlight the physicalradiation, agricultural can all seriously environment threat cannot the normal successfully operation be of modeledWSAN hardware and tested systems, by simulation which, in their methods (e.g.,vast [17]). majority, For example, have thebeen behavior designed of for real indoor batteries environments [18,19] or the (labs, radio offices, signal etc.) propagation [6,9,14–16]. [20 ,21] are typicalUnfortunately, cases of the operation physical parametersagricultural environm that are extremelyent cannot successfully difficult to modelbe modeled and and fully tested simulate, by so the designsimulation of hardware methods WSAN(e.g., [17]). systems For example, for the the agricultural behavior of domain real batteries is more [18,19] complicated or the radio than signal in other propagation [20,21] are typical cases of operation parameters that are extremely difficult to model application domains. and fully simulate, so the design of hardware WSAN systems for the agricultural domain is more Sincecomplicated the early than days in other of the application WSAN technology domains. up to today, nodes’ hardware architecture was solely governedSince according the early to days the block of the diagramWSAN technology depicted up in Figureto today,1[ nodes’22,23]. hardware It is a microcontroller-based architecture was systemsolely with governed all the necessaryaccording to circuitry the block for diagram sensors, depicted and actuators, in Figure 1 equipped [22,23]. It is with a microcontroller- a radio frequency transceiverbased system for data with communicationall the necessary andcircuitry networking. for sensors, and Even actuators, recent researchequipped attemptswith a radio to use field-programmablefrequency transceiver gate for arrays data communication (FPGAs), instead and ofne microcontrollertworking. Even recent units research (MCUs), attempts in WSAN to use nodes are basedfield-programmable to the traditional gate architecture arrays (FPGAs), [24, 25instead]. In general,of microcontroller such a node units can (MCUs), be appropriately in WSAN nodes software configuredare based to to operate the traditional either architecture as end-device, [24,25]. router, In general, coordinator, such a node or, can with be someappropriately extra modifications, software as coordinatorconfigured to with operate gateway either as functionality. end-device, router, The rolecoordinator, configuration or, with issome dictated extra modifications, by the networking as coordinator with gateway functionality. The role configuration is dictated by the networking protocol protocol residing into the MCU’s program memory, in the form of a firmware stack. Moreover, there residing into the MCU’s program memory, in the form of a firmware stack. Moreover, there is a is a powerpower source,source, commonly commonly not not implemented implemented entirely entirely on-board on-board in order in orderto cover to coverthe energy the energyneeds of needs of thethe system’s system’scomponents. components. Regarding Regarding the the hardware hardware design design of the ofnodes, the nodes,several realizations several realizations that have that havebeen been introduced introduced in the in thelast lastfifteen fifteen years yearsare strongly are strongly influenced influenced by the doctrine by the ofdoctrine Smart Dust of concept Smart Dust concept(miniaturization, (miniaturization, etc.) [6,26]. etc.) [ 6The,26]. majority The majority of them of follow them followthe typical the typicalarchitecture architecture (Figure 1). (Figure In 1). In practice,practice, all all of of these these nodes nodes enabledenabled the the research research of of WSAN WSAN systems systems in agriculture, in agriculture, because because they theywere were mainlymainly used used as the as developmentthe development tools, tools, on theon the basis basis of whichof which several several conglomerate conglomerate WSAN WSAN studiesstudies were conductedwere conducted in the field. in the field.

FigureFigure 1. 1.Typical Typical architecturearchitecture of of a aWSAN WSAN node. node.

Sensors 2016, 16, 1227 3 of 59

However, the solutions based on the traditional architecture are under question about their effectiveness in real-world WSAN implementations in agriculture, especially, in the light of the continuously changing technological environment, which is influencing this particular domain. From its infancy, WSAN has been a multi-facet technology. Although WSAN hardware solutions have not been ready enough, in order to accommodate the present requirements of real-life applications, new WSAN applications raise new limits for the hardware systems [27]. Indicatively, wireless multimedia networks (WMNs) [28–30]; sensor clouds [7]; integration of WSAN and radio frequency identification (RFID) systems [31]; collaboration of WSAN and satellite technology [32]; internet of things (IoT) [33]; and so on, are only some of the trends in modern WSAN applications. Further, with regard to the purely technological aspects of this changing environment, there has been an explosion of new challenging technologies that potentially could help towards the design of more reliable, robust and efficient WSAN systems. Among the most interesting of such technologies are energy harvesting and power management [34]; new networking protocols, such as the IEEE 802.15.4x, LoRa-Net, 6LoWPAN [35,36], DASH7 [37], etc.; big data and data fusion [13]; new human-machine-interfaces (HMI) powered by smart phones and portable computing and connectivity [9]; new micro-electromechanical sensors (MEMS) and advanced sensory concepts such as the Lab-on-Chip (LoC) [38]; new embedded processors such as the low energy and high performance ARM microcontrollers [39,40]; and, new media such as lithium-ion-based batteries and hybrid ultra-capacitors [41,42]. Nowadays, the WSAN hardware solutions, as described in [6], are classified into three classes, namely end-to-end solutions, generic solutions, and research solutions. Furthermore, according to the same study, there are three different WSAN nodes design spaces: the network , the device space and the application space. Both the preceding and the contemporary nodes are far from meeting all the requirements of real-world applications. In order to ensure the success of WSAN implementations, there must be a close collaboration among the stakeholders, with the focus being on the application requirements. On the other hand, whatever the approach of the design space for WSAN hardware is, there are deficiencies in architectures openness, expandability, and configurability as well as complexities in implementation. As reported by many experts [3,6], in parallel to the lack of effective hardware design architectures, an additional significant barrier to successful systems development is the very long learning curves associated with several different aspects of the WSAN technology. This is the reason why a mix of multi-blended skills is necessary in research teams. A practical respond to overcome the know-how shortages, was the adoption of ready-made hardware solutions available in the market and their integration, in order to build final applications. This is commonly referred to as the commercial-of-the-shelf (COTS) approach. COTS are met either in the form of ready-made WSAN nodes, also known as motes, designed according to the traditional architecture [43], or in the form of specific-oriented testbeds. Admittedly, COTS-based is an attractive approach for many practical reasons: it helps to reduce the development time, it absolves developers from re-inventing the wheel, it closes knowledge and skills gaps by providing ready-made resources (protocol stacks, etc.), it is relatively lower in cost compared to new prototype systems that suffer from high non-recurring engineering (NRE) costs [44–47]. However, the adoption of COTS approach precludes, in many cases, the deliberation of researchers and practitioners to extend their study and application areas. Furthermore, COTS-based solutions have not been designed in order to cope with the harsh external environmental conditions of specific applications, as in the case of agriculture. Therefore, this hardware design approach appears to be one-way, for building pilot and proof of concept units, but due to the limited expandability and reconfigurability imposed by various bounded architectures (in fact, slightly modified alternatives of the traditional architecture of Figure1), it is incapable of supporting the requirements of real-world WSAN applications, especially in the agricultural domain [9,28,41,48]. WSANs’ developers in their persistent search of hardware platforms that allow for reconfigurability and expandability, have often recurred to generic open-source hardware (OSH, or OSHW) solutions such as the Arduino, Raspberry Pi and others [49–51]. Such platforms have been Sensors 2016, 16, 1227 4 of 59 mainly created for embedded systems students and hobbyists. In particular, all of these solutions rely on the scenario of a MCU-based board that can be programmed using easy-to-learn C-language functions (through application peripheral interface (API) libraries) and are easily expanded using pass-through pin-headers by connecting additional application-specific boards. A huge number of ready-made firmware applications, examples and other programming resources have been produced and are freely available as open-source code from an extremely big developers’ community. This is very attractive for engineers and researchers who wish to overcome the limitations of embedded systems design and programming [3,41,52]. In agriculture there are already WSAN applications, where the aforementioned multi-board platforms have been used, either in cases of new system designa, or in cases of modifications to expand the functions of existing systems [9,14,49,53]. Summarizing, all the existing hardware design approaches, namely, the traditional architecture, the COTS-based approach, and the expandable OSH multi-boards platforms, appear to impose significant limitations and they inhibit the expansion of real-world WSAN implementations. Under these circumstances, the end-users in agriculture are very skeptical regarding the benefits-to-cost ratio. Robust and reliable WSAN systems tolerant of real-world applications needs, is a mandatory factor for WSAN credibility [8]. As it has been highlighted in [3], there is a lack of complete frameworks capable of allowing the development of systems from data acquisition to modeling and decision support. Therefore, it is obivious that the required new platforms should meet both the research needs and the needs entailed by real-life applications in the field of agriculture. This paper proposes the SensoTube, as a new open-source-oriented architecture for designing WSAN systems, with emphasis on the real-world implementations in the agricultural domain. SensoTube aims to overcome existing difficulties and problems in systems design and to provide, in a well-standardized and open way for the endeavored expandability, scalability, reconfigurability, reusability, testability, energy efficiency, and encapsulation needed in real-world WSAN applications. The rest of the paper is structured in eight sections, as follows: Section2 presents the contemporary challenges and trends in WSAN node’s hardware design and focuses on the multi-board expandable architectures that are based on open-source-hardware approaches, due to their fundamental advantages. Moreover, several critical issues are identified in this section and they are categorized in five classes: signals management, power management, firmware development, programming and debugging and robustness and reliability. This section essentially aims at pointing out the reasons for which the existing expandable OSH architectures cannot be considered as being the best approach for real-life applications. Section3 presents the proposed new scalable multi-tier architecture, namely the SensoTube, for WSAN hardware design. In particular, this section explains the concept of the proposed architecture and it provides the details of its tiers’ operation, with emphasis on real-world WSAN applications in the agricultural domain. The implementation reference model of the SensoTube architecture is reported in Section4. In this section, the proposed mechanisms and methods for substantial boards’ expandability and control, in terms of signals, energy, communication, programming and debugging functions are also presented. Section5 presents the alternatives that a SensoTube-based WSAN system can support for firmware and software development. Section6 discusses the encapsulation approaches in WSAN deployments in the agricultural domain and it provides a critical analysis for the adoption of the tube-based encapsulation of the SensoTube architecture. Section7 presents certain use cases in with real measurements and data of three popular open-source hardware platforms, and it demonstrates the benefits for migrating existing open-source designs to SensoTube architecture. Section8 quotes the cost implications of the adoption of the proposed architecture. The paper is completed in Section9, wherein the key benefits of adopting the SensoTube architecture for stakeholders are discussed and summarized together with future research directions.

2. Challenges, Trends and Constraints in WSAN Hardware Design Designing hardware systems for WSAN is always an arduous . Knowledge, skills, and experience have to be demonstrated in fields such as digital and analog electronics, embedded systems, Sensors 2016, 16, 1227 5 of 59

MCUs’ firmware development, power electronics, sensors, radio frequency (RF) communications, wireless networking, printed circuits board (PCB) design, prototyping, testing and evaluation. Sensors 2016, 16, 1227 5 of 59 Furthermore, it is necessary to have a keen awareness of updated solutions launched by the microelectronicssystems, MCUs’ industry, firmware which candevelopment, benefit new power systems’ electronics, designs (i.e.,sensors, new integratedradio frequency semiconductors (RF) (ICs),communications, systems-on-chip wireless [54] and networki other electronicng, printed components,circuits board in(PCB) general). design, Diving prototyping, deep intotesting such and fields is veryevaluation. often out Furthermore, of scope, for it is example, necessary into caseshave a wherekeen awareness the aim of is updated to monitor solutions a particular launched physical by phenomenonthe microelectronics using WSAN industry, technology which in-situ. can benefi Althought new the systems’ aforementioned designs (i.e., requirements new integrated are critical preconditionssemiconductors to WSAN (ICs), systems,systems-on-chip they are [54] not and included other electronic in the training components, courses in general). for WSAN Diving systems deep into such fields is very often out of scope, for example, in cases where the aim is to monitor a and applications [55]. The view perspectives of what is a WSAN system may vary among different particular physical phenomenon using WSAN technology in-situ. Although the aforementioned areas of interest [6]. In particular, for the agricultural domain, the various differences in perspectives requirements are critical preconditions to WSAN systems, they are not included in the training of a WSANcourses nodefor WSAN are summarized systems and inapplications Table1. [55]. The view perspectives of what is a WSAN system may vary amongTable different 1. Different areas perspectives of interest [6]. of WSANIn particular, node infor the the agricultural agricultural domain. domain, the various differences in perspectives of a WSAN node are summarized in Table 1. Area of Interest What a WSAN Node Means Table 1. Different perspectives of WSAN node in the agricultural domain. Embedded Electronics A fast, miniaturized, MCU-based board CommunicationsArea of Interest What A protocol-powered a WSAN Node Means machine InformationEmbedded Technology Electronics (IT) A fast, miniaturized, A MCU-based client board ElectronicsCommunications Industry A protocol-powered A development machine tool Agriculture originalInformation equipment Technology manufacturing (IT) (OEM) A proprietary, A client closed, turn-key solution AgriculturalElectronics Science Industry A remotedevelopment sensor/actuator tool Agriculture originalFarmers equipment manufacturing (OEM) A proprietary, An expensive closed, telemetry turn-key equipmentsolution Agricultural Science A remote sensor/actuator Farmers An expensive telemetry equipment Design inefficiencies like the fragmentation and limitations caused by the lack of skills can jeopardizeDesign the anticipated inefficiencies full-scale like the commercialization fragmentation and and limitations popularization caused by of WSANthe lack systems.of skills can In order to buildjeopardize successful the systemsanticipated that full-scale can face commercialization the difficulties and and the popularization requirements of ofWSAN real-life systems. applications, In eachorder stakeholder to build hassuccessful to take systems into considerationthat can face th othere difficulties stakeholders’ and the re needsquirements and idiocyncracies.of real-life applications, each stakeholder has to take into consideration other stakeholders’ needs and As depicted in Figure2, there are five major stakeholder groups, namely the application experts, idiocyncracies. As depicted in Figure 2, there are five major stakeholder groups, namely the the systems , the end-users, the industry/market, and the authorities (the external circle application experts, the systems designers, the end-users, the industry/market, and the authorities in Figure(the external2). The arrowscircle in Figure illustrate 2). The the arrows influence illustra betweente the influence different between parts. different Practically, parts. this Practically, influence is basedthis on influence the flow is of based tangibles on the (e.g., flowtechnologies, of tangibles (e.g., systems, technologies, tools, documents,systems, tools, etc.) documents, and intangibles etc.) and (e.g., skills,intangibles ideas, needs, (e.g., expectations, skills, ideas, needs, etc.). expectations, etc.).

FigureFigure 2. Interactions 2. Interactions among among different different stakeholders stakeholders in in WSAN WSAN hardware hardware systems systems design. design.

Obviously, the typical architecture of Figure 1 or the COTS approach cannot support the design Obviously,of systems that the typicalwill meet architecture all the expectations of Figure1 of or everyone the COTS that approach has a vested cannot interest support in thea WSAN design of systemsapplication. that will On meet the all other the expectationshand, the reaction of everyone of the expandable that has a multi-board vested interest systems’ in a WSAN designers application. and On thedevelopers other hand, signals the the reaction direction of the for expandable future arch multi-boarditectures, in order systems’ to confront designers the and changing, developers signalsdemanding, the direction and complex for future applications’ architectures, ecosystems. in order to confront the changing, demanding, and complex applications’ ecosystems.

Sensors 2016, 16, 1227 6 of 59

2.1. Embedded Systems Development Technologies and Market Trends Embedded systems technology has strongly been influenced by the dramatic changes that have occurred in the mobile phone market. In the last decade, consumer demand for ever more powerful smart phones have driven the electronics industry to design and manufacture high processing and low power MCUs and microprocessors (MPUs). This evolution has helped the introduction of mobile computing devices, e.g., tablets, etc., which in turn has acted as an additional reason for the development of new semiconductors, processors, sensors, batteries, and communication modules. Due to economies of scale of such markets, the cost of embedded systems has significantly diminished, whilst the cost-to-performance ratio has increased notably. Consequently, the design of hardware WSAN solutions has vastly been affected by the aforementioned changes. In Figure3, the most important changes in technologies and approaches associated with the sub-parts of the typical WSAN node system, in the last decade, is illustrated. Obviously, nowadays, experienced designers and developers have plenty of choices at their disposal, in order to build either end-to-end generic commercial solutions or optimized application-specific solutions. In particular, in the field of agriculture, there are stanch technologies for energy, communications, processing, etc. that can positively help towards the development of reliable and vigorous outdoor WSAN systems. Of course, the lack of skills and knowledge make these efforts difficult.

Figure 3. Technological trends and changes influencing the design of a WSAN hardware system. Sensors 2016, 16, 1227 7 of 59

On the other hand, this technological breakthrough brings about hurdles race conditions, because the revolutionary technologies have to be quickly assimilated and used, new development tools have to beSensors launched 2016, 16 to, 1227 support designers in the previous effort as well as to produce new technology7 of 59 in their turn, whilst at the same time, under the pressure of stakeholders for robust and standardized solutions, On the other hand, this technological breakthrough brings about hurdles race conditions, the new solutions have to be commercialized as soon as possible. As a response to this perpetual need, because the revolutionary technologies have to be quickly assimilated and used, new development manytools significant have to developmentsbe launched to support have been designers made byin the the previous electronics effort industry as well andas to market, produce in new order to providetechnology new tools, in their methods turn, whilst and solutions at the same that time, encapsulate under the new pressure technology of stakeholders and allow for fastrobust prototyping and (suchstandardized as the Mbed solutions, [56] and the Codebender new solutions [57], have and i-Senseto be commercialized [58]). The real as revolution soon as possible. came from As a a new arearesponse of systems to this development, perpetual need, the many so-called significant open-source developments software have and been hardware. made by the According electronics to this concept,industry the variousand market, design in order artifacts, to provide i.e., documentation, new tools, methods circuits, and solution softwares that code, encapsulate hardware new project implementations,technology and application allow fast prototyping case studies, (such etc. as are the freelyMbed [56] shared and amongCodebender big users’ [57], and communities i-Sense [58]). under the licenseThe real scheme revolution of Creative came from Commons a new area Attribution of systems Share-Alike, development, which the so-called allows for open-source both personal software and hardware. According to this concept, the various design artifacts, i.e., documentation, and commercial derivative works as long as the credit to original creator is granted [59]. The most circuits, software code, hardware project implementations, application case studies, etc. are freely successful case of the open-source design approach is the Arduino platform [60]. shared among big users’ communities under the license scheme of Creative Commons Attribution Share-Alike,The Arduino which platform allows (Arduinofor both personal SRL, Scarmagno, and commercial TO, derivative Italy) is aworks MCU-based as long as board the credit using an Atmelto AVRoriginal 8-bit creator MCU, is granted which provides[59]. The most all of success the microcontroller’sful case of the open-source pins to pass-throughdesign approach pin-headers. is the ThroughArduino these platform headers, [60]. all the major functional peripherals of the MCU are available to users. Users, inThe their Arduino turn, platform can connect (Arduino other SRL, personal Scarmagno, or commercial TO, Italy) is hardwarea MCU-based boards, board called using an shields, to theAtmel main AVR Arduino 8-bit MCU, board, which in provides order to all build of the theirmicrocontroller’s own specific pins applications. to pass-through In pin-headers. order to make easyThrough the firmware these headers, development all the major process functional to users peri withoutpherals of much the MCU experience are available in embedded to users. Users, systems, Arduinoin their provides turn, can a ready-made connect other library personal of APIsor commercial in its integrated hardware development boards, called environment shields, to the (IDE). main Thus, Arduino board, in order to build their own specific applications. In order to make easy the firmware developers dispose an open-source hardware and software platform that allows the expandability development process to users without much experience in embedded systems, Arduino provides a and reusability they are looking for. Despite the fact that Arduino was originally established for ready-made library of APIs in its integrated development environment (IDE). Thus, developers educationdispose and an hobbyistsopen-source [61 ],hardware it soon becameand software very popularplatform in that research allows and the development expandability of and real-life applications,reusability even they inare demanding looking for. Despite areas, suchthe fact as that agriculture. Arduino was In originally recent years, established the electronics for education industry realizedand hobbyists the advantages [61], it soon of the became open-source very popular design in research approach and anddevelopment Arduino of concept real-life andapplications, it is foreseen as aeven new in prosperous demanding market. areas, such The as ideaagriculture. of expandable In recent years, modular the electronics hardware industry development realized tools the and the application-centricadvantages of the open-source programming design concepts, approach of and course, Arduino cannot concept be attributedand it is foreseen to Arduino as a new or to its successors.prosperous Many market. implementations, The idea of such expandable as the Basic modular Stamp hardware for MCU development programming tools in Basic and languagethe at earlyapplication-centric 1990s [62,63], andprogramming the e-Blocks concepts, modular of hardwarecourse, cannot tools be [64 attributed], targeted to providing Arduino or easy-to-build to its successors. Many implementations, such as the Basic Stamp for MCU programming in Basic language hardware embedded systems. The reason that these efforts didn’t attract the popularity of Arduino at early 1990s [62,63], and the e-Blocks modular hardware tools [64], targeted providing easy-to-build concept is probably associated with the fact that they were single-source commercial solutions with hardware embedded systems. The reason that these efforts didn’t attract the popularity of Arduino negativeconcept cost is andprobably openness associated implications. with the fact The that free they support were single-source from a vast commercial community solutions of designers with and developers,negative incost the and case openness of open-source implications. platforms, The free support has made from the a vast big community difference, ofand designers it seems and to be the solutiondevelopers, to thein the way case out of ofopen-source the demanding platforms, conditions has made for the integration big difference, and and use it seems of new to technology,be the especiallysolution in to cases the suchway out as WSANs.of the demanding conditions for integration and use of new technology, especiallyToday, there in cases are such two as popular WSANs. competitive open-source platforms, namely the Arduino [60] (Figure4a)Today, and thethere Lauchpad are two popular (Figure 4competitiveb) from Texas open Instruments-source platforms, (Dallas, namely TX, USA)the Arduino [ 65]. [60] For each platform,(Figure there 4a) and are the several Lauchpad add-on (Figure boards 4b) from aiming Texas Instruments to provide (Dallas, application-specific TX, USA) [65]. For functionality, each platform, there are several add-on boards aiming to provide application-specific functionality, produced by the original creators or by third parties such as companies or individuals from various produced by the original creators or by third parties such as companies or individuals from various users’ communities. Both Arduino and Launchpad provide several alternatives, in terms of processing users’ communities. Both Arduino and Launchpad provide several alternatives, in terms of power,processing number power, of input/output number of inpu pinst/output and peripherals. pins and peripherals.

(a)(b)

Figure 4. Expandable open-source platforms: (a) Arduino Uno; (b) Launchpad MSP430. Figure 4. Expandable open-source platforms: (a) Arduino Uno; (b) Launchpad MSP430.

Sensors 2016, 16, 1227 8 of 59 Sensors 2016, 16, 1227 8 of 59

InIn the the meantime, meantime, all all the the key-player key-player semiconductor semiconductor manufacturers manufacturers decided decided to to launch launch Arduino-like, Arduino- orlike, Arduino-compatible, or Arduino-compatible, platforms, platforms, in order toin promoteorder to their promote own newtheir MCUs own andnew microelectronics MCUs and portfolios.microelectronics Among portfolios. these platforms,Among these they platforms, are the they Nucleo are the from Nucleo ST-Microelectronics from ST-Microelectronics (Geneva, Switzerland)(Geneva, Switzerland) [66], the FRDM [66], the from FRDM Freescale/NXP from Freescale/NXP (Eindhoven, (Eindhoven, The Netherlands) The Netherlands) [67], the [67], XPresso the fromXPresso NXP from [68], andNXP Blackfin [68], and DSP Blackfin platform DSP from platfo Analogrm from Devices Analog (Analog Devices Devices (Analog Inc., Norwood,Devices Inc., MA, USA)Norwood, [69]. Others, MA, USA) such as[69]. Infineon Others, (Infineon such Technologiesas Infineon (Infineon AG, Neubiberg, Technolo Germany),gies AG, haveNeubiberg, launched application-specificGermany), have launched Arduino application-specific shields [70]. As the Ardu acceptanceino shields of the [70]. open-source As the acceptance expandable of the platforms open- (OSEP)source increased, expandable the platforms introduction (OSEP) of the increased, single-board-computers the introduction (SBCs) of the extended single-board-computers the capabilities of such(SBCs) platforms, extended regarding the capabilities the processing of such and platforms, computational regarding power, the theprocessing use of open-source and computational operating systemspower, suchthe asuse Linux, of open-source interface of operating low-cost USBsystem communications such as Linux, modules interface (WiFi, of ZigBee, low-cost Bluetooth, USB GSMcommunication modules etc.), modules and the (WiFi, connectivity ZigBee, Bluetooth, with cameras GSM and modules screen etc.), displays, and the interfacing connectivity with with audio sourcescameras and and outputs, screen displays, etc.. The interfacing most of these with audio SBCs sources are miniature and outputs, in their etc.. physical The most dimensions of these SBCs (i.e., credit-cardare miniature sized), in their low-power physical and dimensions low-cost (i.e., compared credit-card to mini sized), computers. low-power The and expandable low-cost compared SBCs allow veryto mini easily computers. the development The expandable of web-based SBCs applications allow very that easily is very the usefuldevelopment for WSAN of web-based applications inapplications remote areas that (common is very inuseful agriculture). for WSAN Some applications of the SBCs in remote provide areas hosting (common of Arduino in agriculture). shields, in orderSome to of ensure the SBCs compatibility provide hosting with all of theArduino already shields, existing in order application to ensure shields. compatibility Thus, the with result all of the this already existing application shields. Thus, the result of this compatibility is the reusability of compatibility is the reusability of hardware implementations. hardware implementations. Among the most popular SBCs are the BeagleBone (BeagleBoard.org Foundation, Oakland Twp, Among the most popular SBCs are the BeagleBone (BeagleBoard.org Foundation, Oakland Twp, MI, USA) [71], the Raspberry Pi (Raspberry Pi Foundation, Caldecote, Cambridgeshire, UK) [72], and MI, USA) [71], the Raspberry Pi (Raspberry Pi Foundation, Caldecote, Cambridgeshire, UK) [72], and the Galileo from Intel (Santa Clara, CA, USA) [73]. The most recent of these derivatives, namely the the Galileo from Intel (Santa Clara, CA, USA) [73]. The most recent of these derivatives, namely the Raspberry Pi 2, the BeagleBone Black, and the Galileo Gen2 are illustrated in Figure5. Following the Raspberry Pi 2, the BeagleBone Black, and the Galileo Gen2 are illustrated in Figure 5. Following the introductionintroduction of of these these SBCs, SBCs, otherother movementsmovements to th thee same same direction direction took took place place either either from from Arduino Arduino (e.g.,(e.g., Arduino Arduino Tre, Tre, Leonardo, Leonardo, and and Due) Due) [[74],74], oror fromfrom well-known semiconductors semiconductors industries industries such such as as Freescale/NXPFreescale/NXP (FRDM (FRDM Kinetis Kinetis KL64) KL64) [ 75[75].]. A A well-documented well-documented presentation presentation and and comparison comparison of of all all the existingthe existing SBCs SBCs is given is given in [76 in]. In[76]. general, In general, the SBCs the SBCs cannot cannot be considered be considered as a as design a design basis basis for thefor buildthe ofbuild a WSAN of a WSAN node because node because of their of extended their extended requirement requirement for energy. for energy.

(a) (b)(c)

Figure 5. Expandable open-source single-board-computers (SBCs) platforms: (a) Raspberry Pi 2; Figure 5. Expandable open-source single-board-computers (SBCs) platforms: (a) Raspberry Pi 2; (b) BeagleBone Black; (c) Intel Galileof Gen2. (b) BeagleBone Black; (c) Intel Galileof Gen2. The multi-board expandable platform architectures have significantly influenced the typical architectureThe multi-board of WSAN expandable nodes hardware platform design. architectures The functional have blocks significantly that are depicted influenced in Figure the typical1, is, architecturenow, possible of WSANto be physically nodes hardware separated design. from Theeach functional other thanks blocks to the that boards’ are depicted mechanical in Figure and 1, is,physical now, possible layer “standardization”. to be physically separated from each other thanks to the boards’ mechanical and physical layer “standardization”. 2.2. Multi-Board Architectures Expandability Mechanisms 2.2. Multi-Board Architectures Expandability Mechanisms In order to connect two printed-circuit boards (PCBs), it is necessary to use board-to-board connectors.In order On to connectthe other two hand, printed-circuit in order to connect boards more (PCBs), than it two is necessaryboards, a solution to use board-to-board that ensures connectors.boards to be On stackable the other has hand, to be in used. order Multi-boar to connectd platforms, more than such two as boards, Arduino, a solution adopted that the ensurespass- boardsthrough to be pin-headers stackablehas (see to Figure be used. 6a). Multi-board There is not platforms, an established such name as Arduino, for these adopted headers. the Sometimes, pass-through pin-headersone refers to (see them Figure as pin-headers6a). There is with not anlong established pins, or just name as Arduino for these headers. headers. InSometimes, this work, the one term refers “boards-expansion-connectors” (BECs) is proposed. BECs are placed and soldered on boards and they

Sensors 2016, 16, 1227 9 of 59 to them as pin-headers with long pins, or just as Arduino headers. In this work, the term “boards-expansion-connectors” (BECs) is proposed. BECs are placed and soldered on boards and they usually have a male and a female side, so as to allow for boards stackability. Initially, Arduino architectureSensors used 2016, four16, 1227 BECs in total (Arduino Uno Rev. 3) [77,78], in order to connect, in9 of a 59 somewhat random way, all the pins of its MCU (Figure6b). Practically, the Arduino BECs provide a mechanical usually have a male and a female side, so as to allow for boards stackability. Initially, Arduino and physicalarchitecture access used to four the BECs on-board in total MCU. (Arduino Whilst Uno Rev. this 3) [77,78], technique in order seems to connect, quite in simple, a somewhat in terms of state-of-the-artrandom microelectronics,way, all the pins of its MCU it freed (Figure engineers 6b). Practically, by giving the Arduino them BECs a convenient provide a mechanical way to design expandableand and physical reusable access hardware. to the on-board Further, MCU. thisWhilst technique this technique is particularly seems quite simple, used in inradio terms of communication state- modulesof-the-art that come microelectronics, with BECs, init freed order engineers to be placed by giving on them different a convenient MCU-based way to design boards. expandable This capability and reusable hardware. Further, this technique is particularly used in radio communication modules allows systemsthat come designers with BECs, to in plug order in to and be testplaced several on different alternatives MCU-based for wirelessboards. This communication, capability allows using the same MCU-basedsystems designers main-board. to plug in and test several alternatives for wireless communication, using the same BesidesMCU-based its easy main-board. way of firmware applications development through high APIs, Arduino owes its popularityBesides its in easy the BECsway of approachfirmware applications for expandability. development Any through third-party high level board, APIs, Arduino which hosts the four Arduinoowes its BECs popularity in the in exact the BECs physical approach places, for expandability. it can be considered Any third-party as an board, Arduino which expansion hosts the shield. four Arduino BECs in the exact physical places, it can be considered as an Arduino expansion shield. This way,This designers way, designers are free are to free develop to develop the the application application shields for for their their particular particular applications. applications.

(a) (b)

Figure 6. (a) An 8-pin boards expansion connector (BEC); (b) Arduino Uno Rev. 3 microcontroller’s Figure 6. pin(a) and An its 8-pin four BECs. boards expansion connector (BEC); (b) Arduino Uno Rev. 3 microcontroller’s pin and its four BECs. With regard to the applications in agriculture, the typical architecture of WSAN nodes can take a stackable form, allowing, as much as possible, for facilitating the dramatic technological changes With(see regard Figure to 3). the applications in agriculture, the typical architecture of WSAN nodes can take a stackable form,In Figure allowing, 7a, an as much of as the possible, physical for transformation facilitating of the a WSAN dramatic nodetechnological keeping all the changes (see Figurefunctional3). parts of the typical architecture together, but mechanically separated from each other, is In Figuregiven. 7Thisa, an approach illustration has started of the to physicalbecome po transformationpular in WSAN applications of a WSAN development node keeping in the all the agricultural domain and appears to be the solution for the sought reconfigurable WSAN nodes [79– functional parts of the typical architecture together, but mechanically separated from each other, 82]. Figure 7b shows a WSAN node built on one Arduino main-board and two expansion shields, one is given.with This Ethernet approach networking has started circuitry to [83], become and a second popular one inwith WSAN a IEEE802.15.4/ZigBee applications radio development module in the agricultural(in domainparticular, and XBee appears moduleto [84]). be theIn parallel solution wi forth the the increase sought of reconfigurable acceptance of the WSAN expandable nodes [79–82]. Figure7bplatforms, shows a WSANthere has node been builtan expansion on one of Arduino the requir main-boardements and expectations and two expansion to be fulfilled shields, by this one with Ethernetapproach. networking Consequently, circuitry all [ 83the], key-player and a second electronic ones industries with a have IEEE launched 802.15.4/ZigBee boards that keep radio the module mechanical compatibility with the Arduino platform, but they have also put more powerful (in particular,processing XBee units module and extra [84 BECs]). In(even parallel Arduino with does theso). Of increase course, the of mandated acceptance increasing of the need expandable platforms,for there systems’ has beenexpansion an expansion negatively ofimpacts the requirements any attempt and for expectationsmechanical and to befunctional fulfilled by this approach.standardization. Consequently, Others all provide the key-player development electronics platforms that industries are mechanically have launchedcompatible with boards more that keep the mechanicalthan one compatibilityplatforms, e.g., the with Arduino the and Arduino Mbed [66,68], platform, or Arduino but theyand Launchpad have also [85]. put more powerful In general, there is a race in the industry to provide expandable solutions. In practice, their processing units and extra BECs (even Arduino does so). Of course, the mandated increasing need for efforts are focusing on the physical layer design through the introduction of different mechanical systems’expansion expansion mechanisms. negatively impacts any attempt for mechanical and functional standardization. Others provide development platforms that are mechanically compatible with more than one platforms, e.g., the Arduino and Mbed [66,68], or Arduino and Launchpad [85]. In general, there is a race in the industry to provide expandable solutions. In practice, their efforts are focusing on the physical layer design through the introduction of different mechanical expansion mechanisms. Sensors 2016, 16, 1227 10 of 59 Sensors 2016, 16, 1227 10 of 59

(a) (b)

Figure 7. (a) The typical WSAN node architecture implementation following the stackable boards Figure 7. (a) The typical WSAN node architecture implementation following the stackable boards ; (b) an Arduino Uno Rev. 3 expanded with two application shields, one for Ethernet fashion; (b) an Arduino Uno Rev. 3 expanded with two application shields, one for Ethernet networking networking and one for wireless communication using an IEEE802.15.4/ZigBee radio module. and one for wireless communication using an IEEE 802.15.4/ZigBee radio module.

2.3. Open-Source-Hardware Architectures versus Open-Architecture Systems 2.3. Open-Source-Hardware Architectures versus Open-Architecture Systems Undoubtedly, OSH architectures have been seen as a significant way to avoid having to design Undoubtedly, OSH architectures have been seen as a significant way to avoid having to design hardware systems from scratch. For WSANs systems, the adoption of the OSH expandable multi- hardware systems from scratch. For WSANs systems, the adoption of the OSH expandable multi-board board architectures is very convenient, due to the fact that the developers (engineers and researchers) architectures is very convenient, due to the fact that the developers (engineers and researchers) can test, can test, evaluate and integrate several wireless connectivity solutions coming in the form of plug-in evaluate and integrate several wireless connectivity solutions coming in the form of plug-in modules modules together with several MCUs’ main-boards alternatives. This approach increases the degree together with several MCUs’ main-boards alternatives. This approach increases the degree of freedom of freedom and decreases the development cycle time in sake of the applications deployment. and decreases the development cycle time in sake of the applications deployment. In the following subsections we identify and present several constraints associated with the In the following subsections we identify and present several constraints associated with the existing OSH expandable architectures in order to emphasize the need for new solutions that could existing OSH expandable architectures in order to emphasize the need for new solutions that could help the open-source approach to make the next step, namely the step from the prototyping to the help the open-source approach to make the next step, namely the step from the prototyping to the optimization and reliability. optimization and reliability.

2.3.1. Signals Management Constraints (a)(a) Signal conflicts conflicts and short-circuits: According to the expandable multi-board architectures, all the inputinput and and output pins pins (i.e., digital, analog, bu busesses and ports pins) are coming directly from thethe main-board’s MCU MCU and, and, through through the BECs, are av availableailable for use by the rest of thethe expansionexpansion shields.shields. The The MCU MCU solely solely manages manages every every pin pin regarding regarding its signal direction (i.e., input or output), itsits function, function, and and its frequency of operation. Expansion shields cannot change the characteristics of the BECs signal-pins. On On the other hand, if a pi pinn is declared, for example, as output from the MCU, then, this signal must be an input for the rest of thethe shields,shields, otherwiseotherwise seriousserious problemsproblems will appear due to electrical short-circuits. (b) Limited multi-MCU development: The egocentric style of pins management by the main-boards (b) Limited multi-MCU development: The egocentric style of pins management by the main-boards does not allow for real multi-processor designs. Thus, it is very difficult to have two or more does not allow for real multi-processor designs. Thus, it is very difficult to have two or more shields with a MCU in each of them, which, at the same time, are managing some of the signals shields with a MCU in each of them, which, at the same time, are managing some of the signals of the common BECs. of the common BECs. (c) Waste of existing system’s resources: In the OSEP-based WSAN hardware implementations it is (c) Waste of existing system’s resources: In the OSEP-based WSAN hardware implementations it is very very common to plug-in a wireless communication module on a MCU-based main-board shield. common to plug-in a wireless communication module on a MCU-based main-board shield. In this In this case, the MCU just reads and writes data from/to the wireless module through an case, the MCU just reads and writes data from/to the wireless module through an embedded embedded serial port or bus (e.g., UART port, I2C-bus, or SPI-bus). In practice, the majority of serial port or bus (e.g., UART port, I2C-bus, or SPI-bus). In practice, the majority of the wireless the wireless modules have their own MCU into which the communication stack is running, modules have their own MCU into which the communication stack is running, while several while several input and output pins and ports are available to the developer for application use. input and output pins and ports are available to the developer for application use. This means This means that, in this design, there are two MCUs, but, in practice, just one MCU can be used that, in this design, there are two MCUs, but, in practice, just one MCU can be used for the for the application’s scenario (that of the main-board), so the distribution of processing power among the shields is rather limited and several development resources are left unused.

Sensors 2016, 16, 1227 11 of 59

application’s scenario (that of the main-board), so the distribution of processing power among the shields is rather limited and several development resources are left unused. (d) Signal voltage level incompatibilities: Several times, there is incompatibility in terms of the logic levels of the signal pins among the various expansion shields. In the embedded systems circuits, there are two typical logic families, that of +5 Vdc and that of the +3.3 Vdc. In cases where two or more expansion shields, with different voltage logic levels, have to be interconnected through common BECs, then, specific extra logic level translators circuits must be in place. Depending on the direction of the signal pins, i.e., inputs or outputs or both, the voltage level translators should be single-directional or bi-directional. This issue cause extra cost, more physical space on the shields’ boards, and degradation in energy efficiency, as well as reduction of reusability of shields. (e) Unused signal pin conditioning: When the application does not need all of the available pins from the BECs, then, these pins are left floating, in terms of circuit termination. Each particular MCU explicitly defines the signals conditioning for its unused signal pins. The lack of unused pins management can cause significant problems related to the loss of energy, poor electromagnetic noise immunity, low ESD and EMI performance [86], and application scenario intermittent execution caused by erroneous interrupts activation in the MCU’s firmware. The definition of the unused pins level can be done either by enabling the MCU’s internal pull-up resistors or by connecting external pull-up or pull-down resistors. In both cases, there are energy balance disorders. On the other hand, there is no provision for the external resistors in the main-boards or in the rest of the expansion shield boards [87]. (f) Signal routing inflexibility: There is no mechanism to terminate the route of the BECs signals at the shields level. For instance, when the MCU outputs a signal to a particular shield, then this signal is needlessly forced to be an input to the rest shields due to the common BECs signal pins. On the other hand, the existing BEC style of mechanical standardization limits the full exploitation of the overall system, since any single signal of the BECs, except from the supply voltages and ground pins as well as the data busses pins, can be used only from one shield and the main-board, so the functionality is sacrificed on the altar of the invaluable expandability and reusability.

2.3.2. Power Management Constraints (a) Poor energy conversion efficiency: Due to the fact tha, all the OSH expandable architecture solutions have originally been designed for pilots and proof of concepts in indoor test environment, they disregard the need for efficient power management. For WSAN applications in the field of agriculture where the hardware nodes have to be battery-operated, the existing OSH architectures entail problems, because these solutions are not energy optimized. Arduino-like as well as the SBC hardware solutions require external +5 Vdc power sources, which in most of the cases is coming from the USB port of a personal computer. Some of these solutions also accept external supply voltages above the +5 Vdc, usually ranging from +7 Vdc up to a maximum of +18 Vdc. To keep the manufacturing cost down, the shields designers’ choice, for the external voltage management, is to use linear voltage regulators. These electronic components don’t require much physical space on the boards, but, on the other hand, they suffer from very low energy efficiency. Also, the higher the external supply voltage value is from the base +5 Vdc value, the more energy is lost in form of at the regulator’s package. Therefore, the use of this type of voltage regulators, in the multi-board architectures, downgrades the overall energy efficiency of the final system. (b) Inability to ensure the power of the expansion shields: After the regulation of the external voltage, the voltage supply signal of the MCU, e.g., +5 Vdc, is routed to the related BECs pins in order to power the expansion shields. Unfortunately, the amount of power that can be drawn from the expansion shields is limited by the particular voltage regulator of the main-board shield [88]. When the expansion shields require levels of power higher than that sourced from the main-board, Sensors 2016, 16, 1227 12 of 59

then, some or all of the shields must have their own power source circuits, in order to be able to accept external power. (c) Power cabling ataxia: The high power consuming shields have their own connection terminal blocks or headers separated from the common BECs. In this way, the total shields constructions are suffering, not only from poor energy inefficiency, but also from power cabling ataxia. The power cabling burdens the ESD and EMI performance and makes the system vulnerable to noise interferences. This problem is significantly escalated when, in the multi-board system, there is the need for secondary voltages, e.g., +3.3 Vdc for some shields with low power MCUs. (d) No provision for voltage signals other than logic levels: Various difficulties appear when higher voltages than the basic +5 Vdc and +3.3 Vdc, e.g., +12 Vdc, are required to drive actuators’ loads. In this circumstance, the use of particular external power supply units for the system is mandatory. From the physical layer perspective, none of the existing OSEP mechanisms of expansion is supporting the physical connection of multi-value voltage signals. (e) Energizing unnecessary circuits: In the expandable architectures boards, it is very popular for the main-boards and their shields to have some extra circuitry for general-purpose use, e.g., LEDs, MEMS-based sensors, etc. Actually, this is a very common practice also in WSAN end-solution and COTS solutions [43]. Such extra circuitry may be useful for testing, during the development phase, but it is totally useless in the final in-situ application, because it wastes significant amounts of energy. For battery-operated WSAN systems in the agricultural environment, this testing circuitry degrades the valuable available energy. Unfortunately, the existing OSEP architectures do not have any provision for this constraint, so there is no mechanism for developers to disengage that extra circuitry, in order to build energy optimized systems. To emphasize this problem, a single LED indicator that is blinking inside of a closed plastic box, installed in the agriculture field, is useless for the users and it consumes more energy than that consumed by e.g., a ZigBee RF transceiver.

2.3.3. Firmware Development Constraints (a) Lack of code optimization: The application scenario that is hosted and running in the program memory of the main-board’s MCU, also called as firmware, normally ought to be optimized and tidily developed, so as to ensure the reliability of the ultimate hardware system. In the case of the Arduino-like expandable architectures, the firmware development is mainly implemented into the particular IDE of the hardware vendors. Whilst such IDEs provide many development facilities to the engineers through the use of extensive ready-made APIs or project templates, they produce firmware that is far from being optimized. For instance, the firmware for just toggling a single LED indicator may involve several kilobytes of program code. Every single line of code in the firmware, when it is executed by the processor, consumes a portion of the available system’s energy. In battery-operated WSAN systems, such in the case of remote agricultural applications, wordy firmware is a well-hidden source of energy wastage. Thus, the ease of firmware development is counteracted by the excess in . Today, there are programming tools solutions for the open-source developers that can help to the production of efficient and optimized code (e.g., mbed IDE). Hence the key point is the firmware developers to start thinking about the energy effectiveness. (b) No provision for multi-MCU development: According to the existing OSEP architectures, the application scenario of the system is solely developed with the MCU of the main-board. The OSEPs’ IDEs support only one MCU per application. The concept of multi-MCU aspect is totally absent from the design strategies. (c) Evanescence of the hardware realm: The trend of open-source to use ready-made pieces of firmware or even complete projects from the developers’ community is very catty, because the hardware details are totally ignored, or in the best cases, they are partially acknowledged. Sensors 2016, 16, 1227 13 of 59

2.3.4. Programming and Debugging Constraints (a) Peripherals and energy charge: One of the most convenient and low cost methods to download the firmware to the program memory of a MCU is the in-circuit programming, or else, in-system programming. The hardware implementation of this programming method requires the usage of a certain number of the MCU’s pins (i.e., Vdd, Vss, Reset, SPI pins, UART pins, etc.), which have to be connected accordingly, in order the MCU to be programmed directly by a personal computer via a USB port or by inserting specific external serial programming devices. Whilst, the programming operation takes place once in-house and lasts for a few minutes, the programming circuitry remains permanently on-board. Furthermore, this circuitry may cause electrical conflicts with other shields, because the programming pins are physically routed to the rest of the shields through the BECs, so in most of the cases, it is mandatory to remove any connected shields before a MCU-based shield programming take place. (b) Limited debugging capabilities: Since, the development of the firmware is mostly based on a combination of ready-made open-source parts of code, written by someone else, it is very critical for the system to be able to support real-time debugging with all the shields engaged. (c) Lack of support for multi-MCU development: OSEP expandable architectures cannot support multi-core developments. Practically, the main-board and each one of the expansion shields which incorporate a MCU must host their own programming and debugging circuits on-board.

2.3.5. Robustness and Reliability Constraints Of course, all the aforementioned constraints can harm, in a lower or higher degree, the robustness and the reliability of the total system, but there are also some additional issues that relate to the real-life applications: (a) Lack of compliance to norms and regulations: Because the majority of the existing OSEP solutions are considered as prototyping development tools, they are not tested and certified in terms of specific norms and regulations for particular application domains. (b) Poor system’s integrity and reliability: The absence of a central power management mechanism, the erroneous electromagnetic sources from sketchy handling of the unused BECs’ pins (these pins may act as antennae), and the uncontrolled performance in the various shields from different vendors, constitute only some of the issues that are responsible for poor reliability. In addition, certain security issues may arise for some MCUs which are very popular in the OSH platforms [89]. (c) No form factor and encapsulation provision: Any WSAN application domain has its own particular requirements for the form factor and the encapsulation of the systems in order to facilitate the deployment and to ensure the longevity of the systems. The existing OSEP solutions do not care about the physical dimensions of the final implementation.

3. The SensoTube Architecture Taking into consideration the constraints mentioned in the previous section, the prospect of a new scalable architecture which, on one hand, can maintain the obvious advantages of the OSH expandable architectures, and, on the other hand, can help OSH concept take the next step towards optimization and reliability by provide the mechanisms for avoiding the existing limitations can be reasonably raised. Hence, the OSEP concept can be fully exploited in the WSAN applications even in the demanding domain of agriculture. Therefore, a new architecture, namely the SensoTube, is proposed and described in this section. The grand aim of the SensoTube architecture is to enable a WSAN hardware system to: (a) Escape from the structural restrictions of the existing architectures: The adhesion to the traditional architecturea together with the persistence for miniaturization seems to be rather inappropriate for real-life applications in agriculture. Actually, the size of a WSAN node doesn’t matter [90], and for the case of agriculture, this is evident from the trend to use large-sized OSH platforms. Sensors 2016, 16, 1227 14 of 59

(b) Keep the advantages of OSH expandable concept: The new architecture should maintain the reasons for which the Arduino-like OSH architectures became popular, i.e., the simplicity, the expandability, the reconfigurability and the reusability of hardware. (c) Avoid existing OSH architectures’ implementation constraints: The new architecture should provide new mechanisms, in order to avoid the constraints of existing expandable architectures (see Section2) and, on the other hand, ensure the highest versatility and flexibility. (d) Satisfy all the applications’ stakeholders: The new architecture should allow designers of different design fields (e.g., power electronics, communications, data acquisition etc.) to easily adapt their contributions. Also, the end-users should have clear and reusable building blocks for their present and future integrations. (e) Support the "separation of concern": Regarding the research efforts to study new challenging technologies with potential benefits for WSAN systems, there is a trend for decoupling the WSAN from the application [91]. Also, several other studies, e.g., for WSAN nodes’ scenario reconfiguration [92,93], for strategies on WSAN power management [94], for data acquisition development, or for implementing technologies like Wakeup-Radio (WuR) [95], and many others, are indicatory cases where the decoupling from the wireless networking is required. This decoupling is practically achieved either by the addition of more than one MCU on-board, or by the usage of FPGAs, or by the addition of extra RF communication circuits or modules. Such modifications are necessary to overcome the limited boundaries of the traditional architectures, in order to implement the pilots. On the other hand, they may be considered as custom closed-architecture designs. Therefore, the new architecture should ensure the accommodation of research in new and challenging technologies. (f) Support modeling: The new architecture should allow for modeling of the WSAN hardware system. To meet this target the architecture should provide the highest scalability and standardization. In this way, the WSAN systems could be seen from the middleware infrastructure as well-defined functional multi-class objects. (g) Ensure optimization: The systems based on the new architecture should combine the performance level required in real-world WSAN applications [10] with the vagaries of the agricultural domain. Ideally, the systems should have the optimization level of the commercial end-systems, but with the flexibility of a testbed. Furthermore, a provision should be made in terms of the form factor of the WSAN systems and their encapsulation, in order to cover the specific requirements in the open agricultural field. Actually, the name SensoTube reflects the idea of using plastic tubes for the encapsulation of the WSAN systems in the agricultural fields.

The first step towards the foundation of the SensoTube architecture, was to identify every single possible function that should be exist in an ideal hardware WSAN node and to classify the functions into certain groups according to their similarities and their scope. Next, these groups are considered as seven discrete functional layers (see Table2) by which any WSAN hardware system can be studied, designed and built. As it is reported in [96], any efforts towards the substantial hardware abstraction can increase the fidelity of the characterization and classification of WSAN systems.

Table 2. The seven conceptual functional layers of a WSAN hardware node.

Layer Level Layer Name Abbreviation 1 Data acquisition and Control Layer DCL 2 Wireless Networking Layer WNL 3 Data Gateway Layer DGL 4 Application-Specific Layer ASL 5 Programming and Debugging Layer PDL 6 Power Management Layer PML 7 Evaluation and Testing Layer ETL

According to SensoTube, each one of the suggested functional layers has to be able to be implemented as a separate expansion shield. In particular, such functional shields have to be: Sensors 2016, 16, 1227 15 of 59

‚ Autonomous: Each functional layer shield should be fabricated on its own PCB. ‚ Dedicated: Each shield should be designed in order to implement the tasks of the functional layer at which it belongs. ‚ Intelligent: Local intelligence in every shield is necessary, in order to take care of its functions and to allow for reasonable reconfiguration. ‚ Uniquely identified: When a system needs to incorporate several shields of different functional layer, as well as more than one shields of the same functional layer, then each shield should be able to be uniquely identified by the system. ‚ Addressable: The system, according to the execution of its application scenario, should consider the functional layer shields as addressable units. ‚ Self-expandable: In cases where the PCB surface area is not enough to host the necessary circuitry of a particular function, then one or more complementary extra PCBs should be able to be added without, at the same time, to disturb the rest of other functional layer shields. ‚ Context aware: Each functional layer shield should be aware of its environment, that is, to be able to interact with other shields. ‚ Testable: Each functional layer shield should provide plain testing facilities, e.g., connection points for signals testing. ‚ Compatible: Each functional shield should be designed with respect to the homogeneity in form factor and expansion mechanisms.

From the above characteristics, which form the profile of the ideal functional layer implementation, it is evident that the WSAN system should be a multi-processor system. In part, this is a mandatory in several COTS approaches which use MCUs together with MCU-controlled radio modules [97]. On the other hand, the provision of a multi-processor ability will help designers to escape from the egocentrism of the existing multi-board expandable architectures (e.g., Arduino and the like), which whilst theoretically support the concept but in practice only the MCU of the main-board has the total control of the common BECs. The commercial MCU solutions present in the market today [40], together with the ongoing research on ultra-low power MCUs can guarantee multi-processor operation, even for battery-operated WSAN nodes [98,99]. In particular, among the most significant commercial achievements are the new low-power high performance ARM-based MCUs, which already have found their way into WSAN node implementations [100,101] and the ultra-low power 16-bit MSP430FR MCUs based on non-volatile ferro-electric RAM [102]. At the same time, researchers are striving towards the elimination of MCU leakages [103], the lowering of the MCUs’ operating voltage level [104,105] and the improvement of the internal power management circuits of the MCUs [106,107]. In addition, particular techniques for energy saving in WSAN nodes have already been studied and have shown remarkable results. Some of them have focused on the wakeup and idle states of MCUs [99,108,109], or on the behavior of MCUs as normally-off devices [110,111]. The realization of functional layers in autonomous shields can help the designers to decide which and how many layers are needed to build a particular WSAN system, to work with discrete functional building blocks, to focus on specific systems’ features, to isolate other functional layers from changes at a particular layer, and to work on an add-and-remove basis, in order to adapt to the specific requirements of implementations. In order to handle the functional layer shields as autonomous functional blocks, which can occasionally be added and removed from the main system, particular provisions have to be in place, so as to avoid anarchy in the expandability and scalability. All the functional shields have some common characteristics regarding their operation. In particular, they have to share their electrical signals with other shields, they demand either a single or a multi-value voltage source, they have to be in-system programmed and updated, their MCUs must easily communicate with other MCUs from Sensors 2016, 16, 1227 16 of 59 other shields. The proposed SensoTube architecture establishes the necessary mechanism to support these uniformity and openness needs by the introduction of four inter-layer services:

‚ Signals management ‚ Communications ‚ Programming and debugging ‚ Energy management Sensors 2016, 16, 1227 16 of 59 Since the four service layers cannot be implemented as distinct plug-in shields, specific provisions have been madeSince in the the four form service of electrical layers cannot channels be implemented in the BECs as distinct of the plug-in expansion shields, mechanism specific of the SensoTubeprovisions architecture, have been as explainedmade in the form in the of electric implementational channels in the reference BECs of the model expansion in Sectionmechanism4. Actually, of the SensoTube architecture, as explained in the implementation reference model in Section 4. the establishmentActually, the of establishment the inter-layer of the services inter-layer is servic the keyes is enablerthe key enabler for the for realization the realization of of the the proposed functionalproposed abstraction. functional Without abstraction. the inter-layer Without the services inter-layer provision, services provision, the elimination the elimination of the of Arduino-likethe OSH expandableArduino-like platforms’ OSH expandable constraints platforms’ could constraints not be could avoided not be atavoided all. Furthermore,at all. Furthermore, the the inter-layer services caninter-layer ensure services the building can ensure ofthea building sound, of a expandable sound, expandable and and scalable scalable system. system. For For instance, instance, it is it is possible to have a system comprised of several OSH main-board shields sharing the very same possible toexpansion have a mechanisms, system comprised but at the of same several time OSHeach one main-board of them can shields be self-expandable sharing the and very same expansionautonomous. mechanisms, A complete but at the representation same time eachof the oneSens ofoTube them architecture can be self-expandable is given in Figure and 8. At autonomous. a A completeconceptual representation level, the of presented the SensoTube architecture architecture can satisfy the is sub-aims given in (a) Figure to (g), posed8. At at a the conceptual beginning level, the presentedof architecture this section. can satisfy the sub-aims (a) to (g), posed at the beginning of this section.

Figure 8. Representation of the SensoTube architecture for WSAN hardware systems design. The Figure 8. Representationseven functional layers of the are SensoTube shown as architecturediscrete horizontal for WSANlayers. The hardware four inter-layer systems services design. are The seven functionalshown layers to are vertically shown penetrate as discrete the seven horizontal functional layers. The four inter-layer services are shown to vertically penetrate the seven functional layers. In the following sub-sections, the usage and benefits of the proposed seven functional layers are described, with particular emphasis on the advantages of the novel mechanisms of the inter-layer In theservices. following Additional sub-sections, emphasis theis given usage on the and facilitation benefits of ofchallenging the proposed WSAN research seven functional aspects, and layers are described,on with the solutions particular to existing emphasis design on constraints. the advantages At the same of thetime, novel the target mechanisms is to explain ofhow the the inter-layer services. AdditionalWSAN designers emphasis can use isthe given SensoTube on the architectu facilitationre to adapt of challenging their particular WSAN requirements. research aspects, and on the solutions3.1. Data toAcquisition existing and design Control Layer constraints. (DCL) At the same time, the target is to explain how the WSAN designersIn real-world can use theWSAN SensoTube implementations, architecture it is ve tory adaptcommon their for the particular specifications requirements. of the data acquisition (DAQ) and control to change [6]. For example, a new type of sensor may require a higher 3.1. Data Acquisitionconversion resolution and Control and Layera higher (DCL) sampling rate, or the need for some extra sensors may require extension of the existing analog inputs, or a new actuator may need more energy and special driving In real-world WSAN implementations, it is very common for the specifications of the data circuits in order to be driven, etc. Regarding the field of agriculture, the measuring and monitoring acquisitionof (DAQ) various andphysical control parameters to change require, [6 very]. For often, example, the use of a complex new type sensor of sensory devices may [5]. For require such a higher conversionreasons, resolution in [9] it and is pointed a higher out that, sampling regarding rate, the agricultural or the need domain, for somea data acquisition extra sensors daughter may require extension ofcard the is required. existing analog inputs, or a new actuator may need more energy and special driving Today, the support of the data acquisition and control aspect of the WSAN systems seems to be circuits in order to be driven, etc. Regarding the field of agriculture, the measuring and monitoring rather underrated in the existing architectures. For instance, in COTS (e.g., motes), the emphasis has of various physical parameters require, very often, the use of complex sensory devices [5]. For such Sensors 2016, 16, 1227 17 of 59 reasons, in [9] it is pointed out that, regarding the agricultural domain, a data acquisition daughter card is required. Today, the support of the data acquisition and control aspect of the WSAN systems seems to be rather underrated in the existing architectures. For instance, in COTS (e.g., motes), the emphasis has been entirely put on the RF communications. In particular, some of them have a couple of sensors soldered on-board, just as to be able to demonstrate the networking capabilities in measured data from the wireless nodes [26,43]. In most of the cases, these on-board sensors are not of the proper type and form, in order to be useful in agricultural applications. In addition, as reported in [54], there are serious limitations in data sampling periods, when a single MCU is responsible for both the networking protocol and the DAQ functions under an operating system. In general, the COTS-based systems leave the development of the DAQ and actuators circuitry in the users’ hands. On the other hand, the existing expandable OSH architectures provide limited support for a sound DAQ and control function due to their inherent structural constraints (see Section2). Furthermore, these solutions are not energy optimized so as to support battery-operated WSAN applications. In particular, the various analog or digital sensors which are connected to an OSH main-board, are always activated, regardless the fact that the sampling rate may be very low. This is particularly evident, for example, in the management of the soil sensors which are based on the SDI-12 bus [112]. Also, the existing expandable OSH-based systems suffer from scalability, in terms of processing power and communication peripherals. Thus these architectures appear to be convenient only for the limited scope of short-term experimentation. On the contrary, the SensoTube architecture with its inter-layer services facilitates the design and development of flexible and scalable DAQ and control shields. According to the SensoTube, a WSAN system is capable to use more than one DCL shield. Each DCL shield can employ its own MCU. This ensures the ability for reconfiguration at shield’s level, as well as the capability to undertake the execution of measurements scenarios locally without disturbing other functional layer shields. Regarding the MCU, designers can make their choice either by selecting a commercial ultra-low power one, or by using an FPGA [113], or an analog mixed-signal processor [114]. Furthermore, with the introduction of the energy management service, the DCL shield(s) can be entirely powered-ON or OFF, according to the application scenario. In this way, the maximum level of energy consumption control is achieved. Also, a dedicated MCU-enabled shield can help the designers to take all the necessary PCB design precautions for the highest performance in signals integrity (SI) and EMC. Moreover, SensoTube aims to provide the necessary polymorphism, in terms of signal connections, to allow for increased flexibility and versatility. In particular, each of the DCL shields can have its own analog channels and communication interfaces, through the use of the mechanisms of the introduced inter-layer signals management service. For instance, a shield can be self-expanding without disturbing the neighboring functional shields, as well as permit the use of terminal blocks for easy access to signals for connecting external sensors. On the other hand, with SensoTube, there is no limitation of processing, analog channels, and communication interfaces.

3.2. Wireless Networking Layer (WNL) The establishment of a discrete functional shield for the wireless data communication, firstly, allows designers to focus on the wireless networking aspects (e.g., routing protocols [115,116], operating systems [22], new trends [117], new technologies [118–120], etc.), and, secondly, supports the requirement for the decoupling of applications from the wireless networking field [91]. According to the SensoTube, a WNL can be implemented in its own PCB with a dedicated MCU on-board. In this way, the WNL shield can collaborate with other functional shields for the sake of any particular application scenario. At this shield, any of the known design practices, i.e., chip-set, SoCs, and modules, can be accommodated, in order to implement the wireless data networking. Contrary to the existing architectures, SensoTube allows for the engagement of numerous WNL shields through its inherent expansion mechanism and its inter-layer services provisions. Thus, challenging implementations, such as for heterogeneous communications, as in the case of [31], can be seamlessly facilitated to the WSAN system. Additionally, the specific inter-layer service provision for energy Sensors 2016, 16, 1227 18 of 59 management, allows the WNL shield to be energy aware of every single operation of its data radio communication sub-systems. The ability to have a complete control and monitoring of energy is of crucial importance for the real-world WSAN applications in the field. Also, a WNL shield, thanks to the holistic strategy for the energy management that is achieved by the inter-layer energy management service, can be entirely powered-ON or OFF from other functional layer shields, in order to minimize the energy consumption. On the other hand, the inter-layer service for signals management eliminates the resources constraints of the existing OSH architectures, while, at the same time, provide the polymorphism in expansion mechanisms, in order to help towards the maximum scalability, openness and reusability. This is very important, in the case of the usage of the various integrated communication modules (e.g., Bluetooth, WiFi, and ZigBee modules) in the design of WSAN nodes. According to the existing expandable OSH architectures, such modules are serially interfaced with the main-board’s MCU, in order just to transmit and receive data. In this case, these modules are not fully exploited for the sake of the system. Actually, these modules are built around of a reprogrammable MCU, the signals of which are provided at the module’s miniaturized PCB. A WNL shield can fully exploit the capabilities of these modules. In particular, the analog and digital I/O signals of the modules can be routed to the BECs of the system, and also, through the use of the inter-layer service for programming and debugging, to allow for in-system firmware development. Thus, the SensoTube WNL shields can achieve the integration of such modules in a homogeneous and uniform way.

3.3. Data Gateway Layer (DGL) A WSAN gateway should be able to bridge the local wireless network (e.g., based on ZigBee, etc.) with other communication networks, using proper RF communication modules (e.g., WiFi, GSM/GPRS, GSM 3G/4G, etc.). In contrast to the existing architectures, SensoTube-based WSAN systems can have more than one data gateway channel in the same system through the use of many DGL shields. Thus, SensoTube can effectively support the general domain of the interconnections to external networks [121]. For example, one DGL shield is used for the Internet access while another DGL shield provides Bluetooth connectivity for local user-interface (Human-Machine Interface—HMI), and another DGL shield provides a wired interface via USB or RS-485 data busses for, e.g., local configurations and reporting. The master MCU of the SensoTube-based WSAN system (e.g., the MCU of the DCL, or the MCU of some other layer’s shield) can direct the operations of the WNL and DGL shields through their MCUs, in order to achieve any data interconnection scenario. Furthermore, as in the case of WNL shields, the DGL shields can fully integrate and exploit the inherent capabilities of the modern integrated communication modules (see Section 3.2). Moreover, the DGL entity can support research and experimentation in the challenging application areas such as the Internet-of-Things (IoT) [33], which at least for now practically appears to be an Internet-of-Gateways (IoG). Similarly, the cyber-physical space (CPS) [122] research field could also be facilitated in SensoTube-based systems. Towards this direction, the processing and memory resources, required for local embedded web servers and other web technologies, can be exclusively designed in DGL shield without disturbing the operations of the other functional layers of the system.

3.4. Application-Specific Layer (ASL) The ASL functional layer can be an application specific shield. This discrete shield can accommodate any functional requirements of the overall WSAN system that does not conceptually fit into other functional layers. On the other hand, the ASL entity can be also considered as a reservation for future needs. In practice, designers could use a MCU-based ASL shield as the director of the rest of functional shields, in order to execute the application scenarios. Such a design option can facilitate the reconfiguration of the system’s intelligence and increase the flexibility in development. Another possible use of this layer’s shield could be the accommodation of various types of memory storage media, in order to store various system measurements, data, operating parameters and execution logs. Such capabilities are very useful in the real-world WSAN applications in agriculture, where the nodes’ data has to be stored locally when the RF network is momentarily down. Sensors 2016, 16, 1227 19 of 59

3.5. Power Management Layer (PML) Energy is a very critical factor for the real-world WSAN applications, especially in the agricultural environment, and can influence the lifetime and the reliability of the overall application [18]. As the WSAN technology evolves, the need for power management is increasing [23]. Unfortunately, there are several trade-offs in the commercial WSAN solutions, regarding the use of energy [11]. Traditionally, the WSAN hardware solutions being based either on the traditional architecture and COTS, or on OSH architectures, have been designed without paying particular attention to the energy implications. Furthermore, regarding the provisions for the energy sources, these systems just provide some kind of connection through the use of pins or screw-drive terminal blocks and they leave the users to take care of supplying power, under their own responsibility. In practice, this can jeopardize the overall system’s performance and reliability. Additional pressure for energy management is coming from the need to exploit challenging energy-related technologies [34]. The WSAN nodes in agriculture, except from the use of photovoltaic panels [123], can also make use of other, more sophisticated, energy harvesting techniques [124–126]. Except for the mature battery types, the harvested energy can be also stored in relatively new media such as the Li-Ion batteries [127], supercapacitors [94,128,129], hybrid ultracapacitors [42], or combinations of thin-film batteries and supercapacitors [130]. The spread of such technologies in real-world WSAN applications entails sound evaluation and modeling. Otherwise they will be limited to pilots and demonstration implementations. In this context, the existence of a separate shield that accommodates all the energy requirements of the overall system is very critical. A SensoTube-based system could have more than one PML shield, which can be replaced on an occasional basis, in order to fulfill the scalable energy requirements of the system. With PML shields, the power electronics researchers and designers have a discrete functional shield, into which they can contribute towards the design of energy optimized WSAN systems. At the same time, the PML shields ensure a unified and well-organized energy management that can guarantee the reliability and the lifetime of the WWSAN system. Additionally, with the provision of the SensoTube inter-layer service for energy management, an MCU-based PML shield through the use of on-board electronic switches can power-ON and OFF, in real time, all of the other functional shields. The incorporation of an MCU in the PML shield that will manage the overall systems’ energy could uplift the prospects for optimization.

3.6. Program and Debug Layer (PDL) Programming and debugging are very important functions of a WSAN system [91]. For this reason, SensoTube has made specific provisions. In particular, one or more of the PDL shields can be installed in a SensoTube-based system, so as to accommodate the electronic circuits associated with the programming and debugging functions of the MCUs of the various functional shields. These can be removed from the WSAN system, when the development has been successfully completed and the system is ready for installation in the field. This facility results in energy saving in the final system. Additionally, when there is no support for programming in the abandoned system, it avoids undesirable access to the firmware of the nodes. Using the PDL approach also allows one to reduce the cabling complexity in the final system while it permits MUCs of the same technology (e.g., ARM, or MCUs from the same manufacturer), to share the very same PDL shield for their programming and debugging, so designers can provide more compact, energy optimized, and low cost implementations. Another feature, which is very crucial in the cases of remote WSAN applications, is the ability to perform remote upgrades, or else, upgrades over-the-air (OTA) [131]. According to this function, the network stack inside a MCU can be reprogrammed remotely [132]. With PDL shields, this function can be extended also to the remote firmware upgrade of each of the on-board MCUs of the functional shields. Of course, in this case, the PDL should not be removed from the final system. Furthermore, the ability of PDL shields to decouple the programming and debugging circuitry from the MCU-enabled shields, allows for the design of particular circuitry in order to facilitate the connection of novel programming devices that also perform various statistics and energy profiling of the target MCU [133,134]. Sensors 2016, 16, 1227 20 of 59 Sensors 2016, 16, 1227 20 of 59 3.7. Evaluation and Testing Layer (ETL)

3.7. EvaluationThe behavior and Testingof WSAN Layer systems (ETL) is severely differentiated when they are deployed in the real- world applications environment [21], and practically, this behavior cannot be simulated [135]. The behavior of WSAN systems is severely differentiated when they are deployed in the real-world Moreover, the detection of possible faults is of crucial importance for the remote system [136]. applications environment [21], and practically, this behavior cannot be simulated [135]. Moreover, the Traditionally, WSAN designers and developers use various tools for evaluation and diagnostics, detection of possible faults is of crucial importance for the remote system [136]. Traditionally, WSAN referred to as testbeds [29,137]. Ideally, as reported in [135], an evaluation tool should be scalable, designers and developers use various tools for evaluation and diagnostics, referred to as testbeds [29,137]. flexible, accurate, repeatable, visible, cross-environment valid, and re-usable. Unfortunately, there Ideally, as reported in [135], an evaluation tool should be scalable, flexible, accurate, repeatable, are very few testbeds available today [138], and, on the other hand, they appear to be inappropriate visible, cross-environment valid, and re-usable. Unfortunately, there are very few testbeds available for in-situ post-deployment testing [117,135]. A thorough study of WSAN testbeds is reported in today [138], and, on the other hand, they appear to be inappropriate for in-situ post-deployment some studies [139,140]. Through the use of the ETL shields, the SensoTube architecture allows for testing [117,135]. A thorough study of WSAN testbeds is reported in some studies [139,140]. real-time in-situ monitoring and testing of every single operation of particular circuits and Through the use of the ETL shields, the SensoTube architecture allows for real-time in-situ monitoring procedures of the WSAN system. In other words, an ETL shield can be considered as the testbed and testing of every single operation of particular circuits and procedures of the WSAN system. In other inside the final system. A SensoTube-based system may incorporate more than one ETL shield. An words, an ETL shield can be considered as the testbed inside the final system. A SensoTube-based ETL shield is not intrusive on other functional shields and can be easily removed at any time. Among system may incorporate more than one ETL shield. An ETL shield is not intrusive on other functional the most interesting testing operations that can be implemented onto an ETL shield are the in-system shields and can be easily removed at any time. Among the most interesting testing operations that energy monitoring, the control over the networking protocol execution, the diagnostics of can be implemented onto an ETL shield are the in-system energy monitoring, the control over the malfunctions in the firmware of MCUs, energy storage monitoring, reliability and lifetime anomalies networking protocol execution, the diagnostics of malfunctions in the firmware of MCUs, energy detection [18,141] etc. Obviously, the ETL entity can open up new horizons for a WSANs’ storage monitoring, reliability and lifetime anomalies detection [18,141] etc. Obviously, the ETL entity characterization and modeling based on the systems’ behavior, under real-world deployment can open up new horizons for a WSANs’ characterization and modeling based on the systems’ behavior, conditions. under real-world deployment conditions. 4. The SensoTube Architecture’s Implementation Reference Model 4. The SensoTube Architecture’s Implementation Reference Model The idea behind the principles of the proposed architecture was to have the WSAN system The idea behind the principles of the proposed architecture was to have the WSAN system encapsulated inside a plain plastic tube as those used for irrigation in agriculture. In fact, the very encapsulated inside a plain plastic tube as those used for irrigation in agriculture. In fact, the very name SensoTube has its roots at this concept. The advantages of this approach are described in depth name SensoTube has its roots at this concept. The advantages of this approach are described in depth in in Section 6. The definition of a fixed PCB design model is a prerequisite to enable the use of the Section6. The definition of a fixed PCB design model is a prerequisite to enable the use of the proposed proposed architecture. The design of the physical expansion mechanism has been accomplished by architecture. The design of the physical expansion mechanism has been accomplished by taking into taking into consideration: the PCB form factor, the fulfillment of the operational requirements of the consideration: the PCB form factor, the fulfillment of the operational requirements of the various various functional layers shields, the reusability of the hardware shields, the simplification in functional layers shields, the reusability of the hardware shields, the simplification in modification and modification and cabling, the maximum expandability and openness to support research and cabling, the maximum expandability and openness to support research and development, the easy development, the easy and low-cost boards fabrication, and the provision of a standardized and and low-cost boards fabrication, and the provision of a standardized and uniform way to design the uniform way to design the SensoTube-based hardware shields (i.e., to provide a design template). SensoTube-based hardware shields (i.e., to provide a design template).

4.1. Printed-Circuit Board (PCB) Model The form factor of the SensoTube PCBs is determineddetermined from the ability of the boards to be placed inside a tube of 90 mmmm diameter,diameter, asas itit isis illustratedillustrated inin FigureFigure9 9.. TheThe diameterdiameter ofof 9090 mmmm allowsallows forfor enough PCB space.

Figure 9. TheThe topographic view of the SensoTub SensoTubee PCB within a 90 mm diameter tube.

Sensors 2016, 16, 1227 21 of 59 Sensors 2016, 16, 1227 21 of 59

Certainly, thethe spaciousspacious PCBsPCBs approachapproach is notnot alignedaligned withwith thethe notionnotion of thethe miniaturizationminiaturization in WSANsWSANs designdesign [[6]6] but,but, inin practice, practice, there there are are no no restrictions restrictions for for the the physical physical dimensions dimensions of of the the PCBs PCBs of theof the WSAN WSAN systems systems in real-life in real-life applications applications in agriculture, in agriculture, where where the usage the usage of big waterproofof big waterproof plastic enclosuresplastic enclosures is a common is a common practice. practice. Because Because the thickness the thickness of the commercially of the commercially available available 90 mm diameter 90 mm tubesdiameter varies tubes from varies 1.8 mmfrom up 1.8 to mm 3.2 mm,up to the 3.2 diameter mm, the ofdiameter the board of isthe suggested board is suggested to be at 83.60 to be mm. at This83.60 permits mm. This the permits shield’s the PCB shield’s to be seamlesslyPCB to be seamlessly inserted even inserted into the even thickest into the of tubes.thickest The of tubes. cuts at The the rightcuts at and the left right sides and of left the sides PCB haveof the been PCB intentionally have been intentionally made, in order made, to reserve in order enough to reserve space enough for any potentialspace for cablingany potential among cabling shields, among photovoltaic shields, panel, phot externallyovoltaic panel, located externally sensors, andlocated batteries sensors, (battery and cellsbatteries should (battery be located cells should at the bottom be located of the at tubethe bo andttom under of the the tube shield and synthesis). under the shield synthesis).

4.2. Expandability and Inter-LayerInter-Layer Services Mechanisms In orderorder toto supportsupport thethe inter-layerinter-layer functionalityfunctionality of the SensoTube architecturearchitecture forfor signalssignals management, communication, energy management management,, and firmware firmware programming and debugging, three typestypes ofof expansionexpansion meansmeans havehave beenbeen designeddesigned andand proposed,proposed, namely:namely: ‚ TheThe S-BECS-BEC forfor signalssignals distributiondistribution managementmanagement ‚ TheThe P-BECP-BEC forfor energyenergy monitoring,monitoring, controlcontrol andand managementmanagement ‚ TheThe J-BECJ-BEC forfor programmingprogramming andand debuggingdebugging ofof JTAG-enabledJTAG-enabled MCUsMCUs These expansionexpansion mechanisms mechanisms have have been been based based on theon usagethe usage of the of popular the popular BECs (i.e., BECs pass-through (i.e., pass- pin-headers)through pin-headers) and they and have they been have enriched been withenriched critical with technical critical enhancements.technical enhancements. Figure 10 showsFigure the 10 SensoTubeshows the PCBSensoTube model PCB with model its three with different its three types diff oferent BECs types positioned of BECs at theirpositioned exact places.at their All exact the blue-coloredplaces. All the area blue-colored is at the disposal area is of at the the disposal to of implement the designer any ofto theimplement seven functional any of the layers seven of hisfunctional system. layers of his system.

(a) (b)

(c)

Figure 10. Top (a), bottom (b), and three-dimensional views (c), of the SensoTube PCBPCB model with its physical expansion andand stackingstacking BEC-basedBEC-based mechanisms.mechanisms.

4.2.1. Inter-Layer Signals Management Service Mechanism According to the SensoTube architecture, signals management includes not just the physical connection among the various shields of the system, but also a mechanism for signal isolation and

Sensors 2016, 16, 1227 22 of 59

4.2.1 Inter-Layer Signals Management Service Mechanism Sensors 2016, 16, 1227 22 of 59 According to the SensoTube architecture, signals management includes not just the physical connection among the various shields of the system, but also a mechanism for signal isolation and otherother auxiliary auxiliary signals signals connections connections alternatives. alternatives. In Inthe the proposed proposed PCB PCB reference reference model model two two 1 × 1 20-pinsˆ 20-pins signalssignals BECs, BECs, namely namely S-BEC S-BEC 1 and 1 and S-BEC S-BEC 2, 2,have have been been used, used, as asillustrated illustrated in inFigure Figure 11. 11 The. The same same figurefigure also also depicts depicts the the proposed proposed types types of ofsignals signals that that have have been been decided decided to be to beincluded included in these in these BECs. BECs. AsAs the the colors colors denote, denote, the the signals signals have have been been concep conceptuallytually grouped grouped into into four four functional functional categories, categories, namelynamely the the communication communication signals signals (green (green color), color), the the digital digital and and analog analog input input and and output output signals signals (orange(orange color), color), the the signals signals for for programming programming andand debuggingdebugging through through the the JTAG JTAG standard standard interfaces interfaces (blue (bluecolor) color) [106 [106],], and and the the power power supply supply signals signals (red (red color). color). The The predefined predefined positioning positioning of the of signalsthe signals on the onBECs the BECs ensures ensures the standardization the standardization for the for design the de ofsign various of various new shields new fromshields conglomerate from conglomerate developers. developers.Forty pins Forty of different pins of types differ canent completely types can covercompletely the requirements cover the ofrequirements any WSAN of functional any WSAN shield. functionalFurthermore, shield. the Furthermore, introduction the of four introduction exclusive of pins four to serveexclusive interrupt pins to signals serve can interrupt significantly signals support can significantlythe design ofsupport multi-processor the design applications, of multi-processo e.g., anr MCU-enabled applications, shielde.g., an can MCU-enabled wake up other shield shields can from wakedeep up sleep other mode, shields which from is adeep technique, sleep mode, in order which to reduce is a energytechnique, consumption. in order to On reduce the other energy hand, consumption.this provision On can the also other support hand, the this adoption provision of challengingcan also support embedded the systemsadoption design of challenging techniques, embeddedsuch as event-driven systems design programming, techniques, andsuch Synchronous as event-driven Finite programming, State Machines and (SFSM) Synchronous [142], which Finite can Statecontribute Machines to (SFSM) energy optimization[142], which can at the contribute system level. to energy optimization at the system level.

FigureFigure 11. 11. TheThe SensoTube SensoTube signals signals BECs BECs (S-BECs) (S-BECs) grouped grouped into into four four functional functional categories. categories. These These pins pins areare physically physically common common among among all allof ofthe the functional functional expansion expansion shields’ shields’ boards. boards.

Another novelty is the introduction of ten pins devoted to the power management of the Another novelty is the introduction of ten pins devoted to the power management of the expansion expansion functional shields. In particular, there are five different voltage signals alternatives, two functional shields. In particular, there are five different voltage signals alternatives, two with predefined with predefined values, i.e., +3.3 Vdc and +5 Vdc, and three that can be defined by the developer, i.e., values, i.e., +3.3 Vdc and +5 Vdc, and three that can be defined by the developer, i.e., the V_IN, the the V_IN, the V_BAT, and the V_AUX, respectively. Each one of these voltage input signals has its V_BAT, and the V_AUX, respectively. Each one of these voltage input signals has its own ground own ground pin, which is isolated from the rest of the ground pins. This is very useful for mixed- pin, which is isolated from the rest of the ground pins. This is very useful for mixed-signal circuits signal circuits design, because it allows the reduction of electric noise interference. Any connections design, because it allows the reduction of electric noise interference. Any connections between different between different ground signals can be implemented at the PCB of any functional shield. The voltage ground signals can be implemented at the PCB of any functional shield. The voltage signals should signals should derive from one, or multiple, shields of PML type. derive from one, or multiple, shields of PML type. The two S-BEC signals pins are passing through all the connected functional shields. To The two S-BEC signals pins are passing through all the connected functional shields. To overcome overcome the aforementioned signals management constraints that exist in the expandable the aforementioned signals management constraints that exist in the expandable architectures architectures (see Section 2), SensoTube S-BECs provide polymorphism in terms of the signals (see Section2), SensoTube S-BECs provide polymorphism in terms of the signals connections and connections and routing. In particular, as Figure 12 depicts, two rows of through-hole pads have been routing. In particular, as Figure 12 depicts, two rows of through-hole pads have been added in parallel added in parallel with the pads of S-BEC 1 and S-BEC 2. The pads of the internal rows are directly with the pads of S-BEC 1 and S-BEC 2. The pads of the internal rows are directly connected to the connected to the pads of the S-BECs, while the pads of the external rows can be connected to the pads of the S-BECs, while the pads of the external rows can be connected to the signals of the shield’s signals of the shield’s circuits. In this way, the signals coming from the S-BECs are mechanically circuits. In this way, the signals coming from the S-BECs are mechanically disconnected from the disconnected from the signals of the shield. signals of the shield.

Sensors 2016, 16, 1227 23 of 59 Sensors 2016,, 16,, 1227 1227 2323 of of 59 59 Sensors 2016, 16, 1227 23 of 59

Figure Figure12. Detail 12. Detail of the of S-BECthe S-BEC 1 showing 1 showing the the BEC’sBEC’s padspads row row at atthe the top topand andthe two the rows two of rows pads of pads FigureFigure 12. DetailDetail of of the the S-BEC S-BEC 1 1 showing showing the the BEC’s BEC’s pads pads row row at at the the top top and and the the two two rows rows of pads added atadded the bottom.at the bottom. The Theelectrical electrical PCB PCB connec connectionstions (traces)(traces) are are denoted denoted with with red color. red color. addedadded at at the bottom. The The electrical electrical PCB PCB connec connectionstions (traces) are denoted with red color. As illustratedAs illustrated in Figure in Figure 13, 13,by by placing placing of of dualdual malemale pin-headers pin-headers at the at availablethe available two rows two of rows of Aspads, illustrated and through in Figure the use 13, of shortingby placing jumpers, of dual the signals male of pin-headers the shield can at be the selectively available connected two rows of pads,As and illustrated through inthe Figure use of 13 shorting, by placing jumpers, of dual the male signals pin-headers of the shield at the can available be selectively two rows connected of pads, pads, andto thethrough signals the of use the ofS-BECs. shorting This jumpers, option isthe very signals critical of thefor shieldthe system’s can be reconfigurability. selectively connected toand the through signals the of use the of shortingS-BECs. jumpers,This option the signalsis very of thecritical shield for can the be system’s selectively reconfigurability. connected to the to the Furthermore,signals of inthe cases S-BECs. where theThis signals option of the isS-BEC verys must critical be remapped, for the with system’s regard to reconfigurability. the signals Furthermore,signalsof of the the shield, in S-BECs. cases then where Thisinstead option the of the signals ismale very pin-headers,of criticalthe S-BEC for thes the developersmust system’s be remapped, can reconfigurability. make their with own regard wiring Furthermore, to at thethe signals in Furthermore, in cases where the signals of the S-BECs must be remapped, with regard to the signals ofcases the whereshield,two rows the then of signals pads.instead of theof the S-BECs male must pin-headers, be remapped, the developers with regard can to make the signals their own of the wiring shield, at then the of the shield, then instead of the male pin-headers, the developers can make their own wiring at the twoinstead rows of of the pads. male pin-headers, the developers can make their own wiring at the two rows of pads. two rows of pads.

Figure 13. Selective connection of shield’s signals to S-BEC’s signal by the use of pin-headers and short-circuit jumpers.

Figure Additionally,13. SelectiveSelective inconnection connection the external of of rowshield’s shield’s of through-hole signals signals to to S-BEC’s S-BEC’spads, extra signal signal BECs by by can the be use soldered, of pin-headers in order to and Figureenable 13. selected Selective shield’s connection signals of connection shield’s signals to its totop S-BEC’s and bottom signal neighboring by the use shields.of pin-headers This is aand short-circuit jumpers. short-circuitsecondary jumpers.provision for local signals connections among shields. This can be considered as a nested connection method, and allows a functional shield to have its own sub-functional shields without Additionally, in the external row of through-hole pads, extra BECs can be soldered, in order to Additionally,Additionally,intervention toin in thethe the rest external external of the rowsystem’s row of of through-hole functional through-hole shields. pads, pads, Figure extra extra 14 BECs illustrates BECs can can bean besoldered,example soldered, of inthe order in order to enable selected shield’s signals connection to its top and bottom neighboring shields. This is a enableto enable combinationselected selected shield’s of shield’s a secondary signals signals BEC connection together connection with to pin-headers toits itstop top and and bottom jumpers. bottom neighboring In neighboring this example, shields. just shields. five ofThis This is isa secondarythe S-BEC’sprovision signals for localhave beensignals connected connections to the shie amongld’s circuits, shields. while This six can signals be considered of the shield as are a nested secondarya secondary provision provision for for local local signals signals connections connections among among shields. shields. This This can can be be considered considered as as a a nested nested connectionready method, for connection and allows with its a twofunctional neighboring shield shie tolds have (or withits own just onesub-functional of them). All shields of these without connectionconnection method, method, and and allows allows a a functional shield shield to have its own sub-functional shields without interventionmodifications, to the restwhich of are the based system’s on the particularfunctional usage shields. of the Figuretwo rows 14 of illustrates pads, are not an permanent example of the interventionintervention to to the the rest rest of the system’s functional shields. Figure Figure 1414 illustratesillustrates an an example example of of the the combinationin nature, of a they secondary do not impose BEC togetherlimitations with to boards pin-headers stacking, and they jumpers. can be Inperformed this example, very easily just five of combinationcombinationby the ofend-users of a a secondary secondary of the shields, BEC BEC together e.g., researchers with pin-headers and any kind and of developers. jumpers. In In this this example, example, just just five five of of the S-BEC’s signals have been connected to the shield’s circuits, while six signals of the shield are thethe S-BEC’s signalssignals have have been been connected connected to to the the shield’s shield’s circuits, circuits, while while six signalssix signals of the of shield the shield are ready are ready for connection with its two neighboring shields (or with just one of them). All of these readyfor connection for connection with its with two neighboringits two neighboring shields (or shie withlds just (or one with of them).just one All of of them). these modifications, All of these modifications, which are based on the particular usage of the two rows of pads, are not permanent modifications,which are based which on the are particular based on usage the particular of the two usage rows ofof pads,the two are rows not permanent of pads, are in not nature, permanent they do in nature, they do not impose limitations to boards stacking, and they can be performed very easily innot nature, impose they limitations do not impose to boards limitations stacking, to and boards they canstacking, be performed and they very can be easily performed by the end-users very easily of by the end-users of the shields, e.g., researchers and any kind of developers. bythe the shields, end-users e.g., researchersof the shields, and e.g., any researchers kind of developers. and any kind of developers.

Figure 14. Use of secondary BEC to local connections with neighboring shields.

Also, there is a third alternative for signals connections, which is very convenient at the system- level signals physical connections. One or more screw terminal blocks can be placed at the pads of

Figure 14. Use of secondary BEC to local connections with neighboring shields. FigureFigure 14. 14. UseUse of of secondary secondary BEC BEC to to local local connections connections with with neighboring shields. Also, there is a third alternative for signals connections, which is very convenient at the system- Also, there is a third alternative for signals connections, which is very convenient at the system- level Also,signals there physical is a connections. third alternative One or for more signals screw connections, terminal blocks which can is be very placed convenient at the pads at the of level signals physical connections. One or more screw terminal blocks can be placed at the pads of system-level signals physical connections. One or more screw terminal blocks can be placed at the pads

Sensors 2016, 16, 1227 24 of 59

Sensors 2016, 16, 1227 24 of 59 of the external rows, which are directly connected with the S-BECs signals (Figure 15). This facilitates the Sensorsexternal 2016 ,rows, 16, 1227 which are directly connected with the S-BECs signals (Figure 15). This facilitates24 of 59 users’users’ physical physical access access toto thethe various shields’ shields’ signal signalss by by just just wiring wiring instead instead of risky of risky soldering. soldering. Such, Such, a a functionthe external is particularly rows, which useful useful are directlyfor for easily easily connected adding adding withand and theremoving removing S-BECs severalsignals several (Figurtypes types eof 15). ofsensors This sensors facilitates in inWSAN WSAN agriculturalagriculturalusers’ physical applications. applications. access to the various shields’ signals by just wiring instead of risky soldering. Such, a function is particularly useful for easily adding and removing several types of sensors in WSAN agricultural applications.

Figure 15. Use of screw-type terminal blocks to facilitate the physical access to the signals of the shield. Figure 15. Use of screw-type terminal blocks to facilitate the physical access to the signals of the shield. Figure 15. Use of screw-type terminal blocks to facilitate the physical access to the signals of the shield. TheThe proposed proposed signal management management mechanisms mechanisms are arelow-cost low-cost and easily and easilyimplemented implemented in the PCB. in the PCB.The TheadditionThe addition proposed of the of extra signal the rows extra management of rows pads of(two mechanisms pads rows (two per rowsareS-BEC) low-cost per can S-BEC) beand easily easily can hosted im beplemented easily in WSAN hosted in the hardware inPCB. WSAN hardwaresystemsThe addition systemsfor agricultural of forthe agriculturalextra applications, rows of pads applications, (twodue rowsto the due per fa S-BEC)ct to that, the factcan there be that, easily are there no hosted space are in no WSANlimitations space hardware limitations in this in thisapplication applicationsystems fordomain. domain.agricultural Despite Despite applications, the the fact fact of the ofdue the space to space the re faservation reservationct that, therefrom from arethe thenoadded addedspace rows limitations rows of pads, of pads, in there this there is is moremoreapplication than than enough enough domain. PCB PCB Despite space space forfor the thethe fact developmentdevelopment of the space reof ofservation the the shield shield from circuitry. circuitry. the added rows of pads, there is more than enough PCB space for the development of the shield circuitry. FollowingFollowing the the aforementioned aforementioned signals manageme managementnt mechanisms, mechanisms, the the poor poor performance performance and and low low reliabilityFollowing of the WSAN the aforementioned systems, due signals to clumsy manageme wiringnt of mechanisms, signals connections, the poor areperformance minimized. and On low the reliability of the WSAN systems, due to clumsy wiring of signals connections, are minimized. On the otherreliability hand, theof the various WSAN different systems, sh dueields to clumsycan be wiringdesigned of signals as totally connections, independent are minimized. functional On entities the other hand, the various different shields can be designed as totally independent functional entities withoutother signalshand, the connections various different and boards’ shields expansion can be designed barriers. as The totally SensoTube independent polymorphism functional inentities signals without signals connections and boards’ expansion barriers. The SensoTube polymorphism in signals managementwithout signals is depicted connections in Figure and boards’ 16. expansion barriers. The SensoTube polymorphism in signals managementmanagement is depicted is depicted in Figurein Figure 16 16..

FigureFigure 16. 16. Alternatives Alternatives in in signals signals connections: connections: (i)(i) selectiveselective connection; (ii)(ii) nestednested inter-shield inter-shield Figure 16. Alternatives in signals connections: (i) selective connection; (ii) nested inter-shield connections; connections;connections; (iii) (iii) no no connection. connection. (iii) no connection. FromFrom the the designers’ designers’ perspective, perspective, the the methodolo methodologygy ofof incorporating the the proposed proposed mechanisms mechanisms is is veryFromvery convenient convenient the designers’ and and straightforward. straightforward. perspective, theIn In Figure methodologyFigure 1717,, onon thethe of incorporatingleft andand rightright sidessides the proposedthere there are are the mechanismsthe sheet sheet issymbols verysymbols convenient of ofthe the S-BEC S-BEC and 1 straightforward. and1 and S-BEC S-BEC 2. 2. In In each In each Figure one one of of17 thesethese, on thesheet left symbolssymbols and right there there sides are are the therethe signal signal are ports the ports sheet symbolsentitiesentities ofwhich thewhich S-BECrepresent represent 1 andboth both S-BEC the the common common 2. In each signals signals one of of of thethe these stackingstacking sheet BECsBECs symbols and and the the there signals signals are of of the the the signalparallel parallel ports entitiespadspads row. which row. The The represent pads pads row row both signals signals the are common are numbered numbered signals as as PI PI ofN_1N_1 the up stacking to PIN_40. BECs In In andthethe middle middle the signals of of the the ofFigure Figure the parallel17 17 there is a third sheet symbol. This represents the new, under design, functional shield. Designers can padsthere row. is a Thethird pads sheet row symbol. signals This are represents numbered the as new, PIN_1 under up todesign, PIN_40. functional In the middleshield. Designers of the Figure can 17 choose to connect all, or just some, of the signals of their shield to the pads row’s signals. Signals of therechoose is a to third connect sheet all, symbol. or just Thissome, represents of the signals the new,of their under shield design, to the functionalpads row’s shield. signals. Designers Signals of can similar function e.g., UART transmit and receive signals should be connected to the sheet port entities similar function e.g., UART transmit and receive signals should be connected to the sheet port entities choosethat to are connect opposite all, to or the just TXD some, and RXD of the signals signals of the of theirBECs. shield There tois no the physical pads row’s connection signals. amongst Signals of that are opposite to the TXD and RXD signals of the BECs. There is no physical connection amongst similarthe function signals of e.g., the UARTshield and transmit the signal and of receive the predef signalsined should signalsbe of connectedthe BECs. It to is theon the sheet designers’ port entities the signals of the shield and the signal of the predefined signals of the BECs. It is on the designers’ that arediscretion opposite to touse the shorting TXD andjumpers RXD (see signals Figure of the13), BECs.or secondary There isBECs no physical(see Figure connection 14), or screw amongst thediscretion signalsterminal ofto blocks theuse shield (seeshorting Figure and jumpers the15) to signal route (see ofthe Figure the signal predefined 13),s of theor shield.secondary signals A detailed ofBECs the BECs.usage(see Figureof It the is ondevelopment14), the or designers’ screw terminal blocks (see Figure 15) to route the signals of the shield. A detailed usage of the development discretionsteps using to use the shorting SensoTube jumpers reference (see model Figure is 13 presented), or secondary in Section BECs 7. (see Figure 14), or screw terminal steps using the SensoTube reference model is presented in Section 7. blocks (see Figure 15) to route the signals of the shield. A detailed usage of the development steps using the SensoTube reference model is presented in Section7. Sensors 2016, 16, 1227 25 of 59 Sensors 2016, 16, 1227 25 of 59

Sensors 2016, 16, 1227 25 of 59

Figure 17. The design template for incorporating the signals management mechanisms of SensoTube Figure 17. The design template for incorporating the signals management mechanisms of SensoTube into the design of new functional shield. The under design shield is depicted in the middle whereas into the design of new functional shield. The under design shield is depicted in the middle whereas Figurethe standardized 17. The design S-BECs template appear for on incorporating the left and right the sirespectively.gnals management mechanisms of SensoTube the standardized S-BECs appear on the left and right respectively. into the design of new functional shield. The under design shield is depicted in the middle whereas theEach standardized one of the S-BECsabove sheetappear symbols on the left represents and right a respectively. unique schematic drawing file. The use of sheet Eachsymbols one is of a thepractical above and sheet convenient symbols design represents method a unique for hierarchical schematic structure drawing of file.a schematic The use and of sheet symbolsPCBEach is project a practical one thatof the allows and above convenient designers sheet symbols to design re-use represents method ready-made a for unique hierarchical drawings. schematic This structure drawing facility of file. is a common schematicThe use ofin sheet andthe PCB majority of the electronic design software suites (e.g., Altium Designer which has been employed in projectsymbols that allowsis a practical designers and toconvenient re-use ready-made design method drawings. for hierarchical This facility structure is common of a schematic in the majorityand this study). Designers can repeatedly use the schematic sheet symbols and their PCB objects in a copy of thePCB electronic project that design allows software designers suites to (e.g.,re-use Altium ready-made Designer drawings. which hasThis been facility employed is common in this in the study). majorityand paste of thefashion electronic and putdesign entirely software the suitesemphasis (e.g., on Altium the designDesigner of whichthe circuits has been of theemployed shields. in Designers can repeatedly use the schematic sheet symbols and their PCB objects in a copy and paste thisFigures study). 18 Designersand 19 present can repeatedly the schematic use drawings the schema oftic the sheet S-BEC symbols 1 and S-BECand their 2. PCB objects in a copy fashion and put entirely the emphasis on the design of the circuits of the shields. Figures 18 and 19 and paste fashion and put entirely the emphasis on the design of the circuits of the shields. present the schematic drawings of the S-BEC 1 and S-BEC 2. Figures 18 and 19 present the schematic drawings of the S-BEC 1 and S-BEC 2.

Figure 18. Schematic drawing of the S-BEC 1.

Figure 18. Schematic drawing of the S-BEC 1. Figure 18. Schematic drawing of the S-BEC 1.

Sensors 2016, 16, 1227 26 of 59

Sensors 2016, 16, 1227 26 of 59

Figure 19. Schematic drawing of the S-BEC 2. Figure 19. Schematic drawing of the S-BEC 2. 4.2.2. Inter-Layer Communication Service Mechanism 4.2.2. Inter-Layer Communication Service Mechanism Inter-layer communication includes data and commands transfers among the MCUs of the Inter-layershields, and communicationamong MCUs and includes various integrated data and ci commandsrcuits, such as transfers digital sensors, among memory the MCUs chips, of the shields,analog-to-digital and among MCUsconversion and chips, various integrated integrated RF mo circuits,dules, etc. such In order as digital to support sensors, such needs, memory three chips, analog-to-digitaltypes of serial conversiondata communication chips,integrated means have RFbeen modules, incorporated, etc. namely In order the toI2C-bus, support the SPI-bus, such needs, and the UART port [143]. The physical access to them can be accomplished through specific three types of serial data communication means have been incorporated, namely the I2C-bus, the connection pins at the S-BECs of the system. From the three, only the I2C-bus can be used for multi- SPI-bus,processor and the communications, UART port [143 because]. The it physical is a data access bus, which to them can cansupport be accomplished up to thirty two through devices specific in connectioneither a pins single at or the multi-master S-BECs of topology the system. [144]. From By the the use three, of I2C-bus only theextenders, I2C-bus the can number be used of for multi-processorsupported devices communications, can significantly because increased it is a [145]. data bus,In addition, which canthe I2C-bus support has up been to thirty proven two to devicesbe in eithervery asuccessful single or multi-masterin various applications, topology [as144 for]. Bymachine-to-machine the use of I2C-bus interconnection extenders, the[146]. number An of supportedadditional devices option can for significantly multi-processor increased communication [145]. In addition, is the adoption the I2C-bus of the CAN-bus, has been a proven well-known to be very successfulautomotive in various communication applications, standard as for [147], machine-to-machine which appears to be interconnectionpresent in many of [146 the]. ARM-based An additional optionMCUs for multi-processor as an integrated peripheral. communication In this case, is the so adoptionme of the general-purpose of the CAN-bus, input/output a well-known pins automotiveshould be reserved for the CAN-bus signals. In the proposed communication signals positions of the S-BEC communication standard [147], which appears to be present in many of the ARM-based MCUs as 1 there are three pairs of UARTs and two chip select signals for SPI in order to avoid resources an integrated peripheral. In this case, some of the general-purpose input/output pins should be limitations inherent to the most of the existing expandable platforms. In addition, the SensoTube with reservedthe polymorphism for the CAN-bus in signals signals. connections In the proposed can ensure communication unlimited communication signals positions resources ofand, the at S-BECthe 1 theresame are three time, pairs it insures of UARTs the maximum and two flexibility chip select and signals openness. for SPI in order to avoid resources limitations inherent to the most of the existing expandable platforms. In addition, the SensoTube with the polymorphism4.2.3. Inter-Layer in signals Programming connections and can Debugging ensure unlimitedService Mechanism communication resources and, at the same time, it insuresThe embedded the maximum MCUs flexibilityat the end-systems and openness. can be programmed through the method of the in- system programming (ISP). Basically, the SPI-bus is mainly used for this task together with certain 4.2.3.signal, Inter-Layer such as Programming the reset, the andvoltage Debugging supply, and Service the ground Mechanism signals of the devices that are to be Theprogrammed. embedded MCUs at the end-systems can be programmed through the method of the in-system programming (ISP). Basically, the SPI-bus is mainly used for this task together with certain signal, such as the reset, the voltage supply, and the ground signals of the devices that are to be programmed. Sensors 2016,, 16,, 1227 1227 2727 of of 59 59

SensoTube supports the ISP method by providing all of the SPI-bus signals to its S-BEC 1 expansionSensoTube pins, supportsi.e., the theMOSI, ISP methodMISO, byCLK providing and SEL all ofpins. the SPI-busSeveral signalsMCUs toof its the S-BEC interconnected 1 expansion functionalpins, i.e., the shields MOSI, can MISO, be programmed CLK and SEL via pins. the Severalvery same MCUs ISP ofcircuits the interconnected and by addressing functional them shields using somecan be of programmed the general purpose via the very input/output same ISP pins circuits of the and S-BECs. by addressing them using some of the general purposeRegarding input/output the debugging pins of thefunction, S-BECs. the majority of the in-system emulation and code tracing is traditionallyRegarding accomplished the debugging using function, specific the external majority devices, of the which in-system support emulation the IEEE and 1149.1 code tracingstandard is fortraditionally boundary accomplished scans, and are using widely specific known external as the JTAG devices, debuggers which support [106,148]. the All IEEE the 1149.1 necessary standard signals for forboundary the JTAG scans, have and been are provided widely known at the S-BEC as the 2 JTAG (see debuggersFigure 11). [The106 ,JTAG148]. Alldebuggers the necessary are also signals used forfor the programming JTAG have been task. provided From the at theside S-BEC of the 2 en (seed-system, Figure 11 a ).sizable The JTAG JTAG debuggers connector are of ten also up used to twentyfor the programmingpins must be permanently task. From thesoldered side of in the the end-system, PCB. Despite a sizablethe fact, JTAG that there connector is no use of ten of upall of to thetwenty signal pins pins must of a be JTAG permanently connector, soldered its soldering in the PCB.to the Despite end-system the fact, is mandatory, that there is in no order use of to all ensure of the thesignal connection pins of a JTAGcompatibility connector, with its solderingthe JTAG todevices. the end-system To overcome is mandatory, this design in order limitation, to ensure in the the SensoTube,connection compatibilitythe JTAG signal with pins the JTAGcan be devices. routed To to overcome a particular this PDL design shield, limitation, on which in the there SensoTube, is the necessarythe JTAG signalJTAG pinsconnector. can be The routed PDL to shield a particular could PDLbe removed shield, onfrom which the therefinal WSAN is the necessary system, when JTAG theconnector. latter is The ready PDL for shield installation could bein removedthe field. from the final WSAN system, when the latter is ready for installationIn case inof thethe field. ARM-based MCUs, which are becoming more and more popular in embedded systemsIn case[149], of the the IEEE ARM-based 1149.1 boundary MCUs, which scan stan are becomingdard can support more and the more debugging popular of intwo embedded or more cores,systems simultaneously. [149], the IEEE 1149.1Therefore, boundary through scan standarda single caninterface, support the the designers debugging are of twoable or to more perform cores, synchronizedsimultaneously. debugging Therefore, of throughmulti-core a single systems. interface, The multiple the designers cores can are be able either to perform identical synchronized (symmetric multi-coredebugging processing—SMP), of multi-core systems. or different The multiple (asy coresmmetric can multi-core be either identical processing—AMP). (symmetric multi-coreThe only drawbackprocessing—SMP), in the multi-core or different debugging (asymmetric is the multi-coreneed to use processing—AMP). two, instead of one, The JTAG only connectors drawback at in the the endmulti-core systems, debugging in order isto theimplement need to usethe two,necessary instead sc ofan one,chain. JTAG In particular, connectors the at theJTAG end data systems, output in signalorder tofrom implement a target system the necessary (TDO signal) scan chain. must Inbe particular,the JTAG data the JTAG input data signal output to the signal next target from asystem target (TDIsystem signal) (TDO in signal) the chain. must To be enable the JTAG the multi- data inputcore debugging, signal to the the next SensoTube target system reference (TDI model signal) has in beenthe chain. enriched To enablewith the the J-BEC multi-core expansion debugging, mechanism, the SensoTubewith which referencethe MCUs model of the hasfunctional been enriched shields canwith have the J-BECtheir JTAG_TDI expansion and mechanism, JTAG_TDO with daisy-chained which the MCUs (see Figure of the functional20). More specifically, shields can havetwo dual- their pinJTAG_TDI connectors and have JTAG_TDO been incorporated daisy-chained for (see this Figure goal. Since20). More the through-hole specifically, two BECs dual-pin cannot connectors be daisy- chained,have been two incorporated dual-pin surface-mount for this goal. connectors Since the have through-hole been employed, BECs cannot one soldered be daisy-chained, at the top side two (thedual-pin white surface-mount connector shown connectors at Figure have 10) beenand the employed, other at onethe bottom soldered side at theof the top PCB. side The (the signal white connections,connector shown between at Figure the two10) andconnectors, the other can at thebe bottomachieved side by of PCB the PCB.metal-plated The signal through-holes connections, (knownbetween as the signal two connectors,vias). Every can SensoTube be achieved function by PCBal shield metal-plated should through-holeshave its own J-BEC (known connectors as signal solderedvias). Every onto SensoTube its PCB. In functional cases where shield this should featur havee is itsnot own used J-BEC in a connectorsshield, then, soldered the JTAG_TDI onto its PCB.and JTAG_TDOIn cases where signal this should feature be is notshorted, used in in order a shield, to allow then, thethe JTAG_TDIsignals to pass and JTAG_TDOthrough the signal neighboring should shields.be shorted, in order to allow the signals to pass through the neighboring shields.

Figure 20. The J-BEC mechanism for the JTAG TDI and TDO data signals’ chain. Figure 20. The J-BEC mechanism for the JTAG TDI and TDO data signals’ chain.

The J-BEC mechanism can be incorporated by designers by simply use the sheet symbol depicted in FigureThe J-BEC21 which mechanism represents can the be j-BEC incorporated circuit. by designers by simply use the sheet symbol depicted in Figure 21 which represents the j-BEC circuit.

Sensors 2016,, 16, 1227 2828 of of 59 59 Sensors 2016, 16, 1227 28 of 59

Figure 21. The J-BEC sheet symbol used as a design template for the incorporation of the J-BEC expansionFigureFigure 21.21. mechanism The J-BEC in sheet new symbol shields useddesigns. as aa designdesign templatetemplate forfor thethe incorporationincorporation ofof thethe J-BECJ-BEC expansionexpansion mechanismmechanism inin newnew shieldsshields designs.designs. 4.2.4. Inter-Layer Energy Management Service Mechanism 4.2.4.4.2.4. Inter-LayerInter-Layer EnergyEnergy ManagementManagement ServiceService MechanismMechanism The power of the shields has been designed so as to ensure the maximum versatility in developmentTheThe powerpower and ofofexperimentation. thethe shieldsshields hashas In been beenparticular, designeddesigned there soso are asas ten toto independent ensureensure thethe maximumconnectionmaximum versatilitypinsversatility at the S- inin BECdevelopmentdevelopment 2 (see Figure and 11), experimentation. which provide In Inall particular, particular,of the functional there there are areshields ten ten independent independentwith the necessary connection connection voltage pins pins sources.at atthe the S- TheS-BECBEC maximum 2 2(see (see Figure Figure current 11), 11), which rating which provi per provide BEC’sde all all ofpin of the theis functionalaround functional 5 Ashields shields and it with withis more the the necessary necessarythan enough voltage voltage for the sources. vast majorityTheThe maximummaximum of the currentWSANcurrent ratingsystemsrating perper in BEC’sBEC’sagriculture pinpin isis or aroundaround other 55similar AA andand application itit isis moremore thanthan domains enoughenough (e.g., forfor forestry, thethe vastvast environmentalmajoritymajority ofof thethe monitoring, WSANWSAN systemssystems etc.). inin agricultureagriculture oror otherother similarsimilar application domains (e.g., forestry, environmentalenvironmentalIn addition monitoring,monitoring, to the above etc.).etc.). typical power supply mechanism, an additional mechanism has been introduced,InIn additionaddition referred toto thethe to asaboveabove the P-BEC. typicaltypical The powerpower P-BEC supplysupply has mechanism,bmechanism,een designed anan so additionaladditional as to allow mechanismmechanism the functions hashas of beenbeen in- systemintroduced,introduced, monitoring referred and to as ascontrol the the P-BEC. P-BEC. of the The Theenergy P-BEC P-BEC in hasa has WSAN been been designed node. designed The so so implementationas asto toallow allow the the functions of functions the P-BEC of in- of incorporatesin-systemsystem monitoring monitoring a 2 × 8 pinsand and BEC.control control As ofshown of the the energy in energy Figure in in a22a, a WSAN WSAN the upper node. node. pins The The of implementation the BEC are routed of thethe to P-BECP-BECa row ofincorporatesincorporates through-hole aa 22 pads.ˆ× 8 pins The BEC. lower As pinsshown of thein Figure BEC have 22a,22a, theto be upper terminated pins of at the a BECPML are shield. routed To toto ensure aa row standardizationofof through-holethrough-hole in pads.pads. design, The certain lower pinsvoltage of thethenames BECBEC have havehave been toto bebe given terminatedterminated to the lower atat aa PMLPML eight shield.shield. pins of To the ensureensure BEC, i.e.,standardizationstandardization +3.3 Vdc, +5 Vdc,inin design,design, V_BAT, certaincertain and voltageV_AUX0voltage namesnames up to havehaveV_AUX4. beenbeen givengiven toto the lower eight pins of the BEC, i.e.,i.e., +3.3+3.3One Vdc,Vdc,or more +5+5 Vdc, of these V_BAT, voltages andand V_AUX0V_AUX0can be connected upup toto V_AUX4.V_AUX4. to the upper pins of the BEC by another shield, e.g., anOneOne ETL oror moreshield,more ofof which thesethese voltagescanvoltages monitor cancan beandbe connectedconnected control the toto energy thethe upperupper flow pinspins to otherof the shields. BEC by Next, another with shield, the usee.g.,e.g., of anan a ETL dual-pin-headerETL shield, shield, which which (P12 can can in monitor monitor Figure and22b), and control anycontrol shield the the energy can energy select flow flow one to otherofto theother shields. available shields. Next, voltage Next, with withsources the usethe fromofuse a dual-pin-headerof the a dual-pin-header BEC. The pins (P12 of(P12 in this Figure in pin-headerFigure 22b), 22b), any can shieldany eith shield caner selectbe can shorted select one of oneby the theof available the use available of voltagejumper, voltage sources in order sources from to directlythefrom BEC. the provide TheBEC. pins The the of pinsvoltage this of pin-header this source pin-header to can the either circuits can beeith of shorteder the be shield, shorted by the or useby help the of jumper,the use engagement of jumper, in order inof to ordervarious directly to circuitsprovidedirectly for theprovide current voltage the monitoring source voltage to source the and/or circuits to circuits the of circuits the for shield, switching of the or helpshield, ON the and or engagement OFFhelp thethe energyengagement of various flow. circuitsAlthough,of various for thecurrentcircuits feature monitoringfor ofcurrent breaking monitoring and/or the circuitsvoltage and/or forsupply switchingcircuits signals for ON switching pa andth in OFF order ON the and to energy measureOFF flow.the energythe Although, flow flow. of currents the Although, feature is knownofthe breaking feature in the theof embedded breaking voltage supplythe systems voltage signals design supply path area insignals [150], order thpa toeth measureintegration in order the to of flowmeasure this of technique currents the flow into is knownof the currents WSAN in the is systemsembeddedknown inis new.the systems embedded design systems area [150 design], the integrationarea [150], th ofe this integration technique of intothis thetechnique WSAN into systems the WSAN is new. systems is new.

(a) (b) (a) (b) Figure 22. The P-BEC mechanism for inter-layer power management services: (a) the schematic FigureFigure 22.22. The P-BECP-BEC mechanismmechanism forfor inter-layerinter-layer powerpower managementmanagement services:services: ((aa)) thethe schematicschematic drawinng; and (b) the three-dimensional view. drawinng;drawinng; andand ((b)) thethe three-dimensionalthree-dimensional view.view. Figure 23 illustrates the sheet symbol of the schematic drawing of the P-BEC mechanism. The completeFigureFigure schematic 23 illustratesillustrates drawing the the filesheet sheet is givensymbol symbol in ofFigure ofthe the schematic 24. schematic Signals drawing with drawing the of “_In” the of theP-BECpost-fix P-BEC mechanism. are mechanism.considered The asThecomplete potential complete schematic powerschematic signals drawing drawing to file the is shield, filegiven is giveninwhereas Figure in Figure24.signals Signals 24with. with Signals the the “_Out” “_In” with post-fixpost-fix the “_In” are post-fix consideredthose that are comingconsideredas potential from as powerany potential other signals shields, power to thee.g., signals shield, from to a the whereasPML shield, shield. signals whereas with signals the “_Out” with the post-fix “_Out” are post-fix those that are thosecoming that from coming any other from anyshields, other e.g., shields, from e.g.,a PML from shield. a PML shield.

Sensors 2016, 16, 1227 29 of 59

SensorsSensors 2016 2016, 16, 16, 1227, 1227 2929 of of 59 59 Sensors 2016, 16, 1227 29 of 59

FigureFigure 23. Selective23. Selective connection connection of of shield’s shield’s signalssignals to S-BEC’s S-BEC’s signal signal by by the the use use of pin-headers of pin-headers and and Figure 23. Selective connection of shield’s signals to S-BEC’s signal by the use of pin-headers and short-circuitshort-circuit jumpers. jumpers. short-circuitFigure 23. Selective jumpers. connection of shield’s signals to S-BEC’s signal by the use of pin-headers and short-circuit jumpers.

Figure 24. Selective connection of shield’s signals to S-BEC’s signal by the use of pin-headers and

Figureshort-circuit 24. Selective jumpers. connection of shield’s signals to S-BEC’s signal by the use of pin-headers and Figure 24. Selective connection of shield’s signals to S-BEC’s signal by the use of pin-headers and short-circuitFigure 24. Selective jumpers. connection of shield’s signals to S-BEC’s signal by the use of pin-headers and short-circuitshort-circuit jumpers. jumpers.

Figure 25. Example of monitoring and control of the energy at group and shield level using the P- BEC mechanism. Figure 25. Example of monitoring and control of the energy at group and shield level using the P- Figure 25. Example of monitoring and control of the energy at group and shield level using the P- BEC mechanism. FigureBEC 25. mechanism.Example of monitoring and control of the energy at group and shield level using the P-BEC mechanism.

Sensors 2016, 16, 1227 30 of 59

Figure 25 illustrates an example of the P-BEC mechanism usage. In particular, a PML shield accepts +12 Vdc and converts it to a +5 Vdc to power any shield that needs +5 Vdc for its operation. The +5 Vdc is then routed to the particular P-BEC’s pin. Through the P-BEC an ETL shield can measure the current flowing to other shields that are using the +5 Vdc for their operation. Additionally, the ETL shield is able to switch-ON or OFF the +5 Vdc voltage source. Such features enable the energy management of a group of functional shields. At the shield level, e.g., in the case of a DCL shield, the +5 Vdc voltage can also be controlled and monitored locally. The logical signals that are mentioned in Figure 25 can be digital output signal of the shields’ on-board MCUs.

5. Support for Firmware, Software and Middleware As it was explained above, the SensoTube architecture can ensure the development of WSAN firmware applications either in a distributed single-master MCU, or in a multi-master collaborative mode. The proposed particular expansion mechanisms facilitate the use of all the popular development tools, such as programmers and debuggers, for any possible MCU. Moreover, the firmware can be remotely maintained and managed with the use of programming and upgrade over-the-air (OTA) techniques, which can be implemented without intervention on the WSAN system. Regarding the development of the MCUs’ firmware, the designers and the developers are free to use the software tool chains of their choice. Except from the firmware, a WSAN system may include the software development of particular PC software applications for either the in-house testing of the system, or for the rapid control prototyping (RCP) (e.g., by the use of Matlab, or LabVIEW software development suites [63]), or for the implementation of the final application for the operation and administration of the system. A SensoTube-based WSAN system completely supports these three tasks by the use of its wireless and wired data interconnection. For the RCP, in particular, any ARM-based SensoTube shield, and through the use of a PDL shield, can enable the hardware-in-the-loop technique of Matlab/Simulink. In other words, the developer can build, execute, and test ARM-based MCUs’ firmware using the Matlab platform. In cases of medium up to very large-scale WSAN deployments, the software application development invokes middleware [91]. Towards this direction, several promising methodologies have been reported by the research community. Domain-specific modeling languages based on the Model-driven Engineering (MDE) approach [151] to describe the application, the middleware of systems’ virtualization [152], are only an indication of the current research trends in this WSAN software aspect. In particular, as it is pointed out in [153], it is required for the application and services to be decoupled from the WSAN, i.e., the wireless networking technical operations. In addition, as it is enunciated in [154], the implementation of a substantial middleware would require a layered architecture, through which the overall system could be decomposed into specific modules (layers). Therefore, the abstraction of SensoTube architecture, with the foundation of the seven functional layers appears to be particularly convenient for the development of the middleware. Specifically, the existence of local intelligence in the MCU-based functional shields, together with the inherent support for multi-processor distributed logic, can support the WSAN sub-system’s modeling [155], and allows for the development of comprehensive and substantial libraries of APIs.

6. Systems Encapsulation and Installation In the harsh environment of agricultural domain, the WSAN nodes’ housings, as well as the total mechanical structure of them, is a key factor for the total robustness and reliability of the remote WSAN system [14]. The external influences that a WSAN node may suffer in an agricultural field may include chemical influences (such as acids, etc.), dust, ice, corrosion, air moisture, aggressive constituents of rainwater (such as heavy metals, etc.), solar radiation (UV radiation and high temperature), soil salinity, contamination from birds and insects, contamination from micro-organisms (such as fungi, moss, etc.), and other factors related to air pollution. Sensors 2016, 16, 1227 31 of 59

In order to protect the electronic circuits of the WSAN system from these external influences, particularSensors 2016 enclosures, 16, 1227 proper for electrical and electronics systems are extensively used31 by of 59 both the commercial systems’ vendors and the researchers. These cases are graded according to their commercial systems’ vendors and the researchers. These cases are graded according to their resilience resilienceSensors 2016 to dust, 16, 1227 and water (IEC IP Codes) [156]. In practice, these enclosures are the only31 solution of 59 to dust and water (IEC IP Codes) [156]. In practice, these enclosures are the only solution for water for water ingress protection at outdoor deployments, but they are quite expensive and they are not so commercialingress protection systems’ at vendors outdoor and deployments, the researchers. but Th theyese cases are quiteare graded expensive according and tothey their are resilience not so convenient in terms of the interior configuration of the electronics circuits and other electrical parts, toconvenient dust and inwater terms (IEC of theIP Codes) interior [156]. configuration In practice, of thethese electronics enclosures circuits are the and only other solution electrical for waterparts, such as batteries etc. Figure 26 shows a typical experimental configuration of a WSAN node for an ingresssuch as protectionbatteries etc. at Figureoutdoor 26 deployments,shows a typical but experimental they are quite configuration expensive of anda WSAN they nodeare not for soan agriculturalconvenientagricultural application. in application. terms of the interior configuration of the electronics circuits and other electrical parts, such as batteries etc. Figure 26 shows a typical experimental configuration of a WSAN node for an agricultural application.

(a) (b)

Figure 26. (a) A typical electrical IP66-grade enclosure; (b) the internal configuration of a WSAN Figure 26. (a) A typical electrical IP66-grade enclosure; (b) the internal configuration of a WSAN node’s node’s electrical and electronic(a) subsystems. (b) electrical and electronic subsystems. Figure 26. (a) A typical electrical IP66-grade enclosure; (b) the internal configuration of a WSAN node’sIn cases electrical where anda WSAN electronic node subsystems. requires a significant amount of energy autonomy, then more than one,In cases or battery where cells a WSAN have to node be used requires on the a significant spot, installed amount in multiple of energy electrical autonomy, enclosures then more at the than one,expense or batteryIn cases of cost, where cells cabling have a WSAN todistributi be node used requon on order,ires the a significant spot,and appearance. installed amount in Additi of multiple energyonally, autonomy, electrical these enclosures then enclosures more suffer than at the expenseone,from ofor drilling cost,battery cabling and cells cutting, have distribution whichto be usedare order, frequent on andthe functionspot, appearance. installeds in experiments, Additionally,in multiple and electrical these extra enclosurescare enclosures has to be suffer at taken the from drillingexpensein order and of cutting,to cost,maintain cabling which their distributi are durability frequenton order,against functions and dust appearance.in and experiments, water. Additi Another andonally, issue extra these is care the enclosures hassupport to be sufferof taken the in orderfromenclosures tomaintain drilling on and the their cutting,metallic durability which support against are poles. frequent dust Figure andfunction 27 water. showss in Another experiments,a typical issueWSAN and is node the extra support implementation care has of to the be enclosures taken with a solar panel, a water-proof electrical enclosure and a metallic pole. In addition, significant on thein order metallic to maintain support their poles. durability Figure 27 against shows dust a typical and water. WSAN Another node issue implementation is the support with of the a solar complexity is usually added from the RF antennae installation because the antennae must be installed panel,enclosures a water-proof on the metallic electrical support enclosure poles. Figure and a 27 metallic shows a pole. typical In WSAN addition, node significant implementation complexity with is in such places where the electromagnetic signals are not influenced from the metallic materials of the usuallya solar added panel, from a thewater-proof RF antennae electrical installation enclosure because and thea metallic antennae pole. must In be addition, installed significant in such places complexityWSAN node. is usuallyThis is theadded reason from why the theRF antennaeantennae installationare typically because installed the outside antennae the must enclosures be installed or, in where the electromagnetic signals are not influenced from the metallic materials of the WSAN node. inmany such cases, places at where additional the electromagnetic support arms. Very signals often, are allnot these influenced issues arefrom becoming the metallic sources materials for reduced of the This is the reason why the antennae are typically installed outside the enclosures or, in many cases, at WSANreliability node. and This durability is the reason for the why deployed the antennae system. are typically installed outside the enclosures or, in additionalmany cases, support at additional arms. Very support often, arms. all these Very issuesoften, all are these becoming issues are sources becoming for reducedsources for reliability reduced and durabilityreliability for and the durability deployed for system. the deployed system.

(a) (b)

Figure 27. (a) An experimental WSAN node’s traditional enclosure installed at the back of a solar panel; (b) the front view of a typical(a) WSAN node with its solar panel( andb) its metallic support pole. Figure 27. (a) An experimental WSAN node’s traditional enclosure installed at the back of a solar Figure 27. (a) An experimental WSAN node’s traditional enclosure installed at the back of a solar panel;Keeping (b) theall thefront aforementioned view of a typical issues WSAN in node mind, with th itse use solar of panelordinary and itsdrain metallic and supportwater supply pole. tubes arepanel; proposed (b) the fronthere viewas an ofextremely a typical WSANconvenient node so withlution its solarfor environmental panel and its metallic and agricultural support pole. WSAN Keeping all the aforementioned issues in mind, the use of ordinary drain and water supply tubes

are proposed here as an extremely convenient solution for environmental and agricultural WSAN

Sensors 2016, 16, 1227 32 of 59

Keeping all the aforementioned issues in mind, the use of ordinary drain and water supply tubes Sensors 2016, 16, 1227 32 of 59 are proposed here as an extremely convenient solution for environmental and agricultural WSAN systemsystem enclosures. enclosures. Tubes Tubes of of polyvinyl polyvinyl chloridechloride (PVC), or unplasti unplastisizedsized polyvinyl polyvinyl chloride chloride (PVC-U) (PVC-U) inherentlyinherently provide provide the the required required soil andsoil dustand ingressdust ingress protection. protection. According According to the proposed to the proposed SensoTube architecture,SensoTube thearchitecture, various expansionthe various shields expansion are placedshields withinare placed a plastic within tube a plastic (Figure tube 28 ).(Figure The PCB 28). of theThe SensoTube PCB of the board SensoTube model board has been model designed has been so design as to beed fittedso as to within be fitted tubes within of 90 tubes mm inof diameter.90 mm Thein technicaldiameter. specificationsThe technical specifications of the PVC tubesof the arePVC shown tubes are in Tableshown3. in The Table selection 3. The selection of the pressure of the tolerance,pressure e.g., tolerance, 4 atms e.g., or 64 atms,atms or influences 6 atms, influences the thickness the thickness of the tube. of the tube.

(a) (b)

Figure 28. A typical example of the encapsulation of a WSAN functional shield based on the Figure 28. A typical example of the encapsulation of a WSAN functional shield based on the SensoTube SensoTube architecture. The electronic components of the node are designed in the form of expansion architecture. The electronic components of the node are designed in the form of expansion shields able to shields able to be inserted within plain irrigation PVC tubes of 90 mm diameter. (a) A three- be inserted within plain irrigation PVC tubes of 90 mm diameter. (a) A three-dimensional view showing dimensional view showing a SensoTube shield inside a tube; (b) a real implementation of a SensoTube shield inside a tube; (b) a real implementation of the proposed encapsulation method. the proposed encapsulation method.

Table 3. Specifications of a 90 mm diameter PVC tube that can be used as the encapsulation and Table 3. Specifications of a 90 mm diameter PVC tube that can be used as the encapsulation and support pole of WSAN node according to the SensoTube architecture. support pole of WSAN node according to the SensoTube architecture.

PressurePressure Tolerance Parameter 44 atms atms 6 6 atms atms Material PVC-U Material PVC-U OuterOuter Diameter 90 90 mm Thickness 1.8 1.8 mm mm up up to to 2.2 mm 2.7 2.7 mm mm up up to to 3.2 3.2 mm 0.785 0.785 kg/m 1.15 1.15 kg/m kg/m Standards EN1452-2 EN1452-2 [157], [157], DIN 8061, DINDIN 80628062 Cost 4 USD/m

TheThe very very same same tube tube acts acts also also asas thethe installationinstallation support pole. pole. The The height height of of the the tube tube may may vary vary accordingaccording to to the the precise precise farming farming applicationapplication needs.needs. The The WSAN WSAN system’s system’s boards boards can can be be placed placed at at variousvarious heights heights within within the the tube. tube. DevelopersDevelopers can can use use tu tubesbes of of smaller smaller diameters diameters under under the the boards’ boards’ synthesis in order to act as a support spacer. For the battery cells, it is suggested they be placed at the synthesis in order to act as a support spacer. For the battery cells, it is suggested they be placed at the bottom of the tube. This helps the centroid of the tube to be underground. Moreover, the rich set of bottom of the tube. This helps the centroid of the tube to be underground. Moreover, the rich set of pipe pipe management accessories, e.g., expansion adaptors, fittings, tees, sleeves, connectors, bends, management accessories, e.g., expansion adaptors, fittings, tees, sleeves, connectors, bends, flanges, etc. flanges, etc. can be creatively used for sensory installation above the surface or underground. can be creatively used for sensory installation above the surface or underground. Figure 29a displays Figure 29a displays a SensoTube-based WSAN node in an orchard. As it is shown, the plastic tube a SensoTube-basedhas been used not WSANonly for node the encapsulation in an orchard. of As the it electronic is shown, systems the plastic but also tube as has a support been used pole. not The only forsolar the encapsulationpanel of the node of the has electronic been easily systems adapted but to also the astop a supportcap of the pole. plastic The tube, solar as panel it is shown of the nodein hasFigure been easily29b. In adapted contrast to with the topthe captraditional of the plastic installation tube, asmethods, it is shown such inas Figure that of 29 Figureb. In contrast 27, in the with theproposed traditional installation installation method methods, the RF such antenna as that is en ofcapsulated Figure 27 within, in the the proposed tube and installation in this way method they theare RF fully antenna protected is encapsulated from the external within environment. the tube and in this way they are fully protected from the external environment.

Sensors 2016, 16, 1227 33 of 59 Sensors 2016, 16, 1227 33 of 59

(a) (b)

Figure 29. ((a)) A A SensoTube-based SensoTube-based WSAN node installed in an orchard. All the electronics and the RF antenna of the node have been enclosed within th thee tube. The solar panel has been adapted at the top cap of the tube ( b) in such way so as to be easily added or removed.

The advantages of the SensoTube approach for the WSAN hardware enclosures are numerous. The advantages of the SensoTube approach for the WSAN hardware enclosures are numerous. Some of them are listed below: Some of them are listed below:  Ruggedness: The drain and water PVC tubes by default assure the coveted resistance to water, ‚ Ruggedness:chemicals, salinity,The drain acids, and etc. water PVC tubes by default assure the coveted resistance to water,  chemicals,Non-metallic salinity, support acids, poles: etc.the use of the plastic tube as the support pole benefits the total system ‚ Non-metallicbecause the supportweight poles:is greatlythe use reduced. of the plasticFurtherm tubeore; as the supportmaterial poleis inexpensive benefits the compared total system to becausetraditional the metallic weight constructions. is greatly reduced. In addition, Furthermore; it provides the better material lightning is inexpensive protection. compared Finally, toit traditionalis not attractive metallic to thieves constructions. looking In for addition, scrap metal. it provides better lightning protection. Finally, it is  notUnderground attractive installation: to thieves looking It is a forrobust scrap enclosure metal. solution for WSAN nodes in underground ‚ Undergroundinstallation where installation: the wholeIt isofa the robust node, enclosure or the most solution of it, has for to WSAN be buried nodes underground in underground [158].  installationInternal temperature where the stability: whole ofThe the temperature node, or the mostof the of air it, hasmass to beinside buried a PVC underground tube is slightly [158]. ‚ Internaldifferent temperature from that stability: of the Theopen temperature air, because of thethis air plastic mass inside material a PVC has tube a very is slightly low differentthermal fromconductivity. that of the Also, open as air, deeper because the thistube plastic is instal materialled underground, has a very low the thermal temperature conductivity. difference Also, is asincreased deeper thedue tube to the is installed facts that underground, a certain part the of temperature the enclosure difference are not is increaseddirectly exposed due to the to facts the thatexternal a certain environment, part of the and enclosure that the are temperature not directly un exposedder the surface to the external is almost environment, constant during and thatthe theday temperatureand night periods. under theThus surface for deployments is almost constant in environments during the with day andhigh night temperature periods. and Thus high for deploymentssunlight radiation in environments it is possible with to keep high the temperature temperature and of high the sunlightenclosed radiationelectronics it isat possiblea lower tolevel keep with the regard temperature to the open of the air enclosedtemperature. electronics Such a atfeature a lower is of level great with importance regard to for the the open energy air temperature.balance of the Such WSAN a feature system. is of great importance for the energy balance of the WSAN system. ‚ Easy deployment: PVC tubes are easily transported and, du duee to their convenient centroid, they do not require deep paddles andand cablewayscableways forfor theirtheir supportsupport onon thethe ground.ground. ‚ Larger innerinner space:space:e.g., e.g., in in a a 2.5 2.5 m m PCV PCV tube tube of 90of 90 mm mm diameter diameter and and 2.7 mm2.7 mm thickness, thickness, the total the innertotal usefulinner useful volume is about is about 13,723 13,723 cm3 whereas cm3 whereas the inner the inner volume volume of a 170 of mma 170ˆ mm170 × mm 170 ˆmm75 × mm 75 electricalmm electrical enclosure, enclosure, such such as the as one the displayedone displayed in Figure in Figure 26a, is26a, just is about just about 2100 2100 cm3. cm3. ‚ RF antennae friendliness: the RF antennae antennae are installed within the tube and and they they are are fully fully protected protected from the threats ofof thethe externalexternal environment.environment. Additionally, the ability of using all the internal space of a tube facilitates the encapsulation of very long RF antennae, so it is easy to incorporate antennae from λ/4 up up to to λλ ((λλ is the wavelength of of a a radio radio signal, signal, expressed expressed in in units units of of meters). meters). For example, the wavelength of a 433 MHz RF signal is around 69 cm. In this particular case, the ideal antenna should be a 69 cm long wire. In general, antennae close to the wavelength of the

Sensors 2016, 16, 1227 34 of 59

For example, the wavelength of a 433 MHz RF signal is around 69 cm. In this particular case, the ideal antenna should be a 69 cm long wire. In general, antennae close to the wavelength of the incorporated RF signal can benefit the RF signals propagation performance, and they allow for low-cost and low energy antenna driving circuits.

‚ ZeroSensors RF 2016 signal, 16, 1227 attenuation: the PVC material doesn’t block the propagation of radio34 of 59 signals. A typical example is the use of PVC-based constructions to hide the antennae of the cellular networksincorporated on the terrace RF signal of thecan blockbenefit ofthe flats RF signals at the propagation cities. performance, and they allow for low-cost and low energy antenna driving circuits. ‚ Neat cabling:Zero RFall signal the attenuation: cables of thethe PVC WSAN material system doesn’t can block be tidily the propagation routed along of radio the innersignals. side A of the tube. Hence,typical theexample cabling is the is protecteduse of PVC-based from the construc environmentaltions to hide influences. the antennae of the cellular ‚ Greaternetworks energy storage on the terrace units performance:of the block of Theflats at temperature the cities. and solar radiation at the bottom part of the tube,Neat cabling: which all is the buried cables underground, of the WSAN system permits can batteries be tidily routed and several along the other inner alternative side of the energy tube. Hence, the cabling is protected from the environmental influences. storage units to maintain their nominal efficiency, capacity and lifetime.  Greater energy storage units performance: The temperature and solar radiation at the bottom part ‚ Farm machineof the tube, friendliness: which is buriedtubes un doderground, not require permits shoring batteries and cablewaysand several other for their alternative support. energy Thus, they allow thestorage unrestricted units to maintain movement their of nominal the various efficiency, machines capacity and and equipment lifetime. used in farm management.  Farm machine friendliness : tubes do not require shoring and cableways for their support. Thus, 7. Migratingthey Existing allow the OSH unrestricted Designs movement to SensoTube of the various Architecture machines and equipment used in farm management. The SensoTube architecture allows designers and developers to continue their implementations using the7. Migrating toolchains Existing they OSH already Designs know, to SensoTube and to freely Architecture design their own circuits according to their experience andThe SensoTube their applications’ architecture specific allows designers requirements. and developers SensoTube to continue ensures their the implementations above groups of users the necessaryusing the expansion toolchains mechanismsthey already know, with and which to free theyly design can successfully their own circuits make according the next to steptheir of their open-sourceexperience designs and towardstheir applications’ the needed specific optimization requirements. and SensoTube reliability. ensures the above groups of users the necessary expansion mechanisms with which they can successfully make the next step of 7.1. Towardstheir open-source Energy Optimized designs MCU-Basedtowards the needed Functional optimization Expansion and Shieldsreliability.

As7.1. to theTowards question Energy ifOptimized any one MCU-Based of the existing Functional OSEP Expansion main-boards Shields could be used as a MCU-based functional layerAs to the shield, question or if else, any one if aof WSAN the existing system OSEP wasmain-boards exclusively could be based used onas a anMCU-based existing OSEP main-board,functional the answerlayer shield, is yes, or else, but if the a WSAN system system would was suffer exclusively from thebased constraints on an existing identified OSEP main- in Section2 above, andboard, the the most answer important, is yes, but thethe system would would suffer have from very thepoor constraints energy identified efficiency. in Section To prove 2 this statement,above, we and chose the threemost important, of the most the popular system would OSH have platforms very poor today, energy namely efficiency. the Arduino To prove Unothis Rev. 3, the Nucleostatement, STM32L152, we chose and three the of FRDM-KL25Z. the most popular The OSH first platforms one is an today, 8-bit MCUnamely platform the Arduino whereas Uno the last Rev. 3, the Nucleo STM32L152, and the FRDM-KL25Z. The first one is an 8-bit MCU platform whereas two are 32-bit ARM-based MCU platforms (see Figure 30). Our aim was to demonstrate their energy the last two are 32-bit ARM-based MCU platforms (see Figure 30). Our aim was to demonstrate their efficiencyenergy for aefficiency battery-operated for a battery-operated WSAN system WSAN deployedsystem deployed in the in agricultural the agricultural field. field.

Figure 30. Three of the most popular open-source hardware platforms. Arduino Uno Rev. 3 from Figure 30. Three of the most popular open-source hardware platforms. Arduino Uno Rev. 3 from Arduino; Nucleo STM32L152 from ST Microelectronics, and FRDM-KL25Z from Freescale/NXP. Arduino; Nucleo STM32L152 from ST Microelectronics, and FRDM-KL25Z from Freescale/NXP. The methodology of the test was to measure the current drawn by each one of the Theaforementioned methodology platforms of the test having was their to measure MCUs in the full current active and drawn in deep by sleep each operation one of the modes. aforementioned The platformsdifference having between their MCUs these two in full current active consumptions and in deep is sleepequal to operation the current modes. required The for difference a functional between shield which is using just the MCU circuits and not any kind of auxiliary circuits. The current these twoconsumption current consumptions in MCU deep sleep is equal mode to indicates the current the current required consumption for a functional of the auxiliary shield circuits. which is using just the MCU circuits and not any kind of auxiliary circuits. The current consumption in MCU deep sleep mode indicates the current consumption of the auxiliary circuits. Sensors 2016, 16, 1227 35 of 59

Sensors 2016, 16, 1227 35 of 59 The power supply was decided to be +5 Vdc provided through the USB ports of the three individual The power supply was decided to be +5 Vdc provided through the USB ports of the three platforms.Sensors 2016 The, 16 alternative, 1227 of providing external voltages greater than +5 Vdc through the35 of external 59 individual platforms. The alternative of providing external voltages greater than +5 Vdc through the voltage inputs of the boards was rejected because the voltage regulation circuitry of each board is externalThe voltage power inputs supply of wasthe bodecidedards wasto be rejected +5 Vdc because provided the through voltage the regulation USB ports circuitry of the threeof each differently implemented and it has different energy efficiency. Therefore, the power supply through boardindividual is differently platforms. implemented The alternative and ofit hasproviding different external energy voltages efficiency. greater Therefore, than +5 Vdcthe powerthrough supply the thethrough USBexternal ports the voltage ensuresUSB ports inputs an ensures equal of the treatment anbo ardsequal was treatment of rejected the three of because the boards. three the boards. voltage regulation circuitry of each TheboardThe full isfull differently active active state state implemented of of the the MCUs MCUs and was wasit has realizedrealized different by energy putting efficiency. them them in in Therefore, an an endless endless the loop looppower using using supply a while a while looploopthrough programming programming the USB structure. ports structure. ensures For For an the the equal deep deep treatment sleepsleep modemo ofde the of three MCU MCU boards. state, state, we we used used the the minimum minimum possible possible programmingprogrammingThe full functions activefunctions state for eachforof the each one MCUs ofone the was MCUs.of realized the TheMCUs. by firmwareputting The themfirmware development in an endlessdevelopment was loop easily using was implemented a while easily usingimplementedloop the Cprogramming programming using thestructure. languageC programming For throughthe deep language twosleep popular mode through of integratedMCU two state, popular development we used integrated the minimum environments development possible (IDEs), namelyenvironmentsprogramming the Arduino (IDEs), functions IDE namely for for the the each Arduino, Arduino one ofandIDE the for the MCUs. th Mbede Arduino, forThe thefirmware and Nucleo the Mbeddevelopment and for the the FRDM Nucleo was respectively. easily and the FiguresFRDMimplemented 31 respectively. and 32 usingpresent Figures the the C programming particular31 and 32 codespresent language for the the throughparticular active two and codes popular deep for sleep theintegrated active modes anddevelopment of thedeep MCUs sleep for environments (IDEs), namely the Arduino IDE for the Arduino, and the Mbed for the Nucleo and the bothmodes IDEs. of the MCUs for both IDEs. FRDM respectively. Figures 31 and 32 present the particular codes for the active and deep sleep modes of the MCUs for both IDEs.

(a) (b) (a) (b) FigureFigure 31. 31.(a ()a Implementation) Implementation of of the the fullfull activeactive mode; mode; and, and, (b (b) )implementation implementation of of the the deep deep sleep sleep mode. mode. BothFigure implementations 31. (a) Implementation have been of theimplemented full active mode; using and, the (Arduinob) implementation IDE. of the deep sleep mode. BothBoth implementations implementations have have been been implemented implemented usingusing the Arduino Arduino IDE. IDE.

(a(a)) (b(b) )

FigureFigure 32. 32. (a )( aImplementation) Implementation of of the the fu fullll active active mode;mode; and,and, ( (bb)) implementation implementation of of the the deep deep sleep sleep mode. mode. Figure 32. (a) Implementation of the full active mode; and, (b) implementation of the deep sleep mode. BothBoth implementations implementations have have be beenen mae mae using using thethe Mbed IDE.IDE. Both implementations have been mae using the Mbed IDE.

TheThe results results of of the the current current measurements measurements are presented inin Table Table 4. 4. I faIfastands stands for for full full the the active active

current,Thecurrent, results Ids Istandsds stands of thefor for currentthe the current current measurements inin deepdeep sleepsleep are mode, presented whilewhile in ImcuImcu Tablestands stands4. for Iforfa thestands the maximum maximum for full current thecurrent active current,consumptionconsumptionIds stands of of the for the MCU the MCU current circuitry. circuitry. in deep AsAs revealed,revealed, sleep mode, the currentcurrent while consumptionconsumptionImcu stands due for due theto to the maximumthe operation operation currentof of consumptionvariousvarious auxiliary auxiliary of the circuitry MCUcircuitry circuitry. on on the the boards boards As revealed, (e.g.,(e.g., programming the current circuitry, circuitry, consumption sensors, sensors, dueLED LED toindicators, indicators, the operation etc.) etc.) of variousis ordersis orders auxiliary of ofmagnitude magnitude circuitry greater greater on the th th boardsanan thatthat (e.g., actuallyactually programming required forfor circuitry,operatingoperating sensors,the the MCU MCU LEDcircuitry. circuitry. indicators, Hence, Hence, etc.) the use of the existing open-source hardware mainboards is not suitable for battery-operated WSAN is ordersthe use ofof magnitudethe existing open-source greater than hardware that actually main requiredboards is fornot operatingsuitable for the battery-operated MCU circuitry. WSAN Hence, systems. On the other hand, following the abstraction concept of SensoTube architecture, more systems. On the other hand, following the abstraction concept of SensoTube architecture, more the useenergy of the efficient existing WSAN open-source systems can hardware be built. Figure mainboards 33 indicates is not how suitable much energy for battery-operated would be reserved WSAN energy efficient WSAN systems can be built. Figure 33 indicates how much energy would be reserved systems.if a MCU-based On the other expansion hand, following shield facilitated the abstraction just the MCU concept circuitry. of SensoTube architecture, more energy if a MCU-based expansion shield facilitated just the MCU circuitry. efficient WSAN systems can be built. Figure 33 indicates how much energy would be reserved if a MCU-based expansion shield facilitated just the MCU circuitry. Sensors 2016, 16, 1227 36 of 59

TableSensors 4. 2016Current, 16, 1227 measurements in full active and in deep sleep states of the MCU of three36 different of 59 popular open-source hardware platforms. Table 4. Current measurements in full active and in deep sleep states of the MCU of three different popular open-source hardware platforms. Platform Name Name Ifa (mA) Ids (mA) Imcu = (Ifa ´ Ids) (ma) ArduinoPlatform Uno Rev. Name 3 Brand Arduino Name Ifa (mA) 46.85Ids (mA) 33.17 Imcu = (Ifa − Ids13.68 ) (ma) NucleoArduino STM32L152 Uno Rev. 3 Arduino ST 46.85 56.95 33.17 50.24 13.68 6.71 FRDM-KL25ZNucleo STM32L152 Freescale/NXP ST 56.95 36.06 50.24 34.16 6.71 1.90 FRDM-KL25Z Freescale/NXP 36.06 34.16 1.90

Figure 33. Current consumption of the MCU circuitry (the green parts of pies) and current Figure 33. Current consumption of the MCU circuitry (the green parts of pies) and current consumption consumption of the auxiliary circuitry of three different open-source hardware platforms. of the auxiliary circuitry of three different open-source hardware platforms. 7.2. Development Steps of a Functional Expansion Shield 7.2. DevelopmentAs an Stepsexample of aof Functional designing a Expansion SensoTube-based Shield shield, we describe the considerations and the Asdevelopment an example steps of of designing a DCL functional a SensoTube-based shield. This shield shield, will be weused describe for agricultural the considerations applications. and For this reason, it will have the necessary circuitry for the interfacing with an external air the development steps of a DCL functional shield. This shield will be used for agricultural temperature/humidity sensor, and the circuitry for the interfacing with soil moisture sensors using applications.the SDI-12 For commercial this reason, standard it will have(a 1-wire the bus). necessary The specific circuitry development for the interfacingsteps are: with an external air temperature/humidity sensor, and the circuitry for the interfacing with soil moisture sensors using the (1) Creation of a new design project: Open a new design project in the electronic design application SDI-12 commercialsoftware standardtool (EDA tool), (a 1-wire adding bus). to this The the specific two sheet development symbols and stepstheir associated are: schematic files (see Figure 34). These drawing files contain the connections and parts regarding the (1) Creation of a new design project: Open a new design project in the electronic design application implementation of the S-BECs, the P-BEC, and the J-BEC ad they can be used as it is, without softwaremaking tool any (EDA change tool), or extra adding work. to this the two sheet symbols and their associated schematic files(2) (see Initiation Figure of the 34 new). Theseshield circuitry drawing design: files Create contain a new thesheet connections symbol for the and accommodation parts regarding of the implementationthe particular of circuits the S-BECs, of the DCL the shield. P-BEC, and the J-BEC ad they can be used as it is, without making(3) Consideration any change and or establishment extra work. of required signals: Create the sheet port entities reflecting the (2) Initiationparticular of the newsignal shield pins circuitryrequirements design: of theCreate specific a new DCL sheet shield. symbol Regarding for thethe accommodationtemperature/ of humidity sensor, we have used the popular DHT22 device. This sensor will be installed outside the particularof the system’s circuits enclosure of the and DCL will shield. interface with the DCL shield through two digital signal pins, (3) Considerationnamely the and clock establishment and the data. of This required sensor requires signals: aCreate +5 Vdc level the sheetpower portsupply. entities Regarding reflecting the the particularsoil signalmoisture pins sensors requirements interface, just of theone specific digital signal DCL pin shield. will be Regarding required according the temperature/humidity to the SDI- sensor,12 we bus. have Similarly, used thus the interface popular requires DHT22 +5 device. Vdc and Thisground sensor signals will from be the installed DCL shield. outside For of the system’sthe enclosureMCU of the and shield, will we interface decided withto use the an AVR DCL Atmega328 shield through due totwo the fact digital that signalit is the pins,basic namely MCU used by Arduino main-boards. After flashing the MCU with the Arduino bootloader the clockfirmware, and the the data.MCU will This act sensor as an Arduino requires main-board a +5 Vdc and level the developers power supply. can use Regarding the Arduino the soil moistureIDE sensors software interface, tool for the just application one digital firmware signal of pin the will shield. be required As Figure according 34 illustrates, to the on SDI-12the bus. Similarly,bottom thus left interface side of the requires DCL sheet +5 symbol, Vdc and five ground sheet ports signals have frombeen added, the DCL namely shield. the SDI-12, For the MCU of the shield,the TH_CLK we decided (DHT 22 toclock), use anthe AVRTH_DATA Atmega328 (DHT 22 due data), to theand fact+5 Vdc that and it isground the basic for both MCU used by Arduinointerfaces. main-boards. The rest of the After sheet’s flashing ports entities the MCU are the with remaining the Arduino available bootloader signals of the firmware, MCU the that can be routed to the S-BEC 1 in order to be exploited in various application scenarios. MCU will act as an Arduino main-board and the developers can use the Arduino IDE software (4) Making the power management decisions: The next step is to make the necessary connections for the tool forpower the application management firmwareof the DCL ofshield. the shield.For the particular As Figure shield, 34 illustrates, we connect on+5 Vdc the in bottom the P_Out left side of the DCLport sheet of the symbol, sheet symbol. five sheet With this ports option have the been shield added, can be namely monitored the and SDI-12, controlled the TH_CLKby other (DHT 22 clock),dedicated the TH_DATA shields (e.g., (DHT ETL shields) 22 data), in terms and of +5 its Vdc energy and consumption. ground for Alternatively, both interfaces. we create 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 Sensors 2016, 16, 1227 37 of 59

port of the sheet symbol. With this option the shield can be monitored and controlled by other

Sensorsdedicated 2016, 16, shields1227 (e.g., ETL shields) in terms of its energy consumption. Alternatively,37 we of 59 create the +5 Vdc and GND_5V sheet ports in order the shield to be able to be powered from the generic powerthe +5 signal Vdc and pins GND_5V of the S-BEC sheet ports 2. The in order aforementioned the shield to be ports able and to be connections powered from are the illustrated generic in Figurepower 34 .signal pins of the S-BEC 2. The aforementioned ports and connections are illustrated in Figure 34.

FigureFigure 34. 34.The The design design of of a a new new shield, shield, e.g.,e.g., the DCL DCL shield, shield, using using the the SensoTube SensoTube design design template. template.

(5) Considerations regarding the programming and debugging of the shield’s MCU: in our example, for the (5) Considerationsprogramming regarding and debugging the programming of the AVR and MCU debugging just the of theUART shield’s TX and MCU: RXin signal our example,pins are for therequired programming together and with debugging the Reset pin of of the the AVR MCU. MCU All of just these the signal UART pins TX have and been RX added signal to pins the are requiredsheet symbol together of the with DCL the shield Reset named pin of as the RXD, MCU. TXD, All and of these MCLR, signal respectively. pins have Additionally, been added the to the sheetSPI symbol signal pins of the which DCL are shield also present named in as the RXD, contemplated TXD, and MCLR,sheet can respectively. be used for the Additionally, in-system the SPIprogramming signal pins which of the AVR are also MCU. present The programming in the contemplated and debugging sheet circ canuitry, be used as proposed for the by in-system the programmingSensoTube architecture, of the AVR ought MCU. to The be hosted programming in a PDL and shield. debugging The sheet circuitry, symbol of as the proposed J-BEC has by the SensoTubeintentionally architecture, been left unconnected ought to be to hosted the DCL in ash PDLield’s shield. sheet symbol The sheet because symbol there of is the no J-BECuse of has intentionallyJTAG-based been programming left unconnected and debugging to the DCLin this shield’s shield. sheet symbol because there is no use of (6)JTAG-based Design of the programming schematic drawing and debugging of the shield’s in thiscircuitry shield.: the design is achieved following the datasheets of the incorporated components and the signal pins strategy decision made in the (6) Design of the schematic drawing of the shield’s circuitry: the design is achieved following the datasheets previous development steps. In the case of our design example, the DCL schematic drawing is ofgiven the incorporated in Figure 35. componentsIn this drawing and one the can signal notice pins the strategysheet port decision entities’ madenames inof the sheet previous developmentsymbol. steps. In the case of our design example, the DCL schematic drawing is given (7)in Figure Design 35of the. In printed-circuit this drawing board one can(PCB) notice of the the shield: sheet The port PCB entities’ design namesmust be of accomplished the sheet symbol. with (7) Designrespect of theto the printed-circuit proposed SensoTube board (PCB) PCB of model the shield: (seeThe Figures PCB 9 designand 10)must in order be accomplishedto maintain the with respectstandardization to the proposed of the form SensoTube factor and PCB encapsulation model (see aspects. Figures The9 and resulting 10) in DCL order shield to maintain is given the standardizationin Figure 36. The of theboard form is a factor regular and double-lay encapsulationer PCB. aspects.The connections The resulting among DCLthe components shield is given in Figuremade manually, 36. The board without is auto-rooting, a regular double-layer and it took PCB.few hours. The connectionsIn case of auto-routing, among the the components design madetask manually, could take without a few minutes. auto-rooting, and it took few hours. In case of auto-routing, the design (8)task Fabrication could take and a Testing few minutes. of the Shield: Figure 37 shows how the new DCL shield will look like after its fabrication. The fabrication of a regular double-sided PCB is very easy, very low-cost and it (8) Fabrication and Testing of the Shield: Figure 37 shows how the new DCL shield will look like after doesn’t require any pretentious processes. The green-colored screw terminal block placed on the itsbottom fabrication. left of The the fabrication shield (see of Figure a regular 37) double-sidedhelps the physical PCB connections is very easy, with very the low-cost external and it doesn’ttemperature/humidity require any pretentious sensor and processes. the SDI-12 The bus green-coloredsoil moisture sensors. screw terminal block placed on the bottom left of the shield (see Figure 37) helps the physical connections with the external temperature/humidity sensor and the SDI-12 bus soil moisture sensors.

Sensors 2016, 16, 1227 38 of 59 Sensors 2016, 16, 1227 38 of 59 Sensors 2016, 16, 1227 38 of 59

Figure 35. The schematic drawing of a DCL shield’s circuitry, based on an AVR ATmega328 < CU, Figureand supporting 35.35. TheThe schematicschematic the functionsdrawing drawing of the of of ainterfacing a DCL DCL shield’s shield’s to digital circuitry, circuitry, temperature/humidi based based on on an AVRan AVRty ATmega328 sensors ATmega328 such < as CU,

Figure 36. The PCB of the new DCL shield.

Figure 36. The PCB of the new DCL shield.

Sensors 2016, 16, 1227 39 of 59 Sensors 2016, 16, 1227 39 of 59

FigureFigure 37. 37. AA realistic realistic representation representation of the fabricated new DCL shield.

The two blue-colored shorting jumpers at the top left side of the board connect the I2C-bus The two blue-colored shorting jumpers at the top left side of the board connect the I2C-bus signals signals of the MCU to the I2C-bus signals of the system’s common BECs in order to allow the intra- of the MCU to the I2C-bus signals of the system’s common BECs in order to allow the intra-shields shields communication. Additionally, plain dual-pin headers have been soldered to the rest of the communication. Additionally, plain dual-pin headers have been soldered to the rest of the pads rows pads rows nearby the stacking pass-through headers of the S-BEC 1 and S-BEC 2 in order to nearby the stacking pass-through headers of the S-BEC 1 and S-BEC 2 in order to selectively connect selectively connect the general signals of the MCU to the common BECs signals of the system. the general signals of the MCU to the common BECs signals of the system.

7.3. Decoupling Decoupling from the Programming and Debugging Function The biggest portion of the energy wastage demonstrat demonstrateded in the beginning of this section, is due to the the programming programming and and debugging debugging circuitry. circuitry. Accord Accordinging to to the the SensoTube SensoTube architecture, architecture, this this circuitry circuitry should be decoupled from from the WSAN system thro throughugh its its implementation in in the the form form of of a PDL functional shield. shield. As As a a proof proof of of the the proposed proposed concep concept,t, we we take take the the case case of of Arduino Arduino Uno Uno Rev. Rev. 3 as 3 as a usea use case. case. We We took took the the schematic schematic file file of of this this specif specificic board board from from the the original original webpage webpage of of Arduino Arduino and we broken ιt down into three parts: the the MCU MCU circuitry circuitry (Figure (Figure 38);38); the the programming programming and debugging circuitry (Figure 3939);); and, the power management circuitry (Figure(Figure 4040).). The programming and debugging of the MCU of the Arduino Arduino Uno Rev. Rev. 3 is performed through the UART’s TXDTXD andand RXDRXD signalsignal pinspins (see (see Figures Figures 38 38 and and 39 39).). The The SensoTube SensoTube facilitates facilitates the the routing routing of ofthese these two two signals signals through through the the pins pins of of the the S-BEC1. S-BEC1. Thus, Thus, it isit veryis very easy easy to to decouple decouple the the circuitries circuitries of ofthe the MCU MCU and and the programmingthe programming and debugging and debugging which canwhich be realizedcan be realized in form ofin separated form of functionalseparated functionalshields. On shields. the other On hand, the as other it can hand, be seen as in it Figure can 40be, theseen circuitry in Figure of power 40, the management circuitry isof devotedpower managementjust to regulate is thedevoted external just supply to regulate voltage the and external serve supply power tovoltage the MCU and circuitry.serve power According to the toMCU the circuitry.SensoTube According concept, the to power the SensoTube management concept, circuitry the can bepower also decoupledmanagement from circuitry the main-board can be and also to decoupledbe accommodated from the onto main-board a PML functional and to be shield. accommoda In this way,ted onto there a isPML also functional the opportunity shield. to In make this way, such theredesign is optionsalso the so opportunity as to satisfy to the make forecasted such design energy options supply so of as all to of satisfy the expansion the forecasted shields energy of the supply system. of allAmong of the expansion the most shields significant of the advantages system. of the proposed functions decoupling there are the dramaticAmong reduction the most of energysignificant consumption advantages at the of functionalthe proposed MCU-based functions shield decoupling and the there reusability are the of dramaticexpansion reduction shields due of toenergy their consumption austere implementation. at the functional At the MCU-based same time there shield are and also the advantages reusability in ofterms expansion of the cost shields of the due decoupled to their austere implementations. implementa Belowtion. At we the show same Tables time5 –there7 with are the also part-numbers, advantages indescriptions terms of the and cost prices of the of thedecoupled components implementations. used in the aforementionedBelow we show threeTables Arduino 5–7 with Uno the Rev. part- 3 numbers,circuits. The descriptions prices are and based prices on of unit the costs, componen and theyts used taken in the from aforementioned the Mouser Electronics’ three Arduino webpage Uno Rev.(www.mouser.com). 3 circuits. The prices are based on unit costs, and they taken from the Mouser Electronics’ webpage (www.mouser.com).

Sensors 2016, 16, 1227 40 of 59 Sensors 2016, 16, 1227 40 of 59

Sensors 2016, 16, 1227 40 of 59

Figure 38. The MCU circuitry of the Arduino Uno Rev. 3. Figure 38. The MCU circuitry of the Arduino Uno Rev. 3. Figure 38. The MCU circuitry of the Arduino Uno Rev. 3.

Figure 39. The programming and debugging circuitry of the Arduino Uno Rev. 3. FigureFigure 39. 39. TheThe programming programming and and debugging debugging circ circuitryuitry of the Arduino Uno Rev. 3.3.

Sensors 2016, 16, 1227 41 of 59 Sensors 2016, 16, 1227 41 of 59

Figure 40. The power management circuitry of Arduino Uno Rev. 3. Figure 40. The power management circuitry of Arduino Uno Rev. 3. Table 5. The parts list of the MCU circuitry of Arduino Uno Rev. 3. Table 5. The parts list of the MCU circuitry of Arduino Uno Rev. 3. # Component Description Qty Part Number Manufacturer Cost (euros) 1 C4 Capacitor 1 CC0603KRX7R9BB104 Yageo 0.091 # Component Description Qty Part Number Manufacturer Cost (euros) 2 C6 Capacitor 1 CC0603KRX7R9BB104 Yageo 0.091 13 28 pins C4IC Socket Connector Capacitor 1 1 CC0603KRX7R9BB104 1-390261-9 TE ConnYageo 0.1 0.091 24 6 pins Header C6 Fem. Connector Capacitor 1 1 CC0603KRX7R9BB104 5-534237-4 TE ConnYageo 1.08 0.091 35 10 28 pins pins Header IC Socket Fem. Connector Connector 1 1 M20-7821046 1-390261-9 Harwin TE Conn 0.73 0.1 46 6 8 pinspins HeaderHeader Fem. Connector Connector 1 1 M20-7820842 5-534237-4 Harwin TE Conn 0.996 1.08 5 10 pins Header Fem. Connector 1 M20-7821046 Harwin 0.73 7 8 pins Header Fem. Connector 1 M20-7820842 Harwin 0.996 6 8 pins Header Fem. Connector 1 M20-7820842 Harwin 0.996 8 XTAL1 Crystal 1 ABL-16.000MHZ-B2 Abracon 0.357 7 8 pins Header Fem. Connector 1 M20-7820842 Harwin 0.996 89 XTAL1D2 Crystal Diode 1 1CD1206-S01575 ABL-16.000MHZ-B2 Bourns Abracon 0.142 0.357 910 ZU4 D2 Diode IC 1 1ATMEGA328P-PU CD1206-S01575 Atmel Bourns 3.35 0.142 1011 ZU4RN3 Resistor IC 1 1CAY16-220J4LF ATMEGA328P-PU Bourns Atmel 0.095 3.35 1112 RESET RN3 Resistor Switch 1 1TS42031-160R-TR-7260 CAY16-220J4LF Omron Bourns 0.317 0.095 12 RESET Switch 1 TS42031-160R-TR-7260 Total:Omron 8.345 euros 0.317 Total: 8.345 euros Table 6. The parts list of the programming and debugging circuitry of Arduino Uno Rev. 3.

Table# 6.ComponentThe parts list Description of the programming Qty and Part Number debugging circuitry Manufacturer of Arduino CostUno (euros) Rev. 3. 1 C7 Capacitor 1 CC0603KRX7R9BB104 Yageo 0.091 #2 ComponentC5 Description Capacitor 1 Qty CC0603KRX7R9BB104 Part Number ManufacturerYageo Cost 0.091 (euros) 3 C8 Capacitor 1 GRM188R60J105KA01D Murata 0.091 14 C11 C7 Capacitor Capacitor 1 1500R14N220JV4T CC0603KRX7R9BB104 Johanson Yageo 0.091 0.091 2 C5 Capacitor 1 CC0603KRX7R9BB104 Yageo 0.091 5 C9 Capacitor 1 500R14N220JV4T Johanson 0.091 3 C8 Capacitor 1 GRM188R60J105KA01D Murata 0.091 6 ICSP1 Connector 1 67996-406HLF FCI 0.244 4 C11 Capacitor 1 500R14N220JV4T Johanson 0.091 7 ICSP Connector 1 67996-406HLF FCI 0.244 5 C9 Capacitor 1 500R14N220JV4T Johanson 0.091 68 ICSP1X2 Connector Connector 1 1USB-B1HSW6 67996-406HLF On Shore FCI 0.58 0.244 79 ICSPXT1 Connector Crystal 1 1CSTCE16M0V53-R0 67996-406HLF Murata FCI 0.416 0.244 108 D3 X2 Connector Diode 1 1 CD1206-S01575 USB-B1HSW6 Bourns On Shore 0.142 0.58 119 XT1L1 FerriteCrystal 1 1BLM21PG221SN1D CSTCE16M0V53-R0 Murata Murata 0.1 0.416 1012 U3 D3 Diode IC 1 1ATMEGA16U2-MUR CD1206-S01575 Atmel Bourns 3.93 0.142 1113 RX L1 Ferrite LED 1 1 BLM21PG221SN1D APT2012YC Kingbright Murata 0.119 0.1 1214 TX U3 LED IC 1 1 ATMEGA16U2-MUR APT2012YC Kingbright Atmel 0.119 3.93 1315 F1 RX PTC LED 1 1 MF-MSMF050-2 APT2012YC Bourns Kingbright 0.208 0.119 1416 R1 TX Resistor LED 1 1ERJ-3GEYJ105V APT2012YC Panasonic Kingbright 0.091 0.119 1517 R2 F1 Resistor PTC 1 1ERJ-3GEYJ105V MF-MSMF050-2 Panasonic Bourns 0.091 0.208 1618 RN4 R1 Resistor Resistor 1 1 CAY16-102J4LF ERJ-3GEYJ105V Bourns Panasonic 0.095 0.091 17 R2 Resistor 1 ERJ-3GEYJ105V Panasonic 0.091 19 Z1 Varistor 1 CG0603MLC-05E Bourns 0.18 18 RN4 Resistor 1 CAY16-102J4LF Bourns 0.095 20 Z2 Varistor 1 CG0603MLC-05E Bourns 0.18 19 Z1 Varistor 1 CG0603MLC-05E Bourns 0.18 20 Z2 Varistor 1 CG0603MLC-05E Total: Bourns 7.194 euros 0.18 Total: 7.194 euros

Sensors 2016, 16, 1227 42 of 59

Table 7. The parts list of the power management circuitry of Arduino Uno Rev. 3.

# Component Description Qty Part Number Manufacturer Cost (euros) Sensors 2016, 16, 1227 42 of 59 1 C1 Capacitor 1 CC0603KRX7R9BB104 Yageo 0.091 2 C2 Capacitor 1 CC0603KRX7R9BB104 Yageo 0.091 3Table C3 7. The parts Capacitor list of the power 1 management GRM188R60J105KA01D circuitry of Arduino Murata Uno Rev. 3. 0.091 United 4# Component PC1 Description Capacitor Qty 1 EMVA250ADA470MF55G Part Number Manufacturer Cost (euros)0.32 Chemi-Con 1 C1 Capacitor 1 CC0603KRX7R9BB104 Yageo 0.091 United 52 PC2C2 Capacitor Capacitor 1 1 CC0603KRX7R9BB104EMVA250ADA470MF55G Yageo 0.0910.32 Chemi-Con 3 C3 Capacitor 1 GRM188R60J105KA01D Murata 0.091 6 X1 Connector 1 PJ-102AH CUI Inc 1.08 4 PC1 Capacitor 1 EMVA250ADA470MF55G United Chemi-Con 0.32 7 D1 Diode 1 S2M-13-F Diodes Inc. 0.311 5 PC2 Capacitor 1 EMVA250ADA470MF55G United Chemi-Con 0.32 86 U1X1 Connector IC 1 1 PJ-102AH NCP1117ST50T3G CUI On Inc Semi 1.08 0.398 97 U2D1 Diode IC 1 1 S2M-13-F LP2985-33DBVR Diodes Inc. TI 0.311 0.498 108 U5U1 IC IC 1 1NCP1117ST50T3G LMV358IDGKR On Semi TI 0.398 0.67 119 U2 L LED IC 1 1LP2985-33DBVR APT2012YC Kingbright TI 0.498 0.119 1210 ONU5 LED IC 1 1 LMV358IDGKR LG R971-KN-1 TI OSRAM 0.67 0.22 1311 RN1L Resistor LED 1 1 APT2012YC CAY16-103J4LF Kingbright Bourns 0.119 0.095 1412 RN2ON Resistor LED 1 1 LG R971-KN-1 CAY16-102J4LF OSRAM Bourns 0.22 0.095 1513 RN1 T1 Transistor Resistor 1 1 CAY16-103J4LF FDN340P Bourns Fairchild 0.095 0.338 14 RN2 Resistor 1 CAY16-102J4LF BournsTotal: 0.0954.737 euros 15 T1 Transistor 1 FDN340P Fairchild 0.338 Total: 4.737 euros The sub-total costs from the tables above are analyzed in Figure 41, where it is explicitly revealed that the costThe of ansub-total Arduino costs MCU-based from the tables shield above couldare analyzed be just in theFigure 41.16% 41, where of the it is total explicitly cost revealed of the Arduino that the cost of an Arduino MCU-based shield could be just the 41.16% of the total cost of the Arduino Uno Rev. 3. Thus the proposed decoupling of programming and debugging function from the Uno Rev. 3. Thus the proposed decoupling of programming and debugging function from the main- main-boardboard can can result to to lower lower in incost cost implementations. implementations. This is very This critical is very in criticalthe case inof middle the case and of large- middle and large-scalescale WSAN WSAN deployments in inagriculture agriculture wher wheree significant significant cost savings cost can savings occur. can occur.

Figure 41. The sub-total costs of the MCU, programming and debugging, and power management Figure 41. The sub-total costs of the MCU, programming and debugging, and power management circuitries as percentages to the final cost of Arduino Uno Rev. 3. circuitries as percentages to the final cost of Arduino Uno Rev. 3. 7.4. Design and Development Support of Multi-MCU Systems 7.4. Design and Development Support of Multi-MCU Systems The SensoTube architecture provides the maximum possible support for the multi-MCU Thefunctional SensoTube shields architecture as it described provides in Section the maximum4. In particular: possible support for the multi-MCU functional shields as itIt described provides a in plethora Section of4. Incommunication particular: peripheral signals through the S-BECs, e.g., three UARTs, SPI-bus with two distinct enable pins, I2C-bus, etc., which can meet the requirements of ‚ It providesmany a MCU-based plethora of expansion communication shields; peripheral signals through the S-BECs, e.g., three UARTs, SPI-bus It withprovides two four distinct interrupt enable signals pins, to support I2C-bus, multi-MCU etc., which collaborative can meet application the requirements scenarios and of many MCU-basedfunctions expansion such as wake shields; up from deep sleep modes; ‚ It provides It provides fourinterrupt BEC signal signals rerouting to or support isolation multi-MCU mechanisms collaborativeat each functional application shield in order scenarios to and functionsavoid such signal as wakeconflicts; up from deep sleep modes;  It provides a variety of scalable power management configurations; ‚ It provides It particularly BEC signal supports rerouting 16-bit and or isolation32-bit MCUs mechanisms, such as MSP430 at each and functionalARM cores by shield reserving in order to avoid signalspecific conflicts; signal BEC pins for Spy-Bi-Wire (SBW), Serial Wire Debugging (SWD) and JTAG ‚ It providescompatible a variety cores; of and, scalable power management configurations; ‚ It particularly supports 16-bit and 32-bit MCUs, such as MSP430 and ARM cores by reserving specific signal BEC pins for Spy-Bi-Wire (SBW), Serial Wire Debugging (SWD) and JTAG compatible cores; and, Sensors 2016, 16, 1227 43 of 59

Sensors 2016, 16, 1227 43 of 59 ‚ It supports the programming and debugging of multiple MCU-based shields through flexible, energy It supports efficient, the and programming cost effective and combinations. debugging of multiple MCU-based shields through flexible, energy efficient, and cost effective combinations. Regarding the programming and debugging of multiple MCUs in the same system we show Regarding the programming and debugging of multiple MCUs in the same system we show two use cases. In the first use case we have three functional shields which have an Arduino MCU two use cases. In the first use case we have three functional shields which have an Arduino MCU on- on-board (namely an AVR MCU from Atmel). To ensure a concurrent firmware development, board (namely an AVR MCU from Atmel). To ensure a concurrent firmware development, programmingprogramming and and debugging debugging of the of threethe three MCUs MCUs we have weplug-in have pl threeug-in Programming three Programming and Debugging and LayerDebugging (PDL) shields. Layer (PDL) Each oneshields. of these Each PDL one shieldsof these hasPDL a shields circuit identicalhas a circuit or similaridentical to or that similar illustrated to in Figurethat illustrated 39 (programming in Figure 39 and (programming debugging and circuit debugging of Arduino circuit Uno of Arduino Rev. 3) Uno and Rev. it can 3) beand connected it can via abe USB connected port to via a personala USB port computer. to a personal In the comp personaluter. In computer the personal there computer are three there instances are three of the Arduinoinstances IDE, of onethe Arduino per MCU IDE, of one the per contemplated MCU of the system.contemplated In Figure system. 42 In we Figure show 42 the we exactshow signalsthe connectionsexact signals among connections the aforementioned among the aforementioned expansion shields. expansion Dotted shields. lines indicateDotted lines the internalindicate the signals connectionsinternal signals through connections the shared through BECs the of shared the system. BECs of In the cases system. where In therecases where is no needthere ofis no concurrent need firmwareof concurrent development firmware and development testing, then and just testing, one then PDL just shield one isPDL enough. shield is Specifically, enough. Specifically, through the signalsthrough rerouting the signals mechanism rerouting provided mechanism by provided SensoTube, by SensoTube, the RXD the and RXD TXD and signals TXD signals pins of pins the of PDL the PDL should be rerouted to the associated signals pins of the functional shield. In either case, when should be rerouted to the associated signals pins of the functional shield. In either case, when the the programming and debugging is completed, then the PDL(s) can be totally removed from the programming and debugging is completed, then the PDL(s) can be totally removed from the system. system.

FigureFigure 42. 42.Concurrent Concurrent firmware firmware development, development, progra programmingmming and debugging and debugging of three Arduino of three MCU- Arduino MCU-basedbased functional functional shields. shields.

A second use case includes several functional shields which have an ARM-core MCU on-boards. InA this second case, useas it caseis shown includes in Figure several 43, only functional one PDL shields shield which is required have for an the ARM-core programming MCU and on-boards. the In thisdebugging case, as of it isall shownthe MCUs. in Figure 43, only one PDL shield is required for the programming and the debuggingThis of is all achieved the MCUs. by exploiting the function of the JTAG scan chain. The PDL shield through its JTAGThis signals is achieved pins which by exploiting occupy in the S-BEC2 function and in of the the J-BEC, JTAG is scan connected chain. to The JTAG PDL probe shield (e.g., through the I- its JTAGJET signals from IAR) pins and which via this occupy probe inis interfacing S-BEC2 and with in the the personal J-BEC, iscomputer. connected In the to personal JTAG probe computer (e.g., the I-JETany from one IAR) of the and popular via this IDEs probe can be is interfacingused for the withfirmware the personal development. computer. In the Inuse the case personal we chose computer the anyEmbedded one of the Workbench popular IDEs from can IAR. be usedThis use for thecase firmwareparticularly development. demonstrates In the the novelty use case of the we J-BEC chose the Embeddedwhich actually Workbench acts as frompass-through IAR. This BEC use but case in prac particularlytice it is comprised demonstrates by two the distinct novelty pin of headers the J-BEC (one female on the top side and one male on the bottom side of the board—see Section 4). Of course, which actually acts as pass-through BEC but in practice it is comprised by two distinct pin headers the above use cases are just an indication of the real capabilities of SensoTube for multi-MCU support. (one female on the top side and one male on the bottom side of the board—see Section4). Of course, For instance, a system could comprise any number of different types of MCUs, e.g., Arduino MCUs, the above use cases are just an indication of the real capabilities of SensoTube for multi-MCU support. For instance, a system could comprise any number of different types of MCUs, e.g., Arduino MCUs, ARM-core MCUs, MSP430 MCUs, etc., which through the use of single or several PDL shields could SensorsSensors2016 ,201616,, 1227 16, 1227 44 of44 59 of 59

ARM-core MCUs, MSP430 MCUs, etc., which through the use of single or several PDL shields could be in-systembe in-system programmed programmed and and debugged. debugged. SuchSuch a PDL shield shield which which can can support support AVR, AVR, MSP430, MSP430, and and ARM-coreARM-core MCUs MCUs is presentedis presented in in the the following following sub-section.sub-section.

FigureFigure 43. 43.Schematic Schematic drawing drawing of of the the CC430F5137 CC430F5137 SoC showin showingg the the specific specific signal signal names names and and required required circuitscircuits for thefor the MCU MCU (MSP430) (MSP430) component component of of thethe chip.chip.

7.5. Design and Implementation of a PDL Shield 7.5. Design and Implementation of a PDL Shield The aim of this design was to create a single shield which could accommodate, firstly, the various typesThe aimof JTAG of this connectors design was for to the create most a popular single shield MCUs, which and couldsecondly accommodate, the MCUs used firstly, in thevarious various typesArduino of JTAG main-boards, connectors forsuch the as mostthe AVR popular Atmega328 MCUs, which and secondly is mentioned the MCUsin the previous used in varioussub-sections. Arduino main-boards,Table 8 presents such asthe the four AVR different Atmega328 types of whichJTAG co isnnectors mentioned that inwere the decided previous to incorporate sub-sections. in this Table 8 presentsPDL shield. the four Therefore, different this types PDL ofcould JTAG be used connectors to program that and were debug decided any ARM, to incorporate ARM-Cortex, in thisAVR PDL shield.(using Therefore, Atmel’s thisJTAG PDL tools), could and be MSP430 used toMCUs program (from and Texas debug Instrume anynts), ARM, which ARM-Cortex, may exist at AVR any (usingof Atmel’sthe SensoTube JTAG tools), functional and MSP430 layer shields. MCUs The (from first colu Texasmn Instruments),of the Table 8 gives which the mayspecific exist names at any of the of the SensoTubeaforementioned functional JTAG layer headers shields. during The the first design column of the of PCB the of Table this PDL8 gives shield. the specific names of the aforementioned JTAG headers during the design of the PCB of this PDL shield. Table 8. The PDL shield’s four different JTAG connectors for the programming and debugging of the most popular MCUs for WSAN nodes. Table 8. The PDL shield’s four different JTAG connectors for the programming and debugging of the most popularName MCUs forDescription WSAN nodes. Number of Pins Supported MCUs/CPUs P14 JTAG ARM 20 (2 × 10) ARM, ARM-Cortex P12Name MSP430 Description JTAG Number 14 (2 × of7) Pins Supported MSP430 MCUs/CPUs P15 AVR JTAG ICE mkII 10 (2 × 5) ATMEL AVR MCUs ˆ P13P14 JTAG JTAG Spy-Bi-Wire ARM 20 5 (1 (2 × 5)10) ARM, MSP430 ARM-Cortex MCUs P12 MSP430 JTAG 14 (2 ˆ 7) MSP430 P15 AVR JTAG ICE mkII 10 (2 ˆ 5) ATMEL AVR MCUs The implementation of the PDL shield was based on the design template which was explained P13 JTAG Spy-Bi-Wire 5 (1 ˆ 5) MSP430 MCUs in Sections 4 and 7.2. The sheet symbol of the circuitry of the new PDL shield is shown in the middle of the Figure 44. As it is depicted, the sheet port entities created in this sheet symbol are relevant to The implementation of the PDL shield was based on the design template which was explained in Sections4 and 7.2. The sheet symbol of the circuitry of the new PDL shield is shown in the middle of the Figure 44. As it is depicted, the sheet port entities created in this sheet symbol are relevant to Sensors 2016,, 16, 1227 4545 of of 59 59 the UART, the SPI and the JTAG signals. Additionally, for extra reconfigurability, the UART TX and the UART, the SPI and the JTAG signals. Additionally, for extra reconfigurability, the UART TX and RX signals of the shield have been also routed to the other two pairs of UARTs which are present to RX signals of the shield have been also routed to the other two pairs of UARTs which are present to the stacking BECs of the S-BEC 1. In the case of this PDL there is no power monitoring requirements, the stacking BECs of the S-BEC 1. In the case of this PDL there is no power monitoring requirements, that’s why the P-BEC mechanism is not connected to the sheet symbol of the shield’s circuitry. that’s why the P-BEC mechanism is not connected to the sheet symbol of the shield’s circuitry. The schematic drawing of the shield’s circuitry is given in Figure 45. Obviously, a MCU does The schematic drawing of the shield’s circuitry is given in Figure 45. Obviously, a MCU does not need to be present in this PDL shield. Some extra pin-headers were added, in order to ensure that not need to be present in this PDL shield. Some extra pin-headers were added, in order to ensure the target processors could be powered either from the external JTAG devices or from its own that the target processors could be powered either from the external JTAG devices or from its own system’s voltage source. Furthermore, pin 19 of the JTAG ARM connector was handled in order to be system’s voltage source. Furthermore, pin 19 of the JTAG ARM connector was handled in order to be driven either at logic high (+5 Vdc) or low (0 Vdc, i.e., GND). This facilitates the challenging technique driven either at logic high (+5 Vdc) or low (0 Vdc, i.e., GND). This facilitates the challenging technique of power profiling, or else power debugging, which is supported by the IAR JTAG debuggers [133]. of power profiling, or else power debugging, which is supported by the IAR JTAG debuggers [133]. In parallel with the JTAG facilities, this PDL shield could also support the use of other development In parallel with the JTAG facilities, this PDL shield could also support the use of other development hardware tools that may use the I2C-bus, or SPI-bus, or even the UART port. The signals of these hardware tools that may use the I2C-bus, or SPI-bus, or even the UART port. The signals of these interfaces already exist in the S-BECs connectors. The circuitry incorporates a UART-to-USB interfaces already exist in the S-BECs connectors. The circuitry incorporates a UART-to-USB converter converter chip, i.e., the CP2102 from Silicon Labs, which can be used to program AVR MCUs which chip, i.e., the CP2102 from Silicon Labs, which can be used to program AVR MCUs which they primarily they primarily flashed with the Arduino bootloader. Alternatively, this converter can be occasionally flashed with the Arduino bootloader. Alternatively, this converter can be occasionally connected to connected to one of the three UARTs of the system pins in order to allow a shield to interface with a one of the three UARTs of the system pins in order to allow a shield to interface with a personal personal computer. This facility is very convenient during the system’s firmware development computer. This facility is very convenient during the system’s firmware development processes. processes.

Figure 44. Using the design template of SensoTube towards the design of a new PDL shield with Figure 44. Using the design template of SensoTube towards the design of a new PDL shield with support to Arduino main-boards’ MCUs and JTAG-enable MCUs. support to Arduino main-boards’ MCUs and JTAG-enable MCUs.

Sensors 2016, 16, 1227 46 of 59

Sensors 2016, 16, 1227 46 of 59

Figure 45. Schematic drawing of the new PDL shield’s circuitry. Figure 45. Schematic drawing of the new PDL shield’s circuitry. The final PCB design of this shield is presented in Figure 46. The semicircular cut at the top side of theThe board final PCBwas intentionally design of this made shield in order is presented to allow in any Figure external 46. Theantenna semicircular that may cutexist at in the a WNL top side ofshield, the board under was the intentionally PDL shield. The made name in orderPelti was toallow given anyin this external board, antennainspired by that the may shape exist of ancient in a WNL Greek archers’ shields. The PCB was designed as a double-layer board. All the S-BEC signals have shield, under the PDL shield. The name Pelti was given in this board, inspired by the shape of ancient been routed to screw terminal blocks for easy access to them during the development phase. Also, Greek archers’ shields. The PCB was designed as a double-layer board. All the S-BEC signals have due to the fact that a PDL shield is always placed at the top of the shields’ synthesis in order to allow been routed to screw terminal blocks for easy access to them during the development phase. Also, due the easy insertion of the programming and debugging connectors, there is no need to place the P- to the fact that a PDL shield is always placed at the top of the shields’ synthesis in order to allow the BEC and the top part of the J-BEC. easy insertion of the programming and debugging connectors, there is no need to place the P-BEC and The Pelti PDL shield, after the manufacture of its PCB and the insertion of its components, is theillustrated top part ofin theFigure J-BEC. 47. Figure 48 shows the PDL shield connected to a WNL shield in order to programThe Pelti and PDL debug shield, the CC430F5137 after the manufacture MCU of the ofWN itsL PCBshield and through the insertion the MSP-FET430UIF of its components, tool of is illustratedTexas Instruments. in Figure 47. Figure 48 shows the PDL shield connected to a WNL shield in order to program and debug the CC430F5137 MCU of the WNL shield through the MSP-FET430UIF tool of Texas Instruments.

Sensors 2016, 16, 1227 47 of 59 Sensors 2016, 16, 1227 47 of 59 Sensors 2016, 16, 1227 47 of 59

Sensors 2016, 16, 1227 47 of 59

FigureFigure 46. 46.Design Design of of the the PCB PCB of of the the Pelti Pelti PDLPDL shield.shield. It is is a a double-layer double-layer board. board. The The red red color color denotes denotes Figure 46. Design of the PCB of the Pelti PDL shield. It is a double-layer board. The red color denotes thethe top top layer layer and and the the blue blue color color denotes denotes thethe bottombottom la layeryer respectively. respectively. At At the the bottom bottom side side of ofthe the board board therethe top is layera USB and type the B blueconnector color denotesfor the connection the bottom withlayer a respectively. personal computer. At the bottom side of the board therethere is ais USB a USB type type B connectorB connector for for the the connection connection withwith a personal computer. computer.

Figure 46. Design of the PCB of the Pelti PDL shield. It is a double-layer board. The red color denotes the top layer and the blue color denotes the bottom layer respectively. At the bottom side of the board there is a USB type B connector for the connection with a personal computer.

Figure 47. The PDL shield, named as Pelti, with JTAG connectors, USB connector, and screw-type Figure 47. The PDL shield, named as Pelti, with JTAG connectors, USB connector, and screw-type Figureterminal 47. Theblocks PDL connected shield, to named all of the as Pelti,S-BECs with signals. JTAG connectors, USB connector, and screw-type terminalFigure blocks 47. Theconnected PDL shield, to all named of the as S-BECs Pelti, with signals. JTAG connectors, USB connector, and screw-type terminal blocks connected to all of the S-BECs signals. terminal blocks connected to all of the S-BECs signals.

Figure 48. Programming and debugging setup using the MSP-FET430UIF tool from Texas FigureFigure 48. 48.Programming Programming and debuggingand debugging setup setup using theusin MSP-FET430UIFg the MSP-FET430UIF tool from tool Texas from Instruments. Texas FigureInstruments. 48. Programming The PDL shield and isdebugging connected onto setup the WNLusin gshield the throughMSP-FET430UIF the S-BECs andtool J-BEC from for Texas TheInstruments.Instruments. PDLeasy shield access The isTheconnected to PDLPDL the required shieldshield onto isJTAGis theconnected signal WNL pins. shieldonto the through WNL theshield S-BECs throughthrough and thethe J-BEC S-BECsS-BECs foreasy andand accessJ-BECJ-BEC for toforthe requiredeasyeasy accessaccess JTAG toto signal thethe requiredrequired pins. JTAG signal pins.

Sensors 2016, 16, 1227 48 of 59

8. Cost Implications The SensoTube architecture can significantly influence the cost associated with the most critical aspects of a WSAN application. Both direct and indirect costs can be decreased. The benefits from the reduction of costs can be found in the following three areas of interest:

(1) Cost reduction at the development phase: The use of comprehensive functional building blocks, in order to build a WSAN system can reduce the traditionally long development periods, especially in the cases where diverse expertise and skills are required. Thus, the labor cost is decreased and the time-to-market could be shortened too. Towards this direction, the ability of SensoTube to allow designers to use established as well as new innovative tool chains can also help. Moreover, the decomposition of the system into its functions, which are implemented in the form of independent shields, can enable the reduction of the NRE costs associated with the development of the prototype systems because the changes in design can be focused just on particular system’s parts. (2) Cost reduction at the systems level: The increased flexibility, reconfigurability, and reusability ensured by the proposed architecture can positively influence the system’s total cost. In particular, the introduction of centralized provisions for the power supply and the programming and debugging, can release hardware subsystems from integrating superfluous circuits. On the other hand, the ability to add and remove functional building blocks can increase the value of the investment during the lifetime of the application, because any future change can be limited just to the purchase of a single expandable shield and avoid the need to change the whole system. Additionally, the adoption of the plastic PVC tubes for the final encapsulation of the system, instead of special expensive electrical boxes, can help to minimize the cost per WSAN node. (3) Cost reduction at the application domain: A serious problem in the agricultural domain is the theft of the WSAN nodes due to their metallic support poles which can be sold for scrap. This can be prevented by the proposed plastic tubes-based encapsulation, which is simultaneously used as the support pole of the system. Moreover, the proposed approach can significantly help the handling and transportation of the WSAN nodes due to the reduction of the systems weight.

9. Discussion and Conclusions A new architecture for hardware design of WSAN systems was presented in this work. The aims of the SensoTube architecture, as defined in Section3, have been rather successfully met. The existing end-solutions and COTS-based WSAN systems in their vast majority have been designed based on the traditional architecture (see Section1, Figure1), which basically places the emphasis entirely on the wireless networking aspects. This is reasonably explained by the fact that a decade ago the WSAN technology was very new and the efforts had to be diverted towards the design of hardware, which would primarily support the development, the evaluation and the demonstration of that revolutionary technology. Nowadays, when WSANs can be considered as a mature technology and the interest has shifted from the core technology to its embodiment in real-world applications, the rigidity of the traditional architecture appears to constitute a significant barrier for the expansion of WSAN solutions. The abstraction of the SensoTube architecture provides the necessary design framework with which the real needs of a WSAN system can be accommodated, so each functional aspect of the system can have a clear, predefined space, in order to be tidily implemented without, at the same time, conflicting with other functions of the system. In particular, the seven functional layers proposed are: the data acquisition and control layer (DCL), the wireless networking layer (WNL), the data gateway layer (DGL), the application-specific layer (ASL); the programming and debugging layer (PDL), the power management layer (PML), the evaluation and testing layer (ETL). Thus, the hardware designers, as well as the developers of different specializations, can know in advance how to jump into the WSANs field and at which particular function their design contribution belongs to. Hence, the proposed Sensors 2016, 16, 1227 49 of 59 functional abstraction can support the integration of several challenging technologies that could potentially have a positive impact on the design of real-world application-oriented WSAN systems. Regarding the practical side of the hardware design, the seven SensoTube functional layers’ ability to be realized in the form of discrete expansion shields ensures that the benefits of the popular open-source hardware platforms will be experienced by all those involved. However, it is totally meaningless to design any of the new functional shields just as another expansion shield for one of the existing expandable platforms, because, although these platforms are very convenient for small-scale prototyping and proof-of-concept implementations, in practice, they cannot be considered as a reliable solution for real-world WSAN applications, such in the case of agriculture (see Section2). Also, an insurmountable obstacle in the adoption of the existing expandable OSH platforms is that they do not allow for real scalability and expandability, which actually is a key factor for the accommodation of a hardware abstraction, such as the one proposed by SensoTube. In accordance to the architecture of these platforms, the type and the number of the extension shields is determined by the features of the MCU of the main-board, so it is very common for designers to face resource limitations, such as in the processing power, the program memory size, the input/output signals, or the communication interfaces, and the only way to respond is to replace the main-board with one that has enhanced features, but jeopardizing in this way the compatibility with the already existed expansion shields. Moreover, practically none of the existing main-boards support the engagement of MCU-based shields, they do not care about how the expansion shields will fulfill their particular energy needs, and, they do not pay any attention on the form-factor of the expansion shields. Therefore, there are serious risks and troubles in WSAN systems based on these architectures. In order to overcome the egocentrism of the existing expandable OSH architectures, SensoTube architecture introduces the concept of the inter-layer services. In particular, there are four inter-layer services, according to the SensoTube: the inter-layer signals management service, the inter-layer communication service, the inter-layer programming and debugging service, and the energy management service. These services are easily implemented by the use of BECs and with some enhancements at the PCB design level (see Section4). With these four straightforward and comprehensive supportive mechanisms, it can be guaranteed that a WSAN system can be built not by using partly suitable expansion shields with superfluous circuitry, but with functional dedicated shields. SensoTube, with its seven functional layers shields, together with the four inter-layer services, can really be used to decompose a WSAN system into its vital functions and ensure the desirable separation of concerns. Furthermore, the introduction of polymorphism in the signal connections together with the anticipation of shields’ local intelligence, by supporting the multi-processor collaboration development, allows for the facilitation of the embedding of any challenging technology into the WSAN system. For instance, it was explained how to exploit the SensoTube architecture in order to host, on an occasional basis, challenging features such as energy monitoring and control, over-the-air programming, and so on. Fortunately, the recent progress in MCU technology allows for several ultra-low energy solutions, and there is practically no change either in the system’s energy balance or in the manufacturing budget. On the contrary, through the use of software and hardware techniques for, e.g., idleness, the multi-processor approach can contribute towards energy consumption reduction. Moreover, the SensoTube architecture can essentially support the modeling of the component functions of a WSAN system not relying on simulation and arbitrary approaches but on the basis of the real behavior of the operational entities under the post-deployment real-world conditions. The ability for a realistic modeling together with the energy management insights of the SensoTube-based systems can lead to the design of really energy- and function-optimized WSAN solutions that will meet the demands of applications not only in the agricultural domain, but also in applications such as the forestry domain, the environmental monitoring domain, the wildlife monitoring domain, and others. To further support the real-world deployments in agriculture, particular emphasis was given in the encapsulation of the systems, so plastic irrigation tubes were chosen to be the system encapsulation, because they constitute a novel, low-cost, and extra durable medium that not only can withstand the Sensors 2016, 16, 1227 50 of 59 harsh agricultural environment, but can also allow for better facilitation of antennae, energy storage media, etc. (see Section6). In conclusion, the SensoTube is an open architecture that allows the design of scalable, flexible, reliable, and optimized WSAN systems, while, at the same time, it ensures enhanced versatility by facilitating novel and challenging technologies by multi-skilled designers. As presented through certain use case examples (see Section7), the migration of existing open-source designs to the SensoTube system entails several advantages for energy efficiency, explicit circuitries’ design, multi-MCU concurrent development support, and low cost. The cost of implementation has been kept to the minimum, because the proposed novelties have been limited just to the system’s physical layer, i.e., to the PCB design. With the SensoTube architecture, the WSAN stakeholders (see Section2) can have the maximum expandability, scalability, reconfigurability, reusability, and standardization needed in order to fulfill their particular requirements. Additionally, as it was revealed from the literature review (see Section5), the SensoTube architecture can be a significant contribution towards the requested hardware abstraction need for the development of sound middleware. Future work on the subject includes the design and implementation of an extensive series of functional layer shields and the development of the hardware abstraction layer (HAL) set of APIs with emphasis on the support of middleware requirements.

Acknowledgments: This study was conducted with the financial support of the Research Program No. 80257 for ARM MCUs of the Piraeus University of Applied Sciences. Author Contributions: All authors contributed to the survey literature. Konstantinos Arvanitis supervised the overall work and the overall structure of the paper. Dimitrios Piromalis developed the proposed architecture and he also made the design and implementation of the example WSAN systems. All authors jointly supervised the results of the proposed architecture application in Agriculture. Conflicts of Interest: The authors declare no conflict of interest.

Abbreviations The following abbreviations are used in this manuscript: WSAN Wireless Sensors and Actuators Network FPGA Field-Programmable Gate Arrays MCU Microcontroller Unit WMN Wireless Multimedia Network RFID Radio Frequency Identification ARM Advanced RISC Machine RISC Reduced Instruction Set Computer IoT Internet of Thing HMI Human-Machine Interface MEMS Micro-Electromechanical Sensor LoC Lab-on-Chip COTS Commercial-Of-The-Shelve NRE Non-Recurring Engineering OSH Open-Source Hardware API Application Peripheral Interface RF Radio Frequency PCB Printed-Circuit Board IC Integrated Circuit MPU Microprocessor Unit IDE Integrated Development Environment OSEP Open-Source Expandable Platforms SBC Single Board Computer BEC Board Exoansion Connector WuR Wake-up-Radio DCL Data Acquisition and Control Layer Sensors 2016, 16, 1227 51 of 59

WNL Wireless Networking Layer DGL Data Gateway Layer ASL Application-Specific Layer PML Power Management Layer PDL Programming and Debugging Layer ETL Evaluation and Testing Layer JTAG Joint Test Action Group DAQ Data Acquisition SI Signals Integrity EMC Electromagnetic Compatibility EMI Electromagnetic Interference ESD Electrostatic Discharge IoG Internet-of-Gateways CPS Cyber-Physical Space SFSM Synchronous Finite State Machine ISP In-System Programming SMP Symmetric Multicore Processing AMP Asymmetric Multicore Processing RCP Rapid Control Prototyping MDE Model-Driven Engineering PVC Poly-Vinyl Chloride SPI Serial Peripheral Interface I2C Inter-Integrated Communication OTA Over-The-Air

References

1. Harrop, P.; Das, R. Wireless Sensor Networks (WSN) 2014–2024: Forecasts, Technologies, Players the New Market for Ubiquitous Sensor Networks (USN); IDTechEX: Cambridge, UK, 2009; p. 282. 2. Herrera-Quintero, L.F.; Macia-Perez, F.; Ramos-Morillo, H.; Lago-Gonzalez, C. Wireless smart sensors networks, systems, trends and its impact in environmental monitoring. In Proceedings of the 2009 IEEE Latin-American Conference on Communications, Medellin, Colombia, 10–11 September 2009. 3. Aqeel Ur, R.; Abbasi, A.Z.; Islam, N.; Shaikh, Z.A. A review of wireless sensors and networks’ applications in agriculture. Comput Stand Interfaces 2014, 36, 263–270. [CrossRef] 4. Wang, N.; Zhang, N.; Wang, M. Wireless sensors in agriculture and food industry—Recent development and future perspective. Comput. Electron. Agric. 2006, 50, 1–14. [CrossRef] 5. Lee, W.S.; Alchanatis, V.; Yang, C.; Hirafuji, M.; Moshou, D.; Li, C. Sensing technologies for precision specialty crop production. Comput. Electron. Agric. 2010, 74, 2–33. [CrossRef] 6. Gaura, E.; Girod, L.; Brusey, J.; Allen, M.; Challen, G. Learning from Deployment Experience. In Wireless Sensor Networks: Deployments and Design Frameworks; Springer US: New Yourk, NY, USA, 2010; pp. 15–50. 7. Alamri, A.; Ansari, W.S.; Hassan, M.M.; Hossain, M.S.; Alelaiwi, A.; Hossain, M.A. A survey on sensor-cloud: Architecture, applications, and approaches. Int. J. Distrib. Sens. Netw. 2016.[CrossRef] 8. Panchard, J.; Papadimitratos, P.; Hubaux, J.P.; Rao, P.R.S.; Sheshshayee, M.S.; Kumar, S. Wireless sensor networking for rain-fed farming decision support. In Proceedings of the ACM SIGCOMM 2008 Conference on Computer Communications—2nd ACM SIGCOMM Workshop on Networked Systems for Developing Regions, Seattle, WA, USA, 18 August 2008; pp. 31–36. 9. Barcelo-Ordinas, J.M.; Chanet, J.P.; Hou, K.M.; Garcia-Vidal, J. A Survey of Wireless Sensor Technologies Applied to Precision Agriculture. In Precision Agriculture ’13; Wageningen Academic Publishers: Wageningen, The Netherlands, 2013; pp. 801–808. 10. De, D.; Song, W.Z.; Xu, M.; Shi, L.; Tan, S. Advances in real-world sensor network system. Adv. Comput. 2013, 90, 1–90. 11. Rault, T.; Bouabdallah, A.; Challal, Y. Energy efficiency in wireless sensor networks: A top-down survey. Comput. Netw. 2014, 67, 104–122. [CrossRef] 12. Mampentzidou, I.; Karapistoli, E.; Economides, A.A. Basic guidelines for deploying wireless sensor networks in agriculture. In Proceedings of the 2012 4th International Congress on Ultra Modern Telecommunications and Control Systems, St. Petersburg, FL, USA, 3–5 October 2012; pp. 864–869. 13. Abdelgawad, A.; Bayoumi, M. Data Fusion in WSN. In Resource-Aware Data Fusion Algorithms for Wireless Sensor Networks; Springer US: New Yourk, NY, USA, 2012; pp. 17–35. Sensors 2016, 16, 1227 52 of 59

14. Kanda, K.; Ishii, T.; Kameoka, T.; Saitoh, K.; Sugano, R. Field monitoring system using agri-server. In Proceedings of the 50th Annual Conference on Society of Instrument and Control Engineers, Tokyo, Japan, 13–18 September 2011; pp. 2069–2072. 15. Dapper, M.; Wells, J.S.; Schwallie, T.; Huon, L. RF propagation in short range sensor communications. Proc. SPIE 2003, 5090, 330–340. 16. Vougioukas, S.; Anastassiu, H.T.; Regen, C.; Zude, M. Influence of foliage on radio path losses (PLS) for wireless sensor network (WSN) planning in orchards. Biosyst. Eng. 2013, 114, 454–465. [CrossRef] 17. Malavolta, I.; Muccini, H. A survey on the specification of the physical environment of wireless sensor networks. In Proceedings of the 40th Euromicro Conference Series on Software Engineering and Advanced Applications, Verona, Italy, 27–29 August 2014; pp. 245–253. 18. Nguyen, H.A.; Förster, A.; Puccinelli, D.; Giordano, S. Sensor node lifetime: An experimental study. In Proceedings of the 2011 9th IEEE International Conference on Pervasive Computing and Communications Workshops, Seattle, WA, USA, 21–25 March 2011; pp. 202–207. 19. Lee, S.; Kang, B.G.; Kim, T.G.; Cho, J.; Park, D. Interoperation of Distributed MCU Emulator/Simulator for Operating Power Simulation of Large-Scale Internet of Event-Driven Control Things. In Advances in Parallel and Distributed Computing and Ubiquitous Services; Shen, H., Jeong, Y.S., Yi, G., Park, J.J., Eds.; Springer Singapore: Singapore, 2016; pp. 75–82. 20. Corke, P.; Wark, T.; Jurdak, R.; Hu, W.; Valencia, P.; Moore, D. Environmental wireless sensor networks. Proc. IEEE 2010, 98, 1903–1917. [CrossRef] 21. Djenouri, D.; Bagaa, M. Synchronization protocols and implementation issues in wireless sensor networks: A review. IEEE Syst. J. 2014, 10, 617–627. [CrossRef] 22. Farooq, M.O.; Kunz, T. Operating systems for wireless sensor networks: A survey. Sensors 2011, 11, 5900–5930. [CrossRef][PubMed] 23. Cheour, R.; Lahmar, K.; Abid, M. Evolution of wireless sensor networks and necessity of power management technique. In Proceedings of the 2011 Faible Tension Faible Consommation, Marrakech, Morocco, 30 May–1 June 2011; pp. 75–78. 24. Karray, F.; Jmal, M.W.; Abid, M.; Bensaleh, M.S.; Obeid, A.M. A review on wireless sensor node architectures. In Proceedings of the 2014 9th International Symposium on Reconfigurable and Communication-Centric Systems-on-Chip, Montpellier, France, 26–28 May 2014. 25. Bag, J.; Roy, S.; Sarkar, S.K. Realization of a low power sensor node processor for wireless sensor network and its VLSI implementation. In Proceedings of the 2014 IEEE International Advance Computing Conference, Gurgaon, India, 21–22 February 2014; pp. 101–105. 26. Gajjar, S.; Choksi, N.; Sarkar, M.; Dasgupta, K. Comparative analysis of wireless sensor network motes. In Proceedings of the 2014 IEEE International Advance Computing Conference, Gurgaon, India, 21–22 February 2014; pp. 426–431. 27. Rawat, P.; Singh, K.D.; Chaouchi, H.; Bonnin, J.M. Wireless sensor networks: A survey on recent developments and potential synergies. J. Supercomput. 2014, 68, 1–48. [CrossRef] 28. Tavli, B.; Bicakci, K.; Zilan, R.; Barcelo-Ordinas, J.M. A survey of visual sensor network platforms. Multimed. Tools Appl. 2011, 60, 1–38. [CrossRef] 29. Farooq, M.O.; Kunz, T. Wireless Multimedia Sensor Networks Testbeds and State-of-The-Art Hardware: A Survey. In Communication and Networking; Springer Berlin Heidelberg: Heidelberg, Germay, 2012; pp. 1–14. 30. Seema, A.; Reisslein, M. Towards efficient wireless video sensor networks: A survey of existing node architectures and proposal for a flexi-WVSNP design. IEEE Commun. Surv. Tutor. 2011, 13, 462–486. [CrossRef] 31. De Donno, D.; Catarinucci, L.; Tarricone, L. A battery-assisted sensor-enhanced RFID tag enabling heterogeneous wireless sensor networks. IEEE Sens. J. 2014, 14, 1048–1055. [CrossRef] 32. Celandroni, N.; Ferro, E.; Gotta, A.; Oligeri, G.; Roseti, C.; Luglio, M.; Bisio, I.; Cello, M.; Davoli, F.; Panagopoulos, A.D.; et al. A survey of architectures and scenarios in satellite-based wireless sensor networks: System design aspects. Int. J. Satell. Commun. Netw. 2013, 31, 1–38. [CrossRef] 33. Atzori, L.; Iera, A.; Morabito, G. The internet of things: A survey. Comput. Netw. 2010, 54, 2787–2805. [CrossRef] Sensors 2016, 16, 1227 53 of 59

34. Wan, Z.G.; Tan, Y.K.; Yuen, C. Review on energy harvesting and energy management for sustainable wireless sensor networks. In Proceedings of the 2011 IEEE 13th International Conference on Communication Technology, Jinan, China, 25–28 September 2011; pp. 362–367. 35. Mainetti, L.; Patrono, L.; Vilei, A. Evolution of wireless sensor networks towards the internet of things: A survey. In Proceedings of the 19th International Conference on Software, Telecommunications and Computer Networks, Split, Croatia, 15–19 September 2011; pp. 16–21. 36. Chen, Y.; Hou, K.M.; Zhou, H.; Shi, H.L.; Liu, X.; Diao, X.; Ding, H.; Li, J.J.; De Vaulx, C. 6loWPAN stacks: A survey. In Proceedings of the 7th International Conference on Wireless Communications, Networking and Mobile Computing, Wuhan, China, 23–25 September 2011. 37. Abdulla, R.; Ismail, W. Survey of WSN technology based reliable and efficient active RFID. In Proceedings of the 2013 IEEE 11th Malaysia International Conference on Communications, Kuala Lumpur, Malaysia, 26–28 November 2013; pp. 116–121. 38. Tsopela, A.; Laborde, A.; Salvagnac, L.; Ventalon, V.; Bedel-Pereira, E.; Séguy, I.; Temple-Boyer, P.; Juneau, P.; Izquierdo, R.; Launay, J. Development of a lab-on-chip electrochemical biosensor for water quality analysis based on microalgal photosynthesis. Biosens. Bioelectron. 2016, 79, 568–573. [CrossRef][PubMed] 39. Alea, M.D.D.; Azurin, L.A.I.; Bamba, P.V.F.; Maramba, M.C.; Santos, E.D.; Alarcon, L.P.; Hizon, J.R.E.; Roque, C.R.K. Developing an ARM-based sensor platform. In Proceedings of the 2013 IEEE International Conference of IEEE Region 10—TENCON 2013, Xi’an, China, 22–25 October 2013. 40. Tsekoura, I.; Rebel, G.; Glosekotter, P.; Berekovic, M. An evaluation of energy efficient microcontrollers. In Proceedings of the 2014 9th International Symposium on Reconfigurable and Communication-Centric Systems-on-Chip, Montpellier, France, 26–28 May 2014. 41. Zia, H.; Harris, N.R.; Merrett, G.V.; Rivers, M.; Coles, N. The impact of agricultural activities on water quality: A case for collaborative catchment-scale management using integrated wireless sensor networks. Comput. Electron. Agric. 2013, 96, 126–138. [CrossRef] 42. Kyriakarakos, G.; Piromalis, D.D.; Arvanitis, K.G.; Dounis, A.I.; Papadakis, G. On battery-less autonomous polygeneration microgrids: Investigation of the combined hybrid capacitors/hydrogen alternative. Energy Convers. Manag. 2015, 91, 405–415. [CrossRef] 43. Panda, R.; Ranasinghe, D.C.; Parlikad, A.; McFarlane, D. A condition monitoring platform using COTS wireless sensor networks—Lessons and experience. In Proceedings of the 24th IEEE International Conference on Advanced Information Networking and Applications, Perth, WA, USA, 20–23 April 2010; pp. 473–480. 44. Serrano, P.; Bernardos, C.J.; De La Oliva, A.; Soto, I. Lessons learned from the deployment of a multihop IEEE 802.11g testbed using COTS devices. In Proceedings of the 2010 European Wireless Conference, Lucca, Italy, 12–15 April 2010; pp. 667–674. 45. Cena, G.; Scanzio, S.; Valenzano, A.; Zunino, C. Wireless machine vision systems based on COTS equipment. In Proceedings of the 2012 9th IEEE International Workshop on Factory Communication Systems, Lemgo, Germany, 21–24 May 2012; pp. 3–12. 46. Ashok, A.; Subbiah, I.; Varga, G.; Schrey, M.; Heinen, S.; Achtzehn, A.; Petrova, M. Whitelan: Facilitate cost-efficient SDR research with COTS IEEE 802.11b/g devices. In Proceedings of the ACM SIGCOMM 2014 Workshop on Software Radio Implementation Forum, Chicago, IL, USA, 18 August 2014; pp. 45–52. 47. Chavez-Burbano, P.; Marin-Garcia, I.; Muñoz-Arcentales, A. Ad-hoc network implementation and experimental testing using low cost and COTS components: An ecuatorian case study. In Proceedings of the 3rd IEEE International Work Conference on Bioinspired Intelligence, Liberia, Costa Rica, 16–18 July 2014; pp. 133–137. 48. Ali, H.; Sharawi, M.S.; Al-Naffouri, T.Y. Error sources in COTS WSN platforms for impulsive signal acquisition applications. In Proceedings of the 2012 19th International Conference on Telecommunications, Jounieh, Lebanon, 23–25 April 2012. 49. Faugel, H.; Bobkov, V. Open source hard- and software: Using Arduino boards to keep old hardware running. Fusion Eng. Des. 2013, 88, 1276–1279. [CrossRef] 50. Chandra, A.A.; Lee, Y.; Kim, B.M.; Maeng, S.Y.; Park, S.H.; Lee, S.R. Review on sensor cloud and its integration with arduino based sensor network. In Proceedings of the 2013 3rd International Conference on IT Convergence and Security, Macau, China, 16–18 December 2013. Sensors 2016, 16, 1227 54 of 59

51. Pham, C. Communication performances of IEEE 802.15.4 wireless sensor motes for data-intensive applications: A comparison of WaspMote, Arduino MEGA, TelosB, MicaZ and iMote2 for image surveillance. J. Netw. Comput. Appl. 2014, 46, 48–59. 52. Nighot, V.P.; Lambor, S.M.; Joshi, S.M. Efficient battery management in wireless sensor node: Review paper. In Proceedings of the 11th IEEE and IFIP International Conference on Wireless and Optical communications Networks, Vijayawada, India, 11–13 September 2014. 53. Ferdoush, S.; Li, X. Wireless sensor network system design using raspberry Pi and Arduino for environmental monitoring applications. Procedia Comput. Sci. 2014, 34, 103–110. [CrossRef] 54. Asensio, Á.; Blasco, R.; Marco, Á.; Casas, R. Hardware architecture design for wsn runtime extension. Int. J. Distrib. Sens. Netw. 2013, 2013.[CrossRef] 55. Taslidere, E.; Cohen, F.S.; Reisman, F.K. Wireless sensor networks—A hands-on modular experiments platform for enhanced pedagogical learning. IEEE Trans. Educ. 2011, 54, 24–33. [CrossRef] 56. Mbed. Available online: http://en.wikipedia.org/wiki/Mbed (accessed on 20 November 2014). 57. Codebender. Available online: https://codebender.cc (accessed on 30 July 2016). 58. I-sense. Available online: http://www.coalesenses.com/index.php/products/solutions/isense-modules/ (accessed on 21 December 2014). 59. Creative Commons. Available online: http://creativecommons.org/licenses/ (accessed on 30 July 2016). 60. Arduino. Available online: www.arduino.cc (accessed on 1 March 2016). 61. Recktenwald, G.W.; Hall, D.E. Using Arduino as a platform for programming, design and measurement in a freshman engineering course. In Proceedings of the 118th ASEE Annual Conference and Exposition, Vancouver, BC, Canada, 26–29 June 2011. 62. Parallax Basic Stamp. Available online: http://en.wikipedia.org/wiki/BASIC_Stamp (accessed on 15 January 2015). 63. Kelemen, M.; Kelemenová, T.; Virgala, I.; Miková, L.; Lipták, T. Rapid control prototyping of embedded systems based on microcontroller. Procedia Eng. 2014, 96, 215–220. [CrossRef] 64. Matrix E-blocks. Available online: http://www.matrixtsl.com/eblockscircuitboards.php (accessed on 20 January 2015). 65. Texas Instruments. Launchpad. Available online: http://www.ti.com/ww/en/launchpad/launchpad.html? DCMP=mcu-launchpad&HQS=launchpad (accessed on 28 March 2016). 66. Nucleo STM32. Available online: http://www2.st.com/content/st_com/en/products/ecosystems/ stm32-open-development-environment/stm32-nucleo.html?querycriteria=productId=SC2003( accessed on 15 March 2016). 67. Frdm kl25. Available online: http://www.nxp.com/products/software-and-tools/hardware-development- tools/freedom-development-boards/freedom-development-platform-for-kinetis-kl14-kl15-kl24-kl25- mcus:FRDM-KL25Z (accessed on 1 February 2016). 68. Nxp lpc xpresso. Available online: http://www.lpcware.com/lpcxpresso (accessed on 15 February 2015). 69. Adi Blackfin DSP Platform with Arduino Interface. Available online: http://www.analog.com/en/about- adi/news-media-relations/news-room/2015-Press-Releases/2--25--15-low-cost-dsp-development- platforms.html (accessed on 17 April 2015). 70. Infineon Arduino Compatible Shields. Available online: http://www.infineon.com/cms/en/product/ microcontroller/32-bit-industrial-microcontroller-based-on-arm-registered-cortex-tm-m/32-bit-xmc1000- industrial-microcontroller-arm-registered-cortex-tm-m0/xmc-development-tools-kits-and-boards/ channel.html?channel=db3a30433d5e5530013d64397b0c2043 (accessed on 28 November 2015). 71. Beaglebone. Available online: http://beagleboard.org/bone (accessed on 2 April 2016). 72. Raspberry Pi. Available online: https://www.raspberrypi.org/products/ (accessed on 30 July 2016). 73. Intel Galileo Gen 2. Available online: http://www.intel.com/content/www/us/en/embedded/products/ galileo/galileo-overview.html (accessed on 2 April 2016). 74. Arduino Products. Available online: https://www.arduino.cc/en/Main/Products (accessed on 2 April 2016). 75. FRDM KL64. Available online: http://www.nxp.com/products/software-and-tools/hardware- development-tools/freedom-development-boards/freedom-development-platform-for-kinetis-k64-k63- and-k24-mcus:FRDM-K64F (accessed on 2 April 2016). 76. Single Board Computers Comparison. Available online: http://en.wikipedia.org/wiki/Comparison_of_ single-board_computers (accessed on 2 April 2015). Sensors 2016, 16, 1227 55 of 59

77. Arduino Uno Rev.3. Available online: https://www.arduino.cc/en/Main/ArduinoBoardUno (accessed on 2 April 2016). 78. Arduino Uno Rev. 3, Schematic Drawing. Available online: https://www.arduino.cc/en/uploads/Main/ Arduino_Uno_Rev3-schematic.pdf (accessed on 2 April 2016). 79. Agrawal, N.; Singhal, S. Smart drip irrigation system using raspberry Pi and Arduino. In Proceedings of the 2015 International Conference on Computing, Communication and Automation, Noida, India, 15–16 May 2015; pp. 928–932. 80. Kabir, A.F.M.S.; Shorif, M.A.; Li, H.; Yu, Q. A study of secured wireless sensor networks with XBee and Arduino. In Proceedings of the 2014 2nd International Conference on Systems and Informatics, Shanghai, China, 15–17 November 2014; pp. 492–496. 81. Lim, W.; Torres, H.K.; Oppus, C.M. An agricultural telemetry system implemented using an Arduino-Android interface. In Proceedings of the 2014 7th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment and Management, Palawan, Philippines, 12–16 November 2014. 82. Silva, J.F.M.C.; Gomes, R.C.; Nascimento, A.O.F.; Menezes, J.W.M.; Silva, F.D.; Alves, L.E.B. Building a node for wireless sensor network based on open source platform Arduino. In Proceedings of the 2012 2nd Brazilian Symposium on Computing System Engineering, Natal, Brasil, 5–7 November 2012; p. 224. 83. Arduino Ethernet Shield. Available online: https://www.arduino.cc/en/Main/ArduinoEthernetShield (accessed on 1 April 2016). 84. XBee RF Modules. Available online: http://www.digi.com/products/xbee-rf-solutions (accessed on 8 April 2016). 85. Papageorgas, P.; Piromalis, D.; Iliopoulou, T.; Agavanakis, K.; Barbarosou, M.; Prekas, K.; Antonakoglou, K. Wireless sensor networking architecture of polytropon: An open source scalable platform for the smart grid. Energy Procedia 2014, 50, 270–276. [CrossRef] 86. Han, Y.; Yan, Z.; Che, M.; Wang, T. The SI and EMI analysis and pre-design of the sensor. In Proceedings of the 2011 4th IEEE International Symposium on Microwave, Antenna, Propagation and EMC Technologies for Wireless Communications, Beijing, China, 1–3 November 2011; pp. 566–569. 87. Atmel 8-bit Microcontroller with 4/8/16/32 kbytes In-system Programmable Flash. Available online: http://www.atmel.com/images/Atmel-8271--8-bit-AVR-Microcontroller-ATmega48A-48PA-88A- 88PA-168A-168PA-328--328P_datasheet_Complete.pdf (accessed on 18 March 2016). 88. Naito, K.; Nakanishi, K.; Mori, K.; Kobayashi, H. Implementation of Tree-Based Data Collection Scheme for Arduino-Compatible Board. In Intelligent Interactive Multimedia Systems and Services; Springer International Publishing: Cham, Switzerland, 2015; pp. 335–345. 89. Korak, T. Location-Dependent EM leakage of the ATxmega microcontroller. In Foundations and Practice of Security; Springer International Publishing: Cham, Switzerland, 2015; pp. 17–32. 90. Newman, R.M.; Gaura, E. Size does matter—The case for big motes. In Proceedings of the 2006 NSTI Nanotechnology Conference and Trade Show, Boston, MA, USA, 7–11 May 2006; pp. 441–446. 91. Mottola, L.; Picco, G.P. Programming wireless sensor networks: Fundamental concepts and state of the art. ACM Comput. Surv. 2011, 43.[CrossRef] 92. Miyazaki, T.; Li, P.; Guo, S.; Kitamichi, J.; Hayashi, T.; Tsukahara, T. On-demand customizable wireless sensor network. Procedia Comput. Sci. 2015, 52, 302–309. [CrossRef] 93. Miyazaki, T.; Yamaguchi, S.; Kobayashi, K.; Kitamichi, J.; Guo, S.; Tsukahara, T.; Hayashi, T. A software defined wireless sensor network. In Proceedings of the 2014 International Conference on Computing, Networking and Communications, Honolulu, HI, USA, 3–6 February 2014; pp. 847–852. 94. Chen, H.; Wei, B.; Ma, D. Energy storage and management system with carbon nanotube supercapacitor and multidirectional power delivery capability for autonomous wireless sensor nodes. IEEE Trans. Power Electron. 2010, 25, 2897–2909. [CrossRef] 95. Oller, J.; Demirkol, I.; Casademont, J.; Paradells, J.; Gamm, G.U.; Reindl, L. Has time come to switch from duty-cycled mac protocols to wake-up radio for wireless sensor networks? IEEE ACM Trans. Netw. 2015, 24, 674–687. [CrossRef] 96. Borges, L.M.; Velez, F.J.; Lebres, A.S. Survey on the characterization and classification of wireless sensor network applications. IEEE Commun. Surv. Tutor. 2014, 16, 1860–1890. [CrossRef] Sensors 2016, 16, 1227 56 of 59

97. Ansari, A.W.; Garg, M.; Choudhury, S.; Singh, R. ARM based real time video streaming using XBee for perimeter control in defense application. In Proceedings of the 8th International Conference on Computing for Sustainable Global Development, New Delhi, India, 5–7 March 2014; pp. 943–947. 98. Otero, C.T.O.; Tse, J.; Karmazin, R.; Hill, B.; Manohar, R. ULSNAP: An ultra-low power event-driven microcontroller for sensor network nodes. In Proceedings of the 15th International Symposium on Quality Electronic Design, Santa Clara, CA, USA, 3–5 March 2014; pp. 667–674. 99. Bol, D.; De Vos, J.; Hocquet, C.; Botman, F.; Durvaux, F.; Boyd, S.; Flandre, D.; Legat, J.D. Sleep walker: A 25-mHz 0.4-V sub-mm2 7-µW/mHz microcontroller in 65-nm LP/GP CMOS for low-carbon wireless sensor nodes. IEEE J. Solid State Circuits 2013, 48, 20–32. 100. Liu, Z.; Shi, J.; Peng, W. Design of a Low-Power Humidity and Temperature Collector Based on STM32. In Proceedings of the Second International Conference on Mechatronics and Automatic Control; Springer International Publishing: Cham, Switzerland, 2015; pp. 801–811. 101. Noury, N.; Perriot, B.; Collet, J.; Grenier, E.; Cerny, M.; Massot, B.; McAdams, E. ActimedARM—Design of a wearable system to monitor daily actimetry. In Proceedings of the 2013 35th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, Osaka, Japan, 3–7 November 2013; pp. 1851–1854. 102. Khanna, S.; Bartling, S.C.; Clinton, M.; Summerfelt, S.; Rodriguez, J.A.; McAdams, H.P. An FRAM-based nonvolatile logic MCU SoC exhibiting 100% digital state retention at VDD = 0 V achieving zero leakage with < 400-ns wakeup time for ULP applications. IEEE J. Solid State Circuits 2014, 49, 95–106. 103. Khanna, S.; Bartling, S.; Clinton, M.; Summerfelt, S.; Rodriguez, J.; McAdams, H. Zero leakage microcontroller with 384 ns wakeup time using fram mini-array architecture. In Proceedings of the 2013 9th IEEE Asian Solid-State Circuits Conference, Singapore, 11–13 November 2013; pp. 21–24. 104. Botman, F.; De Vos, J.; Bernard, S.; Stas, F.; Legat, J.D.; Bol, D. Bellevue: A 50 mHz variable-width SIMD 32 bit microcontroller at 0.37 V for processing-intensive wireless sensor nodes. In Proceedings of the 2014 IEEE International Symposium on Circuits and Systems, Melbourne, VIC, Australia, 1–5 June 2014; pp. 1207–1210. 105. Tang, W.X.; Wen, S.A.; Tung, S.W.; Lin, K.Y.; Chen, C.C.; Su, C.L. A 42.5 µW/mHz ultra-low power 32-bit microcontroller—SPARK. In Proceedings of the 9th International Conference on Information, Communications and Signal Processing, Tainan, Taiwan, 10–13 December 2013. 106. Lueders, M.; Eversmann, B.; Gerber, J.; Huber, K.; Kuhn, R.; Zwerg, M.; Schmitt-Landsiedel, D.; Brederlow, R. Architectural and techniques for power management of ultra-low-power MCU systems. IEEE Trans. Large Scale Integr. VLSI Syst. 2014, 22, 2287–2296. [CrossRef] 107. Mazumdar, K.; Bartling, S.; Khanna, S.; Stan, M. A digitally-controlled power-aware low-dropout regulator to reduce standby current drain in ultra-low-power MCU. In Proceedings of the 16th International Symposium on Quality Electronic Design, Santa Clara, CA, USA, 2–4 March 2015; pp. 98–102. 108. Berthier, F.; Beigne, E.; Vivet, P.; Sentieys, O. Power gain estimation of an event-driven wake-up controller dedicated to WSN’s microcontroller. In Proceedings of the 13th IEEE International New Circuits and Systems Conference, Grenoble, France, 7–10 June 2015. 109. Bogliolo, A.; Lattanzi, E.; Freschi, V. Idleness as a resource in energy-neutral WSNs. In Proceedings of the 1st International Workshop on Energy Neutral Sensing Systems, Rome, Italy, 11–15 November 2013. 110. Ohshima, K.; Kobayashi, H.; Nishijima, T.; Yoneda, S.; Tomatsu, H.; Maeda, S.; Tsukida, K.; Takahashi, K.; Sato, T.; Watanabe, K.; et al. A normally-off microcontroller unit with an 85% power overhead reduction based on crystalline indium gallium zinc oxide field effect transistors. Jpn. J. Appl. Phys. 2014, 53.[CrossRef] 111. Hayashikoshi, M.; Sato, Y.; Ueki, H.; Kawai, H.; Shimizu, T. Normally-Off MCU architecture for low-power sensor node. In Proceedings of the 2014 19th Asia and South Pacific Design Automation Conference, Suntec, Singapore, 20–23 January 2014; pp. 12–16. 112. Sdi-12 specification. Available online: http://www.sdi-12.org/current%20specification/SDI-12_version1_ 3%20January%2028,%202016.pdf (accessed on 3 March 2016). 113. Rumberg, B.; Graham, D.W.; Clites, S.; Kelly, B.M.; Navidi, M.M.; Dilello, A.; Kulathumani, V. Ramp: Accelerating wireless sensor hardware design with a reconfigurable analog/mixed-signal platform. In Proceedings of the 14th International Symposium on Information Processing in Sensor Networks, Seattle, WA, USA, 13–16 April 2015; pp. 47–58. Sensors 2016, 16, 1227 57 of 59

114. Rana, C.; Afzal, N. Advances in sensor networks using analog signal processing circuits. In Proceedings of the 2014 Recent Advances in Engineering and Computational Sciences, Chandigarh, India, 6–8 March 2014. 115. Guerroumi, M.; Pathan, A.S.K.; Badache, N.; Moussaoui, S. Strengths and weaknesses of prominent data dissemination techniques in wireless sensor networks. Int. J. Commun. Netw. Inf. Secur. 2013, 5, 158–177. 116. Molisch, A.F.; Balakrishnan, K.; Cassioli, D.; Chong, C.-C.; Emami, S.; Fort, A.; Karedal, J.; Kunisch, J.; Schantz, H.; Schuster, U. IEEE 802.15. 4a Channel Model—Final Report. Available online: http://www. ieee802.org/15/pub/04/15-04-0662-02-004a-channel-model-final-report-r1.pdf (accessed on 30 July 2016). 117. Rodrigues, A.; Camilo, T.; Silva, J.S.; Boavida, F. Diagnostic tools for wireless sensor networks: A comparative survey. J. Netw. Syst. Manag. 2013, 21, 408–452. [CrossRef] 118. Gomez, C.; Paradells, J. Urban automation networks: Current and emerging solutions for sensed data collection and actuation in smart cities. Sensors 2015, 15, 22874–22898. [CrossRef][PubMed] 119. Sigfox. Available online: http://www.sigfox.com (accessed on 4 April 2016). 120. Lora Netowork. Available online: https://www.lora-alliance.org (accessed on 28 March 2016). 121. Liutkevicius, A.; Vrubliauskas, A.; Kazanavicius, E. A Survey of Wireless Sensor Network Interconnection yo External Networks. In Novel Algorithms and Techniques in Telecommunications and Networking; Springer Netherlands: Amsterland, The Netherlands, 2010; pp. 41–46. 122. Wu, F.J.; Kao, Y.F.; Tseng, Y.C. From wireless sensor networks towards cyber physical systems. Pervasive Mob. Comput. 2011, 7, 397–413. [CrossRef] 123. Bogue, R. Solar-powered sensors: A review of products and applications. Sens. Rev. 2012, 32, 95–100. [CrossRef] 124. Swapna Kumar, S.; Kashwan, K.R. Research study of energy harvesting in wireless sensor networks. Int. J. Renew. Energy Res. 2013, 3, 745–753. 125. Qian, H.; Sun, P.; Rong, Y. Design proposal of self-powered WSN node for battle field surveillance. Energy Procedia 2012, 16, 753–757. [CrossRef] 126. Zahid Kausar, A.S.M.; Reza, A.W.; Saleh, M.U.; Ramiah, H. Energizing wireless sensor networks by energy harvesting systems: Scopes, challenges and approaches. Renew. Sustain. Energy Rev. 2014, 38, 973–989. [CrossRef] 127. Berecibar, M.; Gandiaga, I.; Villarreal, I.; Omar, N.; Van Mierlo, J.; Van Den Bossche, P. Critical review of state of health estimation methods of Li-ion batteries for real applications. Renew. Sustain. Energy Rev. 2016, 56, 572–587. [CrossRef] 128. Le, T.N.; Pegatoquet, A.; Berder, O.; Sentieys, O.; Carer, A. Energy-neutral design framework for supercapacitor-based autonomous wireless sensor networks. ACM J. Emerg. Technol. Comput. Syst. 2015, 12. [CrossRef] 129. Somov, A.; Ho, C.C.; Passerone, R.; Evans, J.W.; Wright, P.K. Towards Extending Sensor Node Lifetime with Printed Supercapacitors. In Wireless Sensor Networks; Springer Berlin Heidelberg: Heidelberg, Germany, 2012; pp. 212–227. 130. Wang, W.; Wang, N.; Vinco, A.; Siddique, R.; Hayes, M.; O’Flynn, B.; O’Mathuna, C. Super-capacitor and thin film battery hybrid energy storage for energy harvesting applications. J. Phys. Conf. Ser. 2013, 476, 012105. [CrossRef] 131. Ansh; Yadav, R.; Deb, D.; Ray, A. Multi-purpose auto-programmable reconfigurable embedded system architecture. In Proceedings of the 2015 1st International Conference on Electronic Design, Computer Networks and Automated Verification, Shillong, India, 29–30 January 2015; pp. 48–51. 132. Ruckebusch, P.; De Poorter, E.; Fortuna, C.; Moerman, I. Gitar: Generic extension for internet-of-things architectures enabling dynamic updates of network and application modules. Ad Hoc Netw. 2016, 36, 127–151. [CrossRef] 133. Optimize for minimal power consumption. Available online: http://datasheet.octopart.com/I-JET-IAR- Systems-datasheet-14433983.pdf (accessed on 8 January 2016). 134. Trace Analyzer, User Guide. Available online: http://www.ti.com/lit/ug/spruhm7b/spruhm7b.pdf (accessed on 1 April 2016). 135. Garg, K.; Förster, A.; Puccinelli, D.; Giordano, S. Towards realistic and credible wireless sensor network evaluation. In Ad-Hoc Networks; Springer Berlin Heidelberg: Heilderberg, Germany, 2012; pp. 49–64. 136. Mahapatro, A.; Khilar, P.M. Fault diagnosis in wireless sensor networks: A survey. IEEE Commun. Surv. Tutor. 2013, 15, 2000–2026. [CrossRef] Sensors 2016, 16, 1227 58 of 59

137. Hellbruck, H.; Pagel, M.; Kroller, A.; Bimschas, D.; Pfisterer, D.; Fischer, S. Using and operating wireless sensor network testbeds with WISEBED. In Proceedings of the 10th IFIP Annual Mediterranean Ad Hoc Networking Workshop, Favignana Island, Sicily, Italy, 12–15 June 2011; pp. 171–178. 138. Di Francesco, M.; Das, S.K.; Anastasi, G. Data collection in wireless sensor networks with mobile elements: A survey. ACM Trans. Sens. Netw. 2011, 8.[CrossRef] 139. Tonneau, A.S.; Mitton, N.; Vandaele, J. How to choose an experimentation platform for wireless sensor networks? A survey on static and mobile wireless sensor network experimentation facilities. Ad Hoc Netw. 2015, 30, 115–127. 140. Kim, H.; Hong, W.K.; Yoo, J.; Yoo, S.E. Experimental research testbeds for large-scale WSNs: A survey from the architectural perspective. Int. J. Distrib. Sens. Netw. 2015, 2015.[CrossRef] 141. Jurdak, R.; Wang, X.R.; Obst, O.; Valencia, P. Wireless Sensor Network Anomalies: Diagnosis and Detection Strategies. In Intelligent Systems Reference Library; Tolk, A., Jain, L.C., Eds.; Springer Berlin Heidelberg: Heidelberg, Germany, 2011; pp. 309–325. 142. Renaux, D.P.B.; Pöttker, F. Power Reduction in Embedded Systems Using a Design Methodology Based on Synchronous Finite State Machines. In Embedded Systems: Design, Analysis and Verification; Springer Berlin Heidelberg: Heidelberg, Germany, 2013; pp. 61–72. 143. Kommu, A.; Kanchi, R.R. Designing a learning platform for the implementation of serial standards using arm microcontroller LPC2148. In Proceedings of the International Conference on Recent Advances and Innovations in Engineering, Jaipur, India, 9–11 May 2014. 144. I2C-bus Specification and User Manual. Available online: http://www.nxp.com/documents/user_manual/ UM10204.pdf (accessed on 20 March 2016). 145. Zhu, C.; Fei, T.; Liu, X. Multi-machine communication based on I2C-bus. Sens. Transducers 2014, 174, 138–143. 146. Zhengwei, Z.; Huihui, Z.; Lin, S. Design of multi-machine communication system based on TWI. In Proceedings of the International Conference on Electrical and Control Engineering, Wuhan, China, 25–27 June 2010; pp. 3590–3593. 147. Ismail, K.; Muharam, A.; Pratama, M. Design of CAN bus for research applications purpose hybrid electric vehicle using arm microcontroller. Energy Procedia 2015, 68, 288–296. [CrossRef] 148. Tehranipour, M.H.; Ahmed, N.; Nourani, M. Testing soc interconnects for signal integrity using extended jtag architecture. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 2004, 23, 800–811. [CrossRef] 149. Keil, R. Embedded Development Tools Trends. Available online: http://www.electronicproducts. com/Digital_ICs/Microprocessors_Microcontrollers_DSPs/Embedded_development_tools_trends.aspx? terms=Embedded%20development%20tools%20trends (accessed on 2 August 2016). 150. Salehi, M.; Ejlali, A. A hardware platform for evaluating low-energy multiprocessor embedded systems based on cots devices. IEEE Trans. Ind. Electron. 2015, 62, 1262–1269. [CrossRef] 151. Malavolta, I.; Muccini, H. A study on MDE approaches for engineering wireless sensor networks. In Proceedings of the 40th Euromicro Conference Series on Software Engineering and Advanced Applications, Verona, Italy, 27–29 August 2014; pp. 149–157. 152. Khalid, Z.; Fisal, N.; Rozaini, M. A survey of middleware for sensor and network virtualization. Sensors 2014, 14, 24046–24097. [CrossRef][PubMed] 153. Glitho, R.; Morrow, M.; Polakos, P. A cloud based-architecture for cost-efficient applications and services provisioning in wireless sensor networks. In Proceedings of the 2013 6th Joint IFIP Wireless and Mobile Networking Conference, Dubai, UAE, 23–25 April 2013. 154. Beheshti, B.D.; Michel, H.E. Middleware/API and data fusion in wireless sensor networks. In Proceedings of the 2011 IEEE Long Island Systems, Applications and Technology Conference, Farmingdale, NY, USA, 6 May 2011. 155. Butt, S.A.; Sayyah, P.; Lavagno, L. Model-based hardware/software synthesis for wireless sensor network applications. In Proceedings of the 2011 Saudi International Electronics, Communications and Photonics Conference (SIECPC), Riyadh, Saudi Arabia, 24–26 April 2011; pp. 1–6. 156. Degrees of Protection Provided by Enclosures (IP Code). Available online: https://webstore.iec.ch/ publication/2452 (accessed on 20 March 2016). Sensors 2016, 16, 1227 59 of 59

157. Iso 145–2:2009. Plastics piping systems for water supply and for buried and above-ground drainage and sewerage under pressure—Unplasticized poly(vinyl chloride) (PVC-U)—Part 2: Pipes. Available online: http://www.iso.org/iso/catalogue_detail.htm?csnumber=50362 (accessed on 9 April 2016). 158. Yu, X.; Wu, P.; Han, W.; Zhang, Z. A survey on wireless sensor network infrastructure for agriculture. Comput. Stand Interfaces 2013, 35, 59–64. [CrossRef]

© 2016 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC-BY) license (http://creativecommons.org/licenses/by/4.0/).