## 3 Design of Hardware and Software for the Data Monitoring System
### Design of Hardware for the Data Monitoring System
#### 3.1.2 Final Boards and Schematics  
The majority of the power tracks such as GND, +3.3 V and +5 V are designed with 0.8128 mm of width. The rest of tracks, as far as is possible, are about 0.5 mm. In the final design, depending on the module, the connected devices are different. In the Master, the VDIP1 is connected with the ATMega328 using UART port (Figure 2). Besides, to ensure a correct communication between them, two of the ATMega328 PINs are used as \"Clear to Send\" (CTS) and \"Request to Send\" (RTS) (Figure 2). Those tracks manage when both are ready to enable a data transmission.  
Figure 2: Master schematic final design.  
On the other hand, the DS1307 (External Clock) has been connected to the PINs ADC5 and ADC4 of the ATMEGA328 using \"Serial Data Line\" (SDA) and \"Serial Clock Line\" (SCL) in order to enable the I\({}^{2}\)C communication between them. Regarding the Watch-Dog, the \"Watchdog timer input\" (WDI) has been connected to one of the PINs of the ATMega328 to enable the Failure Management.  
Finally, an optional port has been installed to manage a \"liquid crystal display\" (LCD), which could be installed in the prototype to ensure correct data acquisition.  
Secondly, on the Slave module, the USB peripheral and the external clock have been replaced by the I\({}^{2}\)C to 1-Wire translator (Figures 2 and 3). The external 1-Wire plug is the standard D-sub connector MHDD which offers 9 connexions: 1 to the Ground (GND), 1 to the Sensors Voltage supply (VDD) and 7 channels. The channel number 3 output is reserved and located inside the board in order to offer possible connexions inside the encapsulation like other kind of sensors or protections.  
The Wireless module has an XBee microcontroller (Figure 4) to enable the wireless communication between two different modules by wireless (able to communicate among them using the IEEE 802.15.4 protocol and communicate with the AtMega328 using the USART port). It can be used to communicate also Master or Slave modules or a commercial Arduino board by I\({}^{2}\)C making it very versatile and useful in a wide range of applications.  
Figure 3: Slave Schematic Final Design.  
To avoid interference between the module which is connected (for example a Master module and its LCD connection) the module only has connected to the Digital Arduino connexions those necessaries for the communication with the attached module (PINs D2 and D3). However it is not the case of the analogic connexions (A0, A1, A2 and A3), so if those inputs are going to be used during a new designing process, it is necessary to break the connexion between the connected modules (it must be taken into a count that the channels A5 and A4 are the \"SCL\" and \"SDA\" I\({}^{2}\)C signals so their connexion never should be broken).  
Figure 4: Wireless Schematic Final Design.  
Figure 5: (**a**) Master PCB Final Design; (**b**) Slave PCB Final Design; (**c**) Wireless PCB Final Design.  
Moreover, to make the most of this module, an EEPROM memory has been installed on the top of the board and its data is protected by an external jumper. The final PCB boards of the three designed modules, compatible with Arduino module, are shown in Figure 5.