## 3 Materials and Methods
### Supply Layer  
Considering the real possibility of having no mains at the site where the painting is placed, as already explained, the system has been designed to be stand-alone thanks to the energy coming from alternative energy sources. The advantages which may result from these kinds of power supplies are remarkable and well known. In fact, avoiding the expensive wiring of the supply network, there are considerable savings and greater easiness of implementation. To minimize the battery capacity and the energy required from the solar panel, the circuit has been designed to utilize the lowest power possible. This goal has been achieved through the complex management of the first and second layers. The ARDUINO cards switch themselves on only when the internal watchdog wakes up after a pre-fixed time established during the design phase according to the exigencies of the researchers. In our application, we decided to activate the sensors card every 1 h. During the wake up mode, the cards use about 100 mA, while during the sleep mode the cards absorb 200 \(\upmu\)A. The slot time associated to the wake up mode is normally 1 s. This time includes the uncertainty joined with the synchronization with the hub, which, at the same time, should be on and ready to establish the connection with the sensor cards. Considering a normal set-up during the day, the ARDUINO cards are waked up for 24 s while the sleep time is equal to 23 h 59 min and 36 s. This allows an energetic autonomy of the cards of about 1.5 year with four AA batteries of 1.5 V and 2200 mA. At the same time, the ARDUINO placed on the hub and connected to the Raspberry-Pi, which takes the coordinator role in the ZigBee network, has also the role to activate the hub, opening the supply switch. Even this card is normally in sleep mode. When the watchdog goes up, the ARDUINO wakes up itself and, when prefixed, drives the power electronic switch designed by ourselves that connects  
Figure 5: The zoomed image. the Raspberry-Pi and the battery. At this point, the Raspberry-Pi is supplied and, after the initializing phase, starts the procedure for requesting data from the sensors. Completed this phase, when it is the time to send data toward internet, the Raspberry-Pi drives the ARDUINO asking it to close the power switch, which supplies the GPRS or the WiMAX or the satellite modem. After the initializing time the Raspberry-Pi sends the data through the modem. Managing in this way the hub, it is in sleep mode for the most part of the day. The ARDUINO absorption has already been described, while for the Raspberry-Pi the consumption in the \"on phase\" is lower than 500 mA. For the modem consumption, it depends by the type of transmission. For a GPRS modem the consumption is about 300 mA, for a WiMAX system, it is about 35 mA @ 48 V while for the satellite connection it is about 1 A. In our application, they are normally activated once every day to upload the data but the interval is programmable. Exceptions to a normal set-up are also planned. There are three kind of possible exceptions: on the sensor side, synchronization problem between cards and hub, or on the hub side. The first is caused by a broken sensor card or by the sudden absence of energy from the battery pack. In both cases, the sensor cards do not transmit anything toward the hub, which does not know if the card is broken or if there is a synchronization problem, therefore it activates a 24 h internal timer. During this time, the hub is always on and constantly pings the cards that have not replied. If they answer, the exception is a lack of synchronization and the time alignment procedure is executed. This procedure sets the ARDUINO clock again to avoid misalignment. Instead, if the internal timer reaches 24 h the cards are evidently broken and an alarm procedure is initiated. Moreover, the hub could also have problems. These could be due to the hub or due to the connections to the Internet.