Probe and Sensors Development for Level ...

31 downloads 9523 Views 11MB Size Report
Sep 16, 2016 - A grease box is used at the industrials facilities to collect .... was implemented, as a prototype, in partnership with a company dedicated to the.
sensors Article

Probe and Sensors Development for Level Measurement of Fats, Oils and Grease in Grease Boxes José Faria 1 , André Sousa 2 , Arsénio Reis 2, *, Vitor Filipe 1 and João Barroso 1 1 2

*

INESC TEC and Universiade de Trás-os-Montes e Alto Douro, Vila Real 5000, Portugal; [email protected] (J.F.); [email protected] (V.F.); [email protected] (J.B.) ECT, Universidade de Trás-os-Montes e Alto Douro, Vila Real 5000, Portugal; [email protected] Correspondence: [email protected]; Tel.: +351-932-848-975

Academic Editor: Vittorio M. N. Passaro Received: 13 July 2016; Accepted: 13 September 2016; Published: 16 September 2016

Abstract: The wide spread of food outlets has become an environmental and sanitation infrastructure problem, due to Fats, Oils and Grease (FOG). A grease box is used at the industrials facilities to collect the FOG, in a specific time window, while its quality is good for recycling (e.g., biodiesel) and it is economically valuable. After this period, it will be disposed at a cost. For the proper management of the grease boxes, it is necessary to know the quantity of FOG inside the boxes, which is a major problem, as the boxes are sealed and permanently filled with water. The lack of homogeneity of the FOG renders it not detectable by current probes for level detection in liquids. In this article, the design, development and testing of a set of probes for FOG level measurement, based on the principles used in sensors for the detection of liquids inside containers, is described. The most suitable probe, based on the capacitance principle, together with the necessary hardware and software modules for data acquisition and transmission, was developed and tested. After the development phase, the probe was integrated on a metropolitan system for FOG collection and grease box management in partnership with a grease box management company. Keywords: sensors; probes; FOG detection; grease box; capacitance sensor; conductivity sensor

1. Introduction The food industry is a major water pollutant, dumping Fats, Oils and Grease (FOG) [1] in the sewerage system. The residues from industrial kitchens cause problems, such as the reduction of oxygen available in the water and the formation of layers of fat on the water surface, dramatically affecting the ecosystems in which water plays an important role [2]. Due to this problem, death of aquatic and terrestrial animals has been recorded [3]. Besides the environmental problem, there is also a negative effect on the sewerage infrastructures as well. Over time, these infrastructures get clogged with fat, which solidifies at lower temperatures, reducing the water flow, corroding the sewage pipes, and thus increasing the risk of sewage spillage [4–7]. To deal with this problem, water treatment plants have specific processes to remove fat and mud from water, mainly through the usage of enzymatic treatments that break down the fat molecular chains. Although these treatments may neutralize the fat and acidity, allowing the separation of the waste from the water, the recovered FOG is actually a mud residue unusable or recyclable. To prevent the negative consequences of FOG to the sewerage system, as well as the necessity for specific treatments at the water treatment plants, governments and regulators have created laws and regulations in order to have some sort of pretreatment, at the industrial facilities, before dumping the wastewater into the sewerage systems. One the most important components of the pretreatment infrastructure is the grease box, which contains a grease trap and separates the fat (oil and grease) from the wastewater, trapping Sensors 2016, 16, 1517; doi:10.3390/s16091517

www.mdpi.com/journal/sensors

Sensors 2016, 16, 1517 Sensors 2016, 16, 1517

2 of 20 2 of 20

the oilthe and grease in the box and the water theand sewerage system. Onceto trapped in the from wastewater, trapping thedelivering oil and grease in theto box delivering the water the sewerage grease box, oil and grease must be collected before filling up the box and spill to the sewerage system. system. Once trapped in the grease box, oil and grease must be collected before filling up the box and Timely is critical because, staying in the grease box, oil and grease willgrease be in contact spill to collection the sewerage system. Timelywhile collection is critical because, while staying in the box, oil with other waste, as cooked grains andsuch small of cooked meat, which cause the oil and grease will besuch in contact withrice other waste, aschips cooked rice grains and smallwill chips of cooked and grease to become more acidic over time. If oil and grease collection occurs soon after the filling of meat, which will cause the oil and grease to become more acidic over time. If oil and grease collection the grease box, then of of thethe oilgrease and grease will have to behave recycled, for occurs soon after themost filling box, then most good of theenough oil and quality grease will good e.g., enough biodiesel, and will have economic value as a revenue [8,9]. Otherwise, the acidity level will rise to a quality to be recycled, e.g., for biodiesel, and will have economic value as a revenue [8,9]. Otherwise, point wherelevel the oil will where not bethe recyclable and will have collectedand andwill disposed a the acidity willand risegrease to a point oil and grease will notto bebe recyclable have toatbe cost as a residue [10]. at a cost as a residue [10]. collected and disposed This This article article presents presents the the work work of of developing developing a system to monitor the grease boxes and alert for the the correct correct time time of of collecting collecting the the oil oil and and grease grease trapped trapped in in the the box. box. For this purpose, we research research the the most most adequate adequate sensors sensors for measuring measuring the grease box box fill fill levels, levels, having having tested tested and and developed developed special special purpose purpose sensors, sensors, based based on on the principle of the different electric conductivity, conductivity, density density and and capacitance capacitance of of the the water water and and grease grease filling filling aa box. box. Together with with the the sensors, sensors, aa module module of of data data acquisition acquisition and and communication was also developed. The grease boxes, equipped with these sensors and the data communication developed. the data acquisition areare ableable to send messages, alerting for the best collect acquisitionand andcommunication communicationmodules modules to send messages, alerting for thetime besttotime to the grease, order in to have product, least partially recyclable. central server, for receiving collect the in grease, ordera to have aatproduct, at least partially Arecyclable. A central server, the for grease box the messages, andmanagement configurationand of the grease boxesofwas developed. Figure 1 receiving grease management box messages, configuration thealso grease boxes was also represents general1 view of the acomplete monitor and management system. developed.aFigure represents general view of the complete monitor and management system.

Level probe

GSM network

Data aquisition module

SMS server

Database

Management system

Figure 1. 1. Grease boxes monitoring monitoring and and management management system. system. Figure

This system system was was implemented, implemented, as as aa prototype, prototype, in in partnership partnership with with aa company company dedicated dedicated to to the the This collection of used cooking FOG and grease boxes cleaning and management. collection of used cooking FOG and grease boxes cleaning and management. 2. Theoretical 2. TheoreticalBasis Basisand andMethods Methods In this this section, section, we we present present the the current current scenario scenario regarding regarding grease grease boxes boxes design design and and the the suitability suitability In of the the methods methods currently currently available available to to detect detect and and measure measurethe thelevel levelof ofFOG FOGinside insidethe theboxes. boxes. of 2.1. 2.1. Grease Boxes Boxes Grease Grease boxes boxes are are designed designed according according to to Figure Figure 22 and and operate operate under under two two simple simple principles: principles: water water and and FOG FOG do do not not mix; mix; and and FOG FOG is is less dense dense than than water water [11,12]. [11,12]. On installation or cleaning, the grease grease box box is is filled filled with with water. water. When oils, fats and other other residues are are dumped dumped in in the the kitchen kitchen sink, sink, heavy heavy materials, materials, e.g., e.g., fine fine grain grain sand, sand, will will accumulate accumulate in in the the bottom bottom of of the the grease grease trap, trap, while while FOG FOG will will float float and the top. In In thethe central level of the trap,trap, there will will be water and and accumulate accumulateon onthe thewater watersurface surfaceatat the top. central level of the there be water residues with the as water, be released to the sewerage system. Insystem. Portugal, and residues withsame the density same density as which water, will which will be released to the sewerage In there is a legal 15 mg ofof FOG per of liter of water so itofcan be legally discharged to the sewerage Portugal, therelimit is a of legal limit 15 mg FOG per liter water so it can be legallyindischarged in to system [13]. system [13]. the sewerage FOG recollection and grease box cleaning is done by sucking the entire content of the box into a transport vessel and storage in a treatment plant, after which it will go through a treatment process, including separation of FOG, water and heavy materials.

Sensors 2016, 16, 1517 Sensors 2016, 16, 1517

3 of 20 3 of 20

Figure2.2.The Thegrease grease box composition: 1, wastewater entrance; 2, solid residues; 3, fats; 4, exit Figure box composition: 1, wastewater entrance; 2, solid residues; 3, fats; andand 4, exit to to sewage. sewage.

Probes for measuring the level a liquid in a container divided in of two FOG recollection and grease boxofcleaning is done by suckingcan thebe entire content thecategories box into a according the type sensors transportto vessel and of storage in used: a treatment plant, after which it will go through a treatment process, separation of FOG, water and heavy materials.  including Continuous measurement sensors that are able to provide the actual level of the liquid; and Probes for measuring the level of a liquid in a container can be in twothat categories according  Presence measurement sensors, which can only provide a divided confirmation the liquid has to the type of sensors used: actually reached the level where the sensor is installed [14].

this work, measurement we studied both typesthat of probes sensors,the their suitability, as the • InContinuous sensors are ableand to provide actual level of as thewell liquid; andbest approach for level detection in the specific case of a grease box. • Presence measurement sensors, which can only provide a confirmation that the liquid has actually reached the level where the sensor is installed [14]. 2.2. Detecting the Level of FOG Inside A Container In this work, we studied both types of probes and sensors, their suitability, as well as the best The detection of the FOG level inside the grease box is the major problem regarding the approach for level detection in the specific case of a grease box. implementation of a monitoring and management system. Five sensor types are studied in order evaluate their usage in building a probe for FOG level detection. 2.2. Detecting the Level of FOG Inside A Container The detectionSensor of the FOG level inside the grease box is the major problem regarding the 2.2.1. Conductivity implementation of a monitoring and management system. Five sensor types are studied in order Conductivity sensors work based onfor theFOG factlevel that water conducts electricity and, among other evaluate their usage in building a probe detection. applications, are commonly used for getting a rough estimation of the water level in water wells. For this purpose, three metal 2.2.1. Conductivity Sensorrods are installed at different levels in the well and connected to a level relay (electric relay) that will open and close, based on the water electric conductivity, and thus Conductivity sensors work based on the fact that water conducts electricity and, among other commanding power equipment, such as pumps, according to the water level. The same principle can applications, are commonly used for getting a rough estimation of the water level in water wells. For be used for grease boxes, considering that vegetable oil and animal fat, used in cooking, do not this purpose, three metal rods are installed at different levels in the well and connected to a level relay conduct electricity, and that the grease box is filled with water up to a level and with fat and oil above (electric relay) that will open and close, based on the water electric conductivity, and thus commanding that level. power equipment, such as pumps, according to the water level. The same principle can be used for These level relays are used in large grease boxes, working under the same principle, in order to grease boxes, considering that vegetable oil and animal fat, used in cooking, do not conduct electricity, activate an alert device, such as a bell or a light, when the box is ready for cleaning. It is a simple and that the grease box is filled with water up to a level and with fat and oil above that level. mechanism but requires some care with the probes (metal rods) as the accumulation of FOG affects These level relays are used in large grease boxes, working under the same principle, in order to the system sensibility. activate an alert device, such as a bell or a light, when the box is ready for cleaning. It is a simple mechanism but requires some care with the probes (metal rods) as the accumulation of FOG affects the 2.2.2. Level Buoy with Magnetic Sensor system sensibility. Level buoys are a common, inexpensive and efficient solution for measuring the level of a liquid in a container, especially when conductivity sensors cannot be used due to poor conductivity of the liquid or fire hazard. The buoy should be less dense than the liquid, so it floats at the top. Due to the moving parts, there is a high mechanical complexity associated with this sensors as well as high construction costs.

Sensors 2016, 16, 1517

4 of 20

2.2.2. Level Buoy with Magnetic Sensor Level buoys are a common, inexpensive and efficient solution for measuring the level of a liquid in a container, especially when conductivity sensors cannot be used due to poor conductivity of the liquid or fire hazard. The buoy should be less dense than the liquid, so it floats at the top. Due to the moving parts, there is a high mechanical complexity associated with this sensors as well as high construction costs. As the grease box is completely filled with water and FOG at all time, to use this method to measure the level of FOG accumulation, the buoy should be more dense then the FOG and less dense than the water. That way it would float in between the water and the FOG. A magnetic sensor, electronic [15] or mechanic [16], would be mounted in the buoy axis or outside the box, at a desired level and connect to a level alert system. 2.2.3. Optical Sensor The optical sensor works by measuring the quantity of light inside a probe, which is generally built as a transparent cone or prism with a well-known refraction index, usually 1.5. Inside the probe a light emitter and a light receptor are installed [17]. When used to detect water, two scenarios can occur: the sensor is out in the air (refraction index 1) and a certain quantity of the emitted light is reflected back to the receptor; the probe’s tip is submerged in water causing the angle of reflection inside the probe to change, as well as the quantity of light reaching the receptor, making it possible to detect the immersion of the probe’s tip in the water. The angle of the cone or prism is set according to the refraction index of the liquid to be measured, making it possible to build a probe capable of detecting the difference between the refraction index of the water (about 1.333) and the index of the oil (generally superior to 1.333) [18]. It is a simple and inexpensive sensor that may not be usable in the grease boxes context due to the strong possibility of formation of a grease film on its surface, altering the reflective properties and the detection capabilities of the sensor. 2.2.4. Density Sensor with a Load Cell This type of sensor is similar to the level buoy sensor, with the difference being in the detection, which in this case is accomplished with a load cell connected to the buoy by means of a rod. The load cell measures the force on the buoy and, because water is denser than FOG, the pressure on the load cell should be bigger when the box is full of water, decreasing as the water is replaced by FOG inside the box. This sensor is complex and expensive, considering the mechanical parts as well as the electronics needed to effectively use the load cell. 2.2.5. Capacitance Sensor The capacitance sensor uses the electric capacitor working principle in order to measure the level of a liquid in a container [19]. The capacitance between two plates can be formulated as C = kA d , in which “C” is the capacitance, “k” is the dielectric constant of the material between the plates, “A” is the area of the plates, and “d” is the distance between the plates. When the container is an electrical conductor, a sensor element is inserted inside the container, which measures the capacitance between the container wall and the sensor element. As the quantity of liquid changes inside the container, the capacitance also changes. The difference in capacitance can be used to measure the level of the liquid. In the case the container is an electrical insulator, a second sensor element must be inserted and the measurements are taken between the two elements. The most common capacitance sensors are continuous measurement type with an analog output of 4 mA to 20 mA, which falls in the standard for industrial automation [20], and sensors with a RS-232 or RS-485 digital output [21].

Sensors 2016, 16, 1517

5 of 20

Although it is an efficient type of sensor, it is also very expensive [22]. There are simpler and less costly versions of this sensor that just measure changes on a capacitance basis on the effect of touching one of the capacitor plates [23]. Good examples are capacitance touch screens and buttons. 3. FOG Level Detection: Implementation and Results Based on the previously studied sensors, three probes, based on three different sensors (conductivity, density and capacitance) with the specific purpose of detecting the FOG level on the grease trap part of the grease boxes, were developed. The main objective was to test and select the best probe to use in the grease box monitoring and management system. The development and test Sensors 2016, 16, 1517 of 20 was done in two phases: a first phase in laboratory and a second phase in a restaurant in 5partnership with thewas FOG management done in two phases:company. a first phase in laboratory and a second phase in a restaurant in partnership with the FOG management company.

Sensors 2016, Development 16, 1517 3.1. The Laboratory Environment and Test Bed

5 of 20

3.1. The Laboratory Development Environment and Test Bed

was done in two phases: a first phase in laboratory a second phaseain a restaurant in partnershipof the FOG As a test bed environment, a transparent greaseand box, allowing fast visual assessment with FOG management As aatest bed environment, transparent grease box, For allowing a fast visual assessment of the level as well asthe good control ofcompany. theafield tests, was built. the preliminary tests, mainly to assure FOG level as well as a good control of the field tests, was built. For the preliminary tests, mainly to the validation of Laboratory the readings and the prototype 3.1. The Development Environment andwater Test Bedtightness, a small dimensions box was built, as assure the validation of the readings and the prototype water tightness, a small dimensions box was shown in Figure 3. a testin bed environment, a transparent grease box, allowing a fast visual assessment of the built, asAs shown Figure 3. The results were visually validated, very important because varies in composition FOG as well asvisually a good control ofwhich the fieldis built. For the preliminary tests, mainly to Thelevel results were validated, which istests, verywas important because FOGFOG varies in composition and form. andassure form.the validation of the readings and the prototype water tightness, a small dimensions box was built, as shown in Figure 3. The results were visually validated, which is very important because FOG varies in composition and form.

Figure 3. Prototype test boxes.

Figure 3. Prototype test boxes. Figure 3. Prototype boxes. A data acquisition system was also developed andtest built, as shown in Figure 4. In the laboratory tests, the sensors readings were transmitted using a serial port and in stored in a 4. computer. A data acquisition system was also developed and built,(RS232) as shown Figure In the laboratory

A data acquisition system was also developed and built, as shown in Figure 4. In the laboratory

tests, the sensors werewere transmitted using serialport port (RS232) and stored in a computer. tests, the readings sensors readings transmitted using aa serial (RS232) and stored in a computer.

Figure 4. The data acquisition module. Figure 4. The data acquisition module.

Figure 4. The data acquisition module. In the field, the readings were sent by Short Message Service (SMS), to a Global System for In the field, the readings were sent by Short Message Service (SMS), to a Global System for Mobile Communications (GSM) gateway connected to the central system by means of a Universal Mobile Communications (GSM) gateway connected to the central system by means of a Universal Serial Bus (USB) port. Figure 5 illustrates the GSM messaging module [24,25]. Serial Bus (USB) port. Figure 5 illustrates the GSM messaging module [24,25].

Sensors 2016, 16, 1517

6 of 20

In the field, the readings were sent by Short Message Service (SMS), to a Global System for Mobile Communications (GSM) gateway connected to the central system by means of a Universal Serial Bus Sensors 2016, 16, 1517 6 of 20 (USB) Figure Sensors port. 2016, 16, 1517 5 illustrates the GSM messaging module [24,25]. 6 of 20

Figure 5. GSM SMS messaging module. Figure 5. 5. GSM GSM SMS SMS messaging messaging module. module. Figure

3.2. Conductivity Probe 3.2. Conductivity Probe 3.2. Conductivity Probe Because the conductivity principle is simple and can be used to build fairly inexpensive probes, Because the conductivity principle is simple and can be used to build fairly inexpensive probes, Because conductivity principle is simple and can bethe used to build fairly inexpensive probes, the first probethe was based on this principle. In the prototype, acquisition module receives readings the first probe was based on this principle. In the prototype, the acquisition module receives readings the first probe was based on whose this principle. In thevaries prototype, the acquisition module receives from seven metallic probes, conductivity according to the environment of waterreadings or FOG. from seven metallic probes, whose conductivity varies according to the environment of water or FOG. from seven metallic probes, whose on conductivity varies according the environment of acting water or The probes were located vertically the container wall, with thetoprobe in the bottom as The probes were located vertically on the container wall, with the probe in the bottom acting as FOG. The (water) probes were located on the container probe acting as reference and the othervertically six individually connectedwall, to anwith ADCthe input pininofthe thebottom microcontroller reference (water) and the other six individually connected to an ADC input pin of the microcontroller reference (water) andCorporation the other six, San individually ATmega328 (Atmel Jose, CA,connected USA) [26].to an ADC input pin of the microcontroller ATmega328 (Atmel Corporation , San Jose, CA, USA) [26]. ATmega328 (Atmel , San (full Jose,of CA, USA)all [26]. When the box Corporation is empty of FOG water), pins are connected to the 5 V reference and When the box is empty of FOG (full of water), all pins are connected to the 5 V reference and the value box is (maximum empty of FOG (fullfor of the water), all pins areAs connected the 5raises, V reference and have haveWhen the 1023 value 10 bits ADC). the FOGtolevel the probes will have the 1023 value (maximum value for the 10 bits ADC). As the FOG level raises, the probes will the 1023 value (maximum valueand for the 10abits ADC).due As the FOG of level raises,contact the probes become individually isolated, have 0 value, to lack electric withwill the become bottom become individually isolated, and have a 0 value, due to lack of electric contact with the bottom individually isolated, have a 0 this value, due toprinciple. lack of electric contact with the bottom reference reference probe. Figureand 6 illustrates working reference probe. Figure 6 illustrates this working principle. probe. Figure 6 illustrates this working principle.

Figure 6. Conductivity probes (in red) in a grease box. Figure 6. Conductivity probes (in red) in a grease box. Figure 6. Conductivity probes (in red) in a grease box.

In the laboratory tests, the conductivity probes were effective in detecting the vegetable oil that In the laboratory tests, the conductivity probes were effective in detecting the vegetable oil that was added to the water content of the grease box. In the field tests, conducted in a partner restaurant, was added to the water content of the grease box. In the field tests, conducted in a partner restaurant, the system was unable to obtain proper readings as all pins would present readings above 1000, even the system was unable to obtain proper readings as all pins would present readings above 1000, even with the probes apparently covered with FOG. After a careful analysis of the FOG trap, we concluded

Sensors 2016, 16, 1517

7 of 20

In the laboratory tests, the conductivity probes were effective in detecting the vegetable oil that was added to the water content of the grease box. In the field tests, conducted in a partner restaurant, Sensors 2016, 16, 1517 of 20 the system was unable to obtain proper readings as all pins would present readings above 1000,7even Sensors 2016, 16, 1517 7 of 20 with the probes apparently covered with FOG. After a careful analysis of the FOG trap, we concluded that in the small boxes of 50 L, the FOG does not accumulate in a uniform way, as with the oil in the that in the small boxes of 50 L, the FOG does not accumulate in a uniform way, as with the oil in the thattests, in thebut small boxesthe of kitchen 50 L, thefat FOG not accumulate a uniform as with oil water in the lab instead, anddoes oil residues tend to in form blobs ofway, various sizesthe with lab tests, but instead, the kitchen fat and oil residues tend to form blobs of various sizes with water lab tests, but instead, the kitchen fat and oil residues tend to form blobs of various sizes with water between, thus not allowing for true electric isolation of the probes. between, thus not allowing for true electric isolation of the probes. between, thus not allowing for true electric isolation of the probes. 3.3. 3.3. Density Density Probe Probe 3.3. Density Probe The of the 7) was using aa buoy The prototype prototype of the density density probe probe (Figure (Figure 7) was implemented implemented using buoy with with aa vertical vertical rod rod The prototype of theThe density probe (Figure 7)changes was implemented using athe buoy withbox, a vertical rod connected to a load cell. buoy detects density in the content of grease connected to a load cell. The buoy detects density changes in the content of the grease box, activating activating connected to athought load cell. The buoy detects density changesrod. in the content of the grease box, activating the load cell cell the pressure force of of the the vertical vertical then the load thought the pressure force rod. The The signal signal from from the the load load cell cell is is then the load cell thought the pressure force of(AD623, the vertical rod.Devices, The signal from the load cell is then amplified by an instrumentation amplifier Analog Inc., Norwood, MA, USA) amplified by an instrumentation amplifier (AD623, Analog Devices, Inc., Norwood, MA, USA) [27] [27] amplified by anininstrumentation amplifier (AD623, Analog Devices, Inc., Norwood, MA, USA) [27] and to aa digital digital signal signal by an an ADC. ADC. and converted converted in to by and converted in to a digital signal by an ADC.

Figure 7. Density measurement with a buoy and a load cell. Figure 7. Figure 7. Density measurement with a buoy and a load cell.

The prototype was later tested in a restaurant, in a real scenario. The microcontroller of the The prototype prototype wasprogramed later tested testedtoin inrun restaurant, in aaand real scenario. The microcontroller of the The was later aa restaurant, in real scenario. The microcontroller of the acquisition module was daily readings send them by SMS using the integrated acquisition module wasthe programed toconcluded run daily daily readings readings and send send them by SMS using integrated acquisition module was programed run them SMS using the the integrated GSM module. During tests, weto that the and sensor did not by have enough sensitivity to GSM module. During the tests, we concluded that the sensor did not have enough sensitivity to GSM module. Duringthe thedensity tests, we concluded thatdensity the sensor did not sensitivity to differentiate between of water and the of FOG. Thehave lack enough of sensitivity is most differentiate between the density of water and the density of FOG. The lack of sensitivity is most differentiate between the density of addition, water andthis theprototype density of FOG. The lack of sensitivity is as most likely due to the mechanical parts. In uses expensive components, such an likely due due to to the parts. addition, this prototype expensive such as as an an likely the mechanical mechanical parts. In addition, this prototype uses expensive components, components, such instrumentation amplifier, and for In those reasons this method uses of measurement was unsuccessful. instrumentation amplifier, and for those reasons this method of measurement was unsuccessful. instrumentation amplifier, and for those reasons this method of measurement was unsuccessful. 3.4. Capacitance Probe 3.4. Capacitance Probe The capacitance probe was implemented as a pair of parallel plates, forming a capacitor, The capacitance was implemented pair parallel plates, forming capacitor, capacitance probe was as aofpair of 8. parallel plates, aforming a connected capacitor, connected to a simpleprobe oscillator, asimplemented describedas inaFigures 7 and to a simpleto oscillator, described Figures 7inand 8. 7 and 8. connected a simpleas oscillator, asin described Figures

Figure 8. 8. Capacitive probe’s oscillator circuit. Figure Figure 8. Capacitive probe’s oscillator circuit.

The oscillator output frequency depends of the values of the two resistances (R1 and R2) and the 0.559 The oscillator frequency depends of the theUnder two resistances (R1 and principle, R2) and the capacitor. It can beoutput estimated by the formula 𝑓 =values of [28]. the capacitance a 𝑅∗𝐶 0.559 capacitor. It can be estimated by the formula 𝑓 = [28]. Under the capacitance principle, change in the content of the grease box will induce a change in the capacitance of the capacitor formeda 𝑅∗𝐶

change in the of the grease in box will induce a changeof inthe theoscillator. capacitance of the capacitor formed by the pair of content plates and a change the output frequency

Sensors 2016, 16, 1517

8 of 20

The oscillator output frequency depends of the values of the two resistances (R1 and R2) and the capacitor. It can be estimated by the formula f = 0.559 R∗C [28]. Under the capacitance principle, a change Sensors 2016, 16, 1517 8 of 20 in the content of the grease box will induce a change in the capacitance of the capacitor formed by the pair of plates and a change in the output frequency of the oscillator. In the laboratory tests, it was verified that the changes in capacitance was very small and easily Sensors 16, 1517 tests, it was verified that the changes in capacitance was very small and 8 of 20easily In the2016, laboratory contaminated by the high capacitance of the cable (30 cm cable) connecting the plates to the oscillator. contaminated by the high capacitance of the cable (30 cm cable) connecting the plates to the oscillator. In the laboratory was verified that the changes was very small and easily was A new prototype was tests, built itwith two elements made in ofcapacitance aluminum tube. The oscillator A new prototype was built with two elements made of aluminum tube. The oscillator was miniaturized contaminated high capacitance the cable (30 connecting the reference plates to the oscillator. miniaturized and by thethecircuit board wasofdesigned tocm becable) placed inside the element (earth) and the circuit board was designed to be placed inside the reference element (earth) without cables, as A new prototype was built with two elements made of aluminum tube. The oscillator was without cables, as shown in Figure 9. shown in Figure 9. miniaturized and the circuit board was designed to be placed inside the reference element (earth) without cables, as shown in Figure 9.

Figure 9. Circuit oscillator Figure 9. Circuit oscillator of of the the second second prototype. prototype. Figure 9. Circuit oscillator of the second prototype. Figure 9. Circuit oscillator of the second prototype.

Figure illustrates the oscillator design of the second prototype, based on a chip. timer To Figure 99illustrates the oscillator design of the second prototype, based on on a timer Tochip. protect Figure 9 illustrates the oscillator design of the second prototype, based a timer chip. To protect the aluminum elements, tube glued and sealedaround around elements used, as the aluminum aelements, plastic atube glued and sealed around the elements was used, as shown protect theelements, aluminum aplastic plastic tube glued and sealed thethe elements was was used, as in shown in Figures 10 and shown in 11.11. Figures 10Figures and 11.10 and

Figure Capacitanceprobe probewith with the disassembled. Figure 10.10. Capacitance the plastic plasticcontainer container disassembled.

Figure 10. Capacitance probe with the plastic container disassembled.

Figure 11. probefully fullyassembled. assembled. Figure 11.Capacitance Capacitance probe

The oscillator is based on a CMOS timer chip [29] in order to reduce the energy consumption as well to facilitate the configuration of Capacitance the output signal. Figure 11. probeThe fullycapacitance assembled.of the probe and the wires

The oscillator is based on a CMOS timer chip [29] in order to reduce the energy consumption as well to facilitate the configuration of the output signal. The capacitance of the probe and the wires

Sensors 2016, 16, 1517

9 of 20

Sensors Sensors 2016, 2016, 16, 16, 1517 1517

99 of of 20 20

The oscillator is based on a CMOS timer chip [29] in order to reduce the energy consumption as well to facilitate the configuration of the output signal. The capacitance of the probe 1.38 and 1.38 the wires can can ,, in can be be calculated calculated as as aa function function of of the the frequency frequency in in the the oscillator’s oscillator’s output output as as 𝐶𝐶 = = 1.38 in which which C C 2100000∗𝑓 2100000∗𝑓 be calculated as a function of the frequency in the oscillator’s output as C = 2100000∗ f , in which C is is probe’s capacitance and is oscillator’s frequency. is the the probe’s capacitance and is the the oscillator’s frequency. the probe’s capacitance and f isffthe oscillator’s frequency.

3.5. Testing the Capacitance Probe 3.5. Testing Testingthe theCapacitance CapacitanceProbe Probe The The laboratory laboratory tests tests were were conducted conducted using using the the box box in in Figure Figure 12 12 and and by by fully fully submerging submerging the the probein inwater waterand andthen thenadding adding vegetable vegetable oil oil to to the the probe’s probe’s compartment compartment in in order order to to have have the the water water probe progressively replaced by oil. For these specific tests, we did not use transparent boxes, but we knew progressively replaced by oil. For these specific tests, we did not use transparent boxes, but we knew progressively replaced by oil. the box capacity as well as the amount of oil or FOG that was inserted into the box. Because the box thebox boxcapacity capacityas aswell wellasasthe theamount amountofofoiloilororFOG FOG that was inserted into box. Because box that was inserted into thethe box. Because thethe box is is full, knowing how much FOG inserted, knew much water in the is always always full, by knowing how much FOG was inserted, we also also knew how much water was inbox the always full, by by knowing how much FOG waswas inserted, we we also knew howhow much water was was in the box respective levels. box and and their their respective levels. and their respective levels.

Figure prototype testing. Figure 12. 12. Test Testbox boxused usedfor forin inlab labprototype prototypetesting. testing.

In of 11 Hz as the oil was added to box are In Figure Figure 13, 13, the the samples retrieved at sampling rate ofof asas thethe oiloil was added to the the boxbox are In Figure 13, thesamples samplesretrieved retrievedat ataaasampling samplingrate rate 1Hz Hz was added to the displayed. displayed. are displayed.

Figure13. 13. Laboratory Laboratory tests tests results. results. Figure

The first sample shows oscillation frequency the box water and, Thefirst firstsample sample shows the oscillation frequency with thefull box full of ofand, water and, from the the The shows thethe oscillation frequency with with the box of full water from the from previous previous cited function, it is possible to estimate the probe’s capacitance in water as 94 pF. After the previous cited function, it is possible to estimate the probe’s capacitance in water as 94 pF. After the cited function, it is possible to estimate the probe’s capacitance in water as 94 pF. After the second second sample, a liter of vegetable oil was added, filling the box retention capacity, at a constant rate second sample, a liter of vegetable oil was added, filling the box retention capacity, at a constant rate sample, a liter of vegetable oil was added, filling the box retention capacity, at a constant rate of 0.5 L of of 0.5 0.5 LL per per minute. minute. At At the the 23º 23ºsample, sample, the the oil oil reached reached the the probe, probe, after after which which the the oscillation oscillation frequency frequency started started to to increase. increase. At At the the 125ª 125ªsample, sample, the the probe probe was was completely completely immersed immersed in in oil oil and and although although more more oil oil was was added added to to the the box box in in the the following following samples, samples, the the frequency frequency value value did did not not change. change. The The probe’s probe’s

Sensors 2016, 16, 1517

10 of 20

per minute. At the 23o¯ sample, the oil reached the probe, after which the oscillation frequency started Sensors 2016, 1517 10 20 to increase. the 125a¯ sample, the probe was completely immersed in oil and although more Sensors 2016, 16, 16,At 1517 10 of ofoil 20 was added to the box in the following samples, the frequency value did not change. The probe’s capacitance when immersed in oil is about 56 presenting 38 pF difference to when it is capacitance pF, immersed capacitancewhen whenimmersed immersedin inoil oil is is about about 56 56 pF, pF, presenting presentingaaa38 38 pF pF difference differenceto to when when it it is is immersed immersed in water. in water. in water. To verify the effect probe’s temperature variation on the frequency, the To ofof probe’s temperature variation on the frequency, the previous setup Toverify verifythe theeffect effect of probe’s temperature variation on output the output output frequency, the previous previous ◦ ◦ setup with the water to 25 and down 10 was used. 14 with water to 25 C progressively cooled cooled down to 10 Cto used. 14 shows setupthe with the heated water heated heated toand 25 °C °C and progressively progressively cooled down towas 10 °C °C wasFigure used. Figure Figure 14 shows that the temperature affects the oscillation frequency on a predictable way. The frequency that thethat temperature affects the oscillation frequency on a predictable way. Theway. frequency increase shows the temperature affects the oscillation frequency on a predictable The frequency increase the is effect in dielectric while thewhile temperature decreases decreases is a cumulative effect due to the due changing the dielectric of increase while the temperature temperature decreases is aa cumulative cumulative effect due to to the theinchanging changing in the theconstant dielectric constant of the water and the variation of the component’s values. the water and the variation of the component’s values. constant of the water and the variation of the component’s values.

Figure Figure 14. 14. Frequency Frequency variation. variation.

After the laboratory tests, probe was tested on the transparent box, installed on real After the the laboratory laboratory tests, tests, the the probe probe was was tested tested on on the the transparent transparent box, box, installed installed on on real real After the environment of a partner restaurant. The data acquisition module was programmed to acquire and environment of aa partner data acquisition module waswas programmed to acquire and environment partnerrestaurant. restaurant.The The data acquisition module programmed to acquire transmit frequency readings in 66 hours periods using SMS messages. Figure 15 represents the transmit frequency readings in hours periods using SMS messages. Figure 15 represents the and transmit frequency readings in 6 hours periods using SMS messages. Figure 15 represents the received values. The sampling frequency of six hours was established based on the regular working received values. values. The The sampling sampling frequency frequency of of six six hours hours was was established established based based on on the the regular regular working working received schedule of restaurant. schedule of of aaa restaurant. restaurant. schedule

Figure results in real production environment. Tests results results in in aaa real real production productionenvironment. environment. Figure 15. 15. Tests Tests

The the graphic in Figure 15 marks the moment when the probe was enclosed in The vertical vertical line line on on probe was enclosed in The vertical line on the the graphic graphicin inFigure Figure15 15marks marksthe themoment momentwhen whenthe the probe was enclosed oil, after which the readings values are clearly superiors. The down peaks in the graph are caused by oil, after which the readings values are clearly superiors. The down peaks in the graph are caused by in oil, after which the readings values are clearly superiors. The down peaks in the graph are caused the the usage usage of of hot hot water water that that heats heats the the entire entire box box and and causes causes the the oscillation oscillation frequency frequency to to drop drop as as the the temperature rises. temperature rises. For For aa better better understanding understanding of of the the factors factors affecting affecting the the results, results, aa temperature temperature sensor sensor was was added added to the probes, as shown in Figures 16 and 17, based on the DS18B20 chip (Maxim Integrated, San to the probes, as shown in Figures 16 and 17, based on the DS18B20 chip (Maxim Integrated, San Jose, Jose,

Sensors 2016, 16, 1517

11 of 20

by the usage of hot water that heats the entire box and causes the oscillation frequency to drop as the temperature rises. SensorsFor 2016, 16, 1517 1517understanding of the factors affecting the results, a temperature sensor was added 11 of of to 20 a better Sensors 2016, 16, 11 20 Sensors 2016, 16, 1517 11 of 20 the probes, as shown in Figures 16 and 17, based on the DS18B20 chip (Maxim Integrated, San Jose, CA, USA) USA) [30], [30],which whichwas wasconnected connectedtoto toanan anacquisition acquisition module with an LCD for local monitoring of CA, USA) [30], which was connected acquisition module with LCD local monitoring of module with anan LCD forfor local monitoring of the CA,temperature USA) [30], which was connected to an acquisition module with an LCD for local monitoring of the inside the box. the temperature inside the box. temperature inside the box. the temperature inside the box.

Figure 16. 16. Digital Digital temperature temperature sensor sensor with with aa waterproof waterproof container. container. container. Figure Figure 16. Digital temperature sensor with a waterproof container.

Figure 17. 17. Transparent Transparent grease grease box box for for temperature temperature monitoring. monitoring. Figure Figure 17. 17. Transparent Transparent grease Figure grease box box for for temperature temperature monitoring. monitoring.

Figure 18 18 represents represents one one of of the the tests, tests, in in which, which, even even with with some some noise, noise, the the effect effect of of the the Figure Figure represents oneone of the in which, even with some noise, theisnoise, effect ofthe theeffect temperature Figure 18 18 represents of tests, theacquired tests, infrom which, even with some of the temperature in the frequency reading the capacitance probe visible. temperature in the frequency reading acquired from the capacitance probe is visible. in the frequency reading acquired fromacquired the capacitance is visible. temperature in the frequency reading from theprobe capacitance probe is visible.

Figure 18. 18. Temperature Temperature influence influence in in aa real real production production test. test. Figure Figure influence in in aa real real production production test. test. Figure 18. 18. Temperature Temperature influence

To eliminate eliminate the the noise noise in in the the signal signal acquired acquired from from the the capacitance capacitance probe, probe, aa filter filter in in the the reception reception To To eliminate the noise in the signal acquired from the capacitance probe, a filter in the reception program, based on on smoothing function, was implemented. implemented. Figureprobe, 19 shows shows theingraphs graphs of the the To eliminate theaanoise in the signal acquired from the capacitance a filter the reception program, based smoothing function, was Figure 19 the of program, based on a smoothing function, was implemented. Figure 19 shows the graphs of the acquired signal before and after applying the smoothing function. program, based on a smoothing function, was implemented. Figure 19 shows the graphs of the acquired signal before and after applying the smoothing function. acquired signal before and after applying the smoothing function. acquired signal before and after applying the smoothing function.

Sensors 2016, Sensors 2016, 16, 16, 1517 1517 Sensors 2016, 16, 1517

12 12 of of 20 20

12 of 20

Figure19. 19.Smoothing Smoothing the the capacitive capacitive probe Figure Smoothing the capacitive probe signal. Figure 19. probesignal. signal.

The analysis of the graphs in Figure 19 lead to the conclusion that, using the filtered data, values The analysis of the graphs in Figure 19 lead to the conclusion that, using the filtered data, values exceeding 29 kHz confidently indicate the presence of FOG on the probe. Applying the same criteria exceeding 29 kHz confidently indicate the presence of FOG on the probe. Applying the same criteria to the raw data, there are two false positives, on sample 407 and sample 563, caused by the noise. An to the raw onon sample 407407 and sample 563,563, caused by the An raw data, data,there thereare aretwo twofalse falsepositives, positives, sample and sample caused by noise. the noise. alternative way to filter false positives without the use of averages or other smoothing functions, alternative wayway to filter false positives without the of averages other functions, An alternative to filter false without theuse use averagesor or other smoothing smoothing functions, which require historical data, ispositives to use a certain number of of consecutive readings above a predefined which require historical data, is to use a certain number of consecutive readings above a predefined value before triggering the alarm of the presence of FOG. value before triggering the alarm alarmusing of the the presence of FOG. FOG. triggering the of presence of Several probes were built metallic elements aluminum, copper and steel; however, more copper steel; Several probes built using elements which aluminum, more important than thewere metal, is the sizemetallic of the elements, influences theand values of however, the readings. important than the metal, is the size of the elements, which influences the values of the readings. which influences Bigger elements yield higher capacitances and lower oscillation frequency.the values of the readings. and lower lower oscillation oscillation frequency. frequency. Bigger elements yield higher capacitances and 3.6. Production Capacitive Probe 3.6. Production Capacitive Probe The full production capacitive probe was built and integrated in a monitoring system with a The full production builtsection and integrated in a monitoring system probe similar design to those capacitive described in the was previous for the prototype. The format andwith the a similar design totothose described section for the prototype. The format and the materials materials were chosen in order in to the maximize performance, ease ofthe construction and low cost. design those described in previous the previous section for prototype. The format and the Forwere the a order stainless steel tube with 22 mm diameter, cut with cm was used. were chosen inelements, order performance, ease of in construction and lowa 2cost. materials chosentoinmaximize to maximize performance, ease of construction andlength low cost. Elements a bigger length steel would have bigger detection areas, cut making to detect, For the with in diameter, diameter, cm length length waswith used. elements, a stainless tube with 22 mm in with ita 2hard cm was used. precision, if the FOG has reached a predefined level.detection Elements areas, with a making smaller length have with an Elements a bigger length would have bigger to detect, with it hardwould oscillation frequency too high and incompatible with a low clock frequency microcontroller. The precision, if the the FOG FOG has hasreached reachedaapredefined predefinedlevel. level.Elements Elements with a smaller length would have with a smaller length would have an probe’s container was built with plastic tub 25 mmwith in diameter and 10frequency cm in length. an oscillation frequency too high and incompatible with lowclock clock frequency oscillation frequency too high and incompatible a alow microcontroller. The connecting electric wire soldered and the container glued and waterproof probe’sA container was built plastic tub 25 mm in and 10 was built with withis plastic tubto 25each mmelement in diameter diameter and 10 cm cm in inislength. length. sealed. In Figureselectric 20 and wire 21, the before soldering and and fully finished is shown. When A connecting is probe soldered to each element sealing theand container is glued and waterproof constructing the probes, it is very important to have quality control and assure the compliance with sealed. In Figures 20 and 21, the probe before soldering and sealing and fully finished is shown. When the specifications, as small differences in the size of the elements will lead to big differences in the constructing the probes, it is very important to have quality control and assure the compliance with output frequency. the specifications, as small differences in the size of the elements will lead to big differences in the output frequency. frequency.

Figure 20. The probe before soldering and sealing.

Figure 20. The soldering and and sealing. sealing. Figure 20. The probe probe before before soldering

Sensors 2016, 2016, 16, 1517 1517 Sensors Sensors 2016,16, 16, 1517

13 of of 20 13 13 of20 20

Figure 21. The final probe. Figure Figure 21. 21. The Thefinal final probe. probe.

In ATiny13a microcontroller microcontroller (Atmel (Atmel Corporation, In order order to to manage manage the the probe’s probe’s readings, readings, an an ATiny13a ATiny13a microcontroller (Atmel Corporation, San San Jose, CA, USA) [31], as represented in Figure 22, was added. [31], as as represented represented in in Figure Figure 22, 22, was was added. added. Jose, CA, USA) [31],

Figure Theprobe probewith withan microcontroller. Figure 22. 22. The The probe with an integrated integrated ATiny13a ATiny13a microcontroller. microcontroller.

The The microcontroller microcontroller was was programmed programmed to to supply supply energy energy to to the the oscillator oscillator using using the the PB0 PB0 pin, pin, wait wait The microcontroller was programmed to supply energy to the oscillator using the PB0 pin, wait until the oscillator stabilizes, and count the number of pulses in the PB1 pin during 100 ms, after until the oscillator stabilizes, and count the number of pulses in the PB1 pin during 100 ms, after until the oscillator stabilizes, and count the number of pulses in the PB1 pin during 100 ms, after which which the frequency with 10 is the in pin which the oscillation oscillation frequency with 10 Hz Hz resolution resolution is obtained. obtained. Then, theinvoltage voltage inusing pin PB3 PB3 the oscillation frequency with a 10 Hzaaresolution is obtained. Then, theThen, voltage pin PB3 the using the ADC, connected to a thermistor in order to have an estimative of the probe’s internal using connected the ADC, to connected to ainthermistor in order to have of an the estimative of the probe’s internal ADC, a thermistor order to have an estimative probe’s internal temperature, is temperature, is read. The values are then converted to text and sent to the acquisition module by the temperature, is read. The values are then converted to text and sent to the acquisition module by the read. The values are then converted to text and sent to the acquisition module by the pin PB2, using pin PB2, aa software UART port, does have PB2, using using software implementation implementation of UART port, as as the the microcontroller, microcontroller, does not not have aa apin software implementation of a UART port,of asaathe microcontroller, does not have a UART hardware UART hardware module. The microcontroller was chosen for its small size and low cost and was UART hardware module. The microcontroller forlow its small sizewas andprogrammed low cost andusing was module. The microcontroller was chosen for its was smallchosen size and cost and programmed using the C language. programmed using the C language. the C language. For For the the tests tests process, process, an an acquisition acquisition module module with with storage capacity, in order order to to store store the the reading reading For the tests process, an acquisition module withstorage storagecapacity, capacity, in in order to store the reading and automate data collection in the laboratory was built. In Table 1, the probe’s readings at and automate data collection in the laboratory was built. In Table 1, the probe’s readings at several and automate data collection in the laboratory was built. In Table 1, the probe’s readings at several several temperatures when in contact with the air are presented. temperatures when in contact with the air are presented. temperatures when in contact with the air are presented. Using the results in Table 1, the following compensation formula in order to compensate the Table at Table 1. 1. The The probe’s probe’sreadings at different different temperatures. temperature variation was designed: C = f +readings ((CAL − ADC) × temperatures. 25), in which “C” is the compensated Temperature (° C) ADC Frequency (Hz) value, “f ” is the read frequency, “CAL” value, and “ADC” Temperature (° C) is the calibration ADC Frequency (Hz) is the value read from ◦ 10 704 87,303 the ADC. The probe is calibrated ADC value of 608, by applying the compensation 10 at 18 C, with an704 87,303 696 87,026 11 696are shown in Table 87,026 formula, C = f + ((608 − ADC)11 × 25), and the results 2. Compensated results from 684 12 684 86,873 readings are shown in Table 1.12 Table 2 results are obtained and it can 86,873 be verified that the compensation 13 13 14 14 15 15

671 671 655 655 639 639

86,545 86,545 85,988 85,988 85,670 85,670

Sensors 2016, 16, 1517

14 of 20

formula provides Sensors 2016, 16, 1517 a proper approximation to the noise margin, considering that in similar conditions, 14 of 20 due to noise, the output frequency can vary by about 1 kHz. 17 624 85,288 Table18 1. The probe’s readings 608at different temperatures. 84,937 21 560 83,427 Temperature (◦ C) ADC Frequency (Hz) 24 526 82,833 10

704

87,303

Using the results in Table compensation formula 111, the following 696 87,026 in order to compensate the 12 684 temperature variation was designed: C = f + ((CAL − ADC) × 25),86,873 in which “C” is the compensated 13 671 86,545 value, “f” is the read frequency, “CAL” is the calibration value, and “ADC” is the value read from 14 655 85,988 the ADC. The probe is calibrated by applying the compensation 15 at 18 °C, with an 639ADC value of 608, 85,670 formula, C = f + ((608 − ADC) ×1725), and the results 624 are shown in Table 85,2882. Compensated results from 608 are obtained 84,937 readings are shown in Table18 1. Table 2 results and it can be verified that the 21 560 83,427 compensation formula provides a proper approximation to the noise margin, considering that in 24 526 82,833 similar conditions, due to noise, the output frequency can vary by about 1 kHz. Table Table 2. 2. Compensated Compensated results results from from readings readings in in Table Table1.1. ◦ C) Temperature Temperature(°(C) 10 10 11 11 1212 1313 1414 1515 1717 1818 2121 24 24

ADC ADC 704 704 696 696 684 684 671 671 655 655 639 639 624 624 608 608 560 560 526 526

Frequency Frequency(Hz) (Hz) 87,303 87,303 87,026 87,026 86,873 86,873 86,545 86,545 85,988 85,988 85,670 85,670 85,288 85,288 84,937 84,937 83,427 83,427 82,833 82,833

Compensated(Hz) (Hz) Compensated 84,903 84,903 84,826 84,826 84,973 84,973 84,970 84,970 84,813 84,813 84,895 84,895 84,888 84,888 84,937 84,937 84,627 84,627 84,883 84,883

In Figure Figure 23 23 and and Table Table 2, 2, the the effect effect of ofthe thecompensation compensation formula formula on on removing removing the the effect effect of of the the In temperature in in the the oscillation oscillation frequency frequencyisisshown. shown. temperature

Figure 23. 23. Raw oscillation frequency frequency reading reading and and compensated compensated frequency frequency reading. reading. Figure

The firmware firmwarebuilt builtfor forthe thetests testsused used most available memory space program in The most of of thethe available memory space for for program codecode in the the microcontroller (1 kB). To implement the additional functionalities and to simplify the microcontroller (1 kB). To implement the additional functionalities and to simplify the communication communication process between the probes and the acquisition module, the ATiny13a microcontroller was replaced by an ATiny25 (Atmel Corporation, San Jose, CA, USA) [32], as shown in Figure 24.

Sensors 2016, 16, 1517

15 of 20

process between the probes and the acquisition module, the ATiny13a microcontroller was replaced by an ATiny25 (Atmel Sensors 2016, 16, 1517 Corporation, San Jose, CA, USA) [32], as shown in Figure 24. 15 of 20

Figure 24. The microcontroller. The probe probe with the ATiny25 microcontroller.

The ATiny25 microcontroller (Atmel Corporation, San Jose, CA, USA) has a bigger code storage The ATiny25 microcontroller (Atmel Corporation, San Jose, CA, USA) has a bigger code storage capacity (2 kB) and a Universal Serial Interface (USI) hardware module, capable of using several capacity (2 kB) and a Universal Serial Interface (USI) hardware module, capable of using several protocols [32,33]. The selected protocol was I2C, which uses two wires: a clock line and a data line, in protocols [32,33]. The selected protocol was I2C, which uses two wires: a clock line and a data line, in half-duplex [34]. half-duplex [34]. Commonly known as Two Wire Interface, the I2C protocol supports several master and slave in Commonly known as Two Wire Interface, the I2C protocol supports several master and slave one single bus. It was created by Philips and specially designed for low speed communication in one single bus. It was created by Philips and specially designed for low speed communication between electronic devices. Intel, in 1995, designed the SMBus, based on I2C, but with more restricted between electronic devices. Intel, in 1995, designed the SMBus, based on I2C, but with more restricted tolerances, allowing it to be used with I2C devices in SMBus, with small adjustments [35]. In the tolerances, allowing it to be used with I2C devices in SMBus, with small adjustments [35]. In the original specification, the I2C protocol had a maximum clock speed of 100 kHz, which is now 5 MHz original specification, the I2C protocol had a maximum clock speed of 100 kHz, which is now 5 MHz in version 4, released in 2012 [36]. The clock speed, defined by the master device, can have an arbitrary in version 4, released in 2012 [36]. The clock speed, defined by the master device, can have an arbitrary value, no higher than the maximum limit of the slowest slave device in the bus. In the current case of value, no higher than the maximum limit of the slowest slave device in the bus. In the current case the capacitance probe, the speed is directly proportional to the clock speed of the microcontroller, i.e., of the capacitance probe, the speed is directly proportional to the clock speed of the microcontroller, the higher the clock frequency of the internal oscillator, the higher the maximum speed of the USI i.e., the higher the clock frequency of the internal oscillator, the higher the maximum speed of the USI module and also the higher the power usage. When using several master devices on the same bus, module and also the higher the power usage. When using several master devices on the same bus, there is the possibility of two masters trying to initiate the communication at the same time, so I2C there is the possibility of two masters trying to initiate the communication at the same time, so I2C uses uses the Arbitration method to avoid collisions. For the addresses, I2C uses seven bits and reserves the Arbitration method to avoid collisions. For the addresses, I2C uses seven bits and reserves 16 16 addresses, thus allowing the usage of 112 slave devices with each master device [37]. I2C is a addresses, thus allowing the usage of 112 slave devices with each master device [37]. I2C is a simple simple protocol and is used worldwide as an industry standard [34]. protocol and is used worldwide as an industry standard [34]. The default address for the probe is 0 × 26 and can be changed by the master in a scenario with The default address for the probe is 0 × 26 and can be changed by the master in a scenario with several probes on the same bus. The commands implemented in the probe’s firmware are presented several probes on the same bus. The commands implemented in the probe’s firmware are presented in in Table 3. Command to configure and operate the probe Table 3. Table 3. Command to configure and operate the probe Table 3. Table 3. Command to configure and operate the probe. Table 3. Command to configure and operate the probe. Command Command (byte) (byte) 0× 0 ×6161 0× 0 ×6565 0 × 63 0 × 63 0 × 6B 0 0 ×× 6C6B 00 ××746C 0× 0 ×7874 0 × 43 0 ×7378 0×

0 × 43 0 × 73

Parameters Operation Description Parameters (sent bytes) (sent bytes) Aquire sample 0 Aquire sample 0 Change I2C address 1 Change I2C address 1 Define CAL 2 Define CAL 2 Define k 1 Define k 1 Read configuration 0 Read temperature 0 Read configuration 0 Calibrate 0 Read temperature 0 Turn compensation on/off 1 Calibrate 0 Read serial number 0 Turn compensation on/off 1 Read serial number 0 Operation Description

Reply Reply (received bytes) (received bytes) 6 6 1 1 2 2 1 1 4 4 2 2 2 1 2 8 1 8

In Figure 25, the communication of a reading request of a sample, as captured by a logic analyzer is represented [38]. The Probes address, 0 × 26, in the beginning of the message will inform the other devices on this same bus to ignore the message.

Sensors 2016, 16, 1517

16 of 20

In Figure 25, the communication of a reading request of a sample, as captured by a logic analyzer is represented [38]. The Probes address, 0 × 26, in the beginning of the message will inform the16other Sensors 2016, 16, 1517 of 20 devices on16, this same bus to ignore the message. Sensors 2016, 1517 16 of 20

Figure 25. Clock line and data line of a sample acquisition request to a probe with the 0 × 26 address. Figure 25. Clock data line line of of aa sample sample acquisition acquisition request request to to aa probe probe with withthe the00× × 26 Figure 25. Clock line line and and data 26 address. address.

After this request, the acquisition module will wait the necessary time for the probe to have the After request, module will wait the forline, theso probe to have the data readythis to send, as inthe theacquisition I2C protocol only the master can necessary change thetime clock the slave device After this request, the acquisition module will wait the necessary time for the probe to have the data ready to send, as in thewhen I2C protocol only master can change theperiod, clock line, so the slave device has no means of signaling the sample is the ready. After the waiting the master requests an data ready to send, as in the I2C protocol only the master can change the clock line, so the slave device has no means signaling when the sample is ready. After the waiting period, thethe master requests an answer to the of probe, as represented in Figure 26. This request is initiated with probe’s address, has no means of signaling when the sample is ready. After the waiting period, the master requests an answer probe, as the represented in Figure This requesttoissend initiated probe’s address, so only to thethe probe with 0 × 26 address has 26. authorization data,with afterthe which six bytes are answer to the probe, as represented in Figure 26. This request is initiated with the probe’s address, so only the probe with the (Table 0 × 26 4). address has authorization to send data, after which six bytes are received with the meaning so only the probe with the 0 × 26 address has authorization to send data, after which six bytes are received with the meaning (Table 4). received with the meaning (Table 4). Table 4. Bytes received after a sample reading request. Table 4. Bytes received after a sample reading request. Byte 1 Table 4. Bytes received 2 after a sample 3 reading request. 4 Byte in 1 2 3 4 Value 0 × 00 0 × 02 0 × F4 0 × 01 1 2 3 4 Figure 26 Value Byte in 0 × 00 0 × 02 0 × F4 0 × 01 Frequency Figure 26 Value in Figure 26 0 × 00 0 × 02 0 × F4 0 × 01 Frequency (MSB) Frequency ADC Frequency (MSB) Frequency Frequency ADC (LSB) (LSB) Frequency Frequency (MSB) Frequency ADC (LSB)

5 5 0 × F2 5 0 × F2 0 × F2 ADC ADC ADC

6 6 0 × 16 6 0 × 16 0 × 16 Check Check Check

Figure Probe’s reply Figure 26. 26. Probe’s reply to to the the sample sample acquisition acquisition request. request. Figure 26. Probe’s reply to the sample acquisition request.

In the theprobe, probe,thethe frequency is read to a four-byte variable, ofonly which only three bytes are In frequency is read to a four-byte variable, of which three bytes are effectively In the probe, the frequency is read to a four-byte variable, of which only three bytes are effectively used, and the temperature, as ADC, read by the ADC, stored invariable. a two-byte variable. Because used, and the temperature, as read by the is stored in aistwo-byte Because I2C can only effectively used, and the bits temperature, as readso by ADC, stored ininto a two-byte variable. Because I2C can only send eight simultaneously, is necessary to divide the variables intoWhen eight-bit send eight bits simultaneously, so it is necessary toitthe divide theisvariables eight-bit blocks. the I2C can only send eight bits simultaneously, so it is necessary to divide the variables into eight-bit blocks. When the “usiTwinTransmitByte (char c)” called, the byte sent as parameter is stored “usiTwinTransmitByte (char c)” is called, the byte sent as parameter is stored in a buffer and sentinasa blocks. When the (chara c)” is communication. called, the byte sent as parameter is stored inas a bufferasand as“usiTwinTransmitByte soon as athe master request data The variable “soma” is in used soon the sent master request data communication. The variable “soma” is used as a checksum, order buffer and asent as provide the request data communication. variable “soma” is usedthe as a checksum, inasorder to a way to avalidate the quality, after which to provide way tosoon validate themaster communication quality, aftercommunication which theThe received data are processed in athe checksum, in order to provide a way to validate the communication quality, after which the received data are processed in the acquisition module. acquisition module. received are serial processed in the acquisition module. The data probe’s serial number, address and calibration calibration and and configuration configuration values values are are stored stored in in the the The probe’s number, address and The probe’s serial number, address and calibration and configuration values are stored in the microcontroller EEPROM. These values are read and used each time the probe is switched on. When microcontroller EEPROM. These values are read and used each time the probe is switched on. When microcontroller These values arethe read and used each time the probe is switched on. When the command command 00EEPROM. × 78 to probe, reading of temperature value with the the ADC ADC and the × 78 isis sent sent to the the probe, the reading of the the temperature value with and the command 0 × 78 is sent to the probe, the reading of the temperature value with the ADC and stored on the 0 × 20 and 0 × 30 addresses of the EEPROM is executed. If the compensation mode is stored on the 0 × 20 and 0 × 30 addresses of the EEPROM is executed. If the compensation mode is stored on the 0 × 20 and 0 × 30 addresses of the EEPROM is executed. If the compensation mode is activated, frequency value is adjusted before being sent. To confirm the update of the calibration activated, the frequency value is adjusted before being sent. To confirm the update of the calibration activated, frequency is adjustedmodule. before being sent. the To confirm the update the value, this thisthe value is sent sent to tovalue the acquisition acquisition module. Tochange change theprobe’s probe’saddress, address, theof × 61 command value, value is the To the 00× 61calibration command value, this value is sent to the acquisition module. To change the probe’s address, the 0 × 61 command is used and it necessary to reset the probe for the changes to take place. is used and it necessary to reset the probe for the changes to take place. is used and it necessary reset the the probe for the changes place. uses The circuit used to totomeasure measure the temperature usingtoaatake thermistor uses 0.25 0.25 mW mW in in aa 25 25 ◦°C The circuit used temperature using thermistor C The circuit measure the temperature using thermistor a 25 °C environment. To have reading, it isit necessary to keep the0.25 probe offin when idle, environment. Toused haveatoamaximum maximumprecision precision reading, isa necessary touses keep the mW probe off when environment. To have aenergy maximum precision reading, is necessary to keep the probe off when idle, as theascontinuous energy usage by the can it interfere withwith read value. idle, the continuous usage bythermistor the thermistor can interfere read value. as theTo continuous energy usage by the thermistor can interfere with read value. have a simple configuration process for the probes using a computer, an application, using To have a converter simple configuration process for the probes using a computer, anbetween application, using an USB-UART connected to a microcontroller, programed to interface the UART an USB-UART converter connected to a microcontroller, programedThis to interface between the useful, UART port of the converter and the probe’s I2C port was developed. application is very port of the converter and the probe’sprotocol I2C portwith was the developed. Thisdesigned application very useful, considering that the communication probe was and isoptimized for considering thatbetween the communication protocol withitthe probe designed and optimized for communication electronic devices, making hard to usewas manually by humans. To further

Sensors 2016, 16, 1517

17 of 20

To have a simple configuration process for the probes using a computer, an application, using an USB-UART converter connected to a microcontroller, programed to interface between the UART port of the converter and the probe’s I2C port was developed. This application is very useful, considering that the communication protocol with the probe was designed and optimized for communication Sensors 2016, 16, 1517 17 of 20 between electronic devices, making it hard to use manually by humans. To further automate the programming and configuration of the probes batches, that generates Intel HEX automate the programming and configuration ofin the probesan in application batches, an application thatangenerates file [39] and programs the EEPROM was developed, as shown in Figure 27. an Intel HEX file [39] and programs the EEPROM was developed, as shown in Figure 27.

Figure 27. Programming application for the capacitive probe. Figure 27. Programming application for the capacitive probe.

After compilation, the firmware in Intel HEX format is stored in a predefined file folder and the After the firmware in Intel HEX format is stored in a process, predefined folder and EEPROM is compilation, generated, based on the configuration data. To finish the thefile AVRDUDE the EEPROM generated, based on the configuration To finish the process, theisAVRDUDE application [40] is with the parameters previously defined indata. the programming application used, as application [40] with the parameters previously defined in the programming application is used, shown in Figure 27, which programs the firmware and the generated EEPROM, and theas shown in Figure 27, which programs the microcontroller fuses [41], concluding thefirmware process. and the generated EEPROM, and the microcontroller fuses [41], concluding the process. 4. Discussion and Conclusions 4. Discussion and Conclusions The main objective of this work was to create a simple and inexpensive system to measure the The main objective of this work was to create a simple and inexpensive system to measure the level of FOG in the grease boxes of industrial kitchens. The system was validated in real production level of FOG in the grease boxes of industrial kitchens. The system was validated in real production facilities, thanks to a company dedicated to collecting and recycling fats and oils, which provided facilities, thanks to a company dedicated to collecting and recycling fats and oils, which provided access to the industrial facilities. access to the industrial facilities. From the several probes and sensors built, the best results were from the capacitive probes, as From the several probes and sensors built, the best results were from the capacitive probes, as exposed in the previous section “Level Detection: Implementation and Results”. The capacitive exposed in the previous section “Level Detection: Implementation and Results”. The capacitive probes probes were used for a complete system that was implemented and tested in production were used for a complete system that was implemented and tested in production environment. A environment. A communication protocol was specified in order to facilitate the exchange of messages communication protocol was specified in order to facilitate the exchange of messages and the GSM and the GSM network and SMS messages were used. After the probe development, the software network and SMS messages were used. After the probe development, the software needed to support needed to support the alert system, including the probe’s firmware, acquisition modules firmware the alert system, including the probe’s firmware, acquisition modules firmware and the data reception and the data reception software, was also developed. The received data were saved in a database, in software, was also developed. The received data were saved in a database, in order to facilitate the order to facilitate the integration with a third party management system. integration with a third party management system. The hardware and software components of the detection system were carefully chosen and The hardware and software components of the detection system were carefully chosen and integrated in order to minimize the costs of a future industrial production and, in the current market integrated in order to minimize the costs of a future industrial production and, in the current market context, it represents a competitive solution. Due to the generalization of the detection with capacitive context, it represents a competitive solution. Due to the generalization of the detection with capacitive probes [21] and the low production cost, this probe may be a good option for other usages, such as probes [21] and the low production cost, this probe may be a good option for other usages, such as water level monitoring in reservoirs, or even solid products, such as cereals silos. water level monitoring in reservoirs, or even solid products, such as cereals silos. 5. Other Application and Future Work 5. Other Application and Future Work As previously stated, these probes are good candidates for other usages as standalone elements As previously stated, these probes are good candidates for other usages as standalone elements or as a group of elements forming a single device. This scenario was studied and several tests were or as a group of elements forming a single device. This scenario was studied and several tests were conducted to confirm it as a future work possibility. conducted to confirm it as a future work possibility. Several probes can be connected to a unique acquisition module using the I2C protocol, which allows the connection of several probes to the same communication backplane, as shown in Figure 28. The number of probes is limited by the number of available addresses [37] and the 400-pF limit of the capacitance in the clock and data lines [36]. The capacitance limit problem can be overcome by using I2C repeaters [42], which set the limit at the 112 available addresses.

Sensors 2016, 16, 1517

18 of 20

Several probes can be connected to a unique acquisition module using the I2C protocol, which allows the connection of several probes to the same communication backplane, as shown in Figure 28. The number of probes is limited by the number of available addresses [37] and the 400-pF limit of the capacitance in the clock and data lines [36]. The capacitance limit problem can be overcome by using Sensors 2016, 16, 1517 18 of 20 Sensors 2016, 16, 1517 18 of 20 I2C repeaters [42], which set the limit at the 112 available addresses.

Figure 28. Several probes (in red) inside a container filled with water (in blue) are connected to a bus Figure 28. Several probes (in red) inside a container filled with water (in blue) are connected to a bus (in orange) and the acquisition module (in green). (in orange) and the acquisition module module (in (in green). green).

The probes in Figure 28 can be connected (Figure 29) so a continuous value is obtained with a The probes in Figure 28 can be connected (Figure 29) so a continuous value is obtained with a maximum resolution proportional to the number of probes used. proportional to to the the number number of of probes probes used. used. maximum resolution proportional

Figure 29. Communication of a master I2C with several slave sensors in the same bus. Figure 29. Communication of a master I2C with several slave sensors in the same bus. Figure 29. Communication of a master I2C with several slave sensors in the same bus.

ToTodemonstrate demonstratethe theprobe’s probe’sability abilitytotodifferentiate differentiatedifferent differentsurrounding surroundingmaterials, materials,using usingthe the To demonstrate the probe’s ability to differentiate different surrounding materials, using the probe’s probe’sfrequency, frequency,several severaltests testswere weredone doneininwhich whichthe theprobe probewas wasinstalled installedinina aglass glasscontainer containerand and probe’s frequency, several tests wereFive done in whichwere the probe wasfor installedsubstance. in a glass container and surrounded surroundedbybydifferent differentsubstances. substances. Fivereadings readings wererecorded recorded foreach each substance.Table Table5 5shows shows surrounded by different substances. Five readings were recorded for each substance. Table 5 shows the theaverage averageofofthose thosereadings. readings. the average of those readings. Table 5. Readings average with the probe in different substances. Table 5. Readings average with the probe in different substances. Table 5. Readings average with the probe in different substances. Substance Frequency (Hz)(Hz) Temperature Substance Frequency Temperature (◦ C) (°C) Substance Frequency (Hz) Temperature (°C) Water Water 44504450 24 24 24 Water 4450 Air 10,617 Air 27 2727 Air 10,61710,617 Rice 83108310 23 Rice 23 Rice 8310 23 Corn Corn 68576857 23 23 Corn 6857 23 Moist sand 23 Moist sand 45104510 23 Moist sandDry earth 451010,555 25 2325 Dry earth 10,555 Dry earthWet earth 10,5555917 20 2520 Wet earth 5917 Wet earth 5917 20

Theearth earthsamples samples were were collected from after an an irrigation cycle. The The from the thesame sameplace, place,before beforeand and after irrigation cycle. The earth samples were collected from the same place, before and after an irrigation cycle. The results show a clear distinction between thethe drydry and wetwet earth. The results show a clear distinction between and earth. results show a clear distinction between the dry and wet earth. Acknowledgments: This work was partly financed by the FCT—Fundacão para a Ciência e a Tecnologia Acknowledgments: This work work was was partly partly financed financed by by the the FCT—Fundacão FCT—Fundacão para para aa Ciência Ciência ee aa Tecnologia Acknowledgments: This Tecnologia (Portuguese Foundation Science and Technology) within Project UID/EEA/50014/2013. (Portuguese Foundation forfor Science and Technology) within Project UID/EEA/50014/2013. (Portuguese Foundation for Science and Technology) within Project UID/EEA/50014/2013. Author Contributions: José Faria, Arsénio Reis and João Barroso conceived the main steps for creating the Author Contributions: José Faria, Arsénio Reis and João Barroso conceived the main steps for creating the system; José Faria and André Sousa implemented the system and carried out experimental tests; João Barroso system; José Faria and André Sousa implemented the system and carried out experimental tests; João Barroso and Vitor Filipe supervised the work; and Arsénio Reis and João Barroso wrote the paper. and Vitor Filipe supervised the work; and Arsénio Reis and João Barroso wrote the paper. Conflicts of Interest: The authors declare no conflict of interest. Conflicts of Interest: The authors declare no conflict of interest.

Sensors 2016, 16, 1517

19 of 20

Author Contributions: José Faria, Arsénio Reis and João Barroso conceived the main steps for creating the system; José Faria and André Sousa implemented the system and carried out experimental tests; João Barroso and Vitor Filipe supervised the work; and Arsénio Reis and João Barroso wrote the paper. Conflicts of Interest: The authors declare no conflict of interest.

References 1. 2. 3. 4. 5.

6. 7.

8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22.

Ackroyd, R. FOG’s place is in the kitchen: Serious problems can result when grease enters the municipal/sanitary system. PM Eng. 2007, 13, 42. Quinn, J.M.; McFarlane, P.N. Effects of slaughterhouse and dairy factory wastewaters on epilithon: A comparison in laboratory streams. Water Res. 1989, 23, 1267–1273. [CrossRef] McKelvey, R.W.; Robertson, I.; Whitehead, P.E. Effect of non-petroleum oil spills on wintering birds near Vancouver. Mari. Pollut. Bull. 1980, 11, 169–171. [CrossRef] Water UK. Available online: http://www.water.org.uk/home/policy/publications/archive/recycling/ fogbrochure/fogbest-practice.pdf (accessed on 23 July 2015). He, X. Characterization of Grease Interceptors for Removing Fat, Oil and Grease (FOG) and Mechanisms of FOG Deposit Formation in Sewer Systems. Ph.D. Thesis, North Carolina State University, Raleigh, NC, USA, November 2012. Zlateff, D. FAQ: Fats, Oil and Grease (FOG). Available online: http://www.issaquahwa.gov/index.aspx? nid=407 (accessed on 14 September 2016). He, X.; Iasmin, M.; Dean, L.O.; Lappi, S.E.; Ducoste, J.J.; De los Reyes, F.L., III. Evidence for Fat, Oil, and Grease (FOG) Deposit Formation Mechanisms in Sewer Lines. Environ. Sci. Technol. 2011, 45, 4385–4391. [CrossRef] [PubMed] Crise chegou em força ao sector da restauração. Available online: http://www.tsf.pt/PaginaInicial/ Economia/Interior.aspx?content_id=1795734 (accessed on 14 May 2013). Al-Shudeifat, M.A.; Donaldson, A.B. Combustion of waste trap grease oil in gas turbine generator. Fuel 2010, 89, 549–553. [CrossRef] Montefrio, M.J.; Xinwen, T.; Obbard, J.P. Recovery and pre-treatment of fats, oil and grease from grease interceptors for biodiesel production. Appl. Energy 2010, 87, 3155–3161. [CrossRef] Altın, R.; Cetinkaya, S.; Yücesu, H.S. The potential of using vegetableoil fuels as fuel for diesel engines. Energy Convers. Manag. 2001, 42, 529–538. [CrossRef] British Standards Institution. Grease Separators. Principles of Design, Performance and Testing, Marking and Quality Control; BS EN 1825-1; BSI: London, UK, 2004; p. 8. Do Ambiente, M. Decreto-Lei 236/98 de 1 de Agosto. DIÁRIO DA REPÚBLICA — I SÉRIE-A 1998, 176, 3676–3722. (In Portuguese) Iwamoto, K.; Kamata, I. Liquid-level sensor with optical fibers. Appl. Opt. 1992, 31, 51–54. [CrossRef] [PubMed] Gurevich, V. Electric Relays: Principles and Applications; CRC Press: New York, NY, USA, 2005; p. 671. Ramsden, E. Hall-Effect Sensors: Theory and Applications; Elsevier/Newnes: Oxford, UK, 2006. Tregay, G.W.; Conax Buffalo Corporation. Optical liquid level sensor using a polytetrafluoroethylene perfluoroalkoxy material. U.S. Patent 4,998,022, 5 March 1991. Elert, G. Index of Refraction of Vegetable Oil. 2006. Available online: http://hypertextbook.com/facts/ 2006/TingTingLuo.shtml (accessed on 20 April 2016). Vass, G. The Principles of Level Measurement. 2000. Available online: http://www.sensorsmag.com/ sensors/leak-level/the-principles-level-measurement-941 (accessed on 17 June 2016). Building Automation Products Inc. Understanding 4-20 mA Current Loops; Application Note; Building Automation Products Inc.: Gays Mills, WI, USA, 2006. Schuler, E. A Practical Guide to Radio Frequency Level Controls; AMETEK Drexelbrook: Horsham, PA, USA, 1989. OMEGA ENGINEERING, Inc. Capacitance Continuous Level Measurement Probes. Available online: http://www.omega.com/ppt/pptsc.asp?ref=LV3000_LV4000&ttID=LV3000_LV4000&Nav= (accessed on 4 July 2016).

Sensors 2016, 16, 1517

23. 24.

25. 26. 27.

28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42.

20 of 20

Pratt, S. Capacitance Sensors for Human Interfaces; Ask the Application Engineer; Analog Dialogue: Norwood, MA, USA, October 2006. Digi International Inc. XBee®ZB. Available online: http://www.digi.com/products/wireless-wiredembedded-solutions/zigbee-rfmodules/zigbee-mesh-module/xbee-zb-module#overview (accessed on 21 June 2012). Digi International Inc. What is API (Application Programming Interface) Mode and How Does It Work? Available online: http://www.digi.com/support/kbase/kbaseresultdetl?id=2184 (accessed on 21 June 2012). Atmel Corporation. ATmega328P Datasheet. Available online: http://www.atmel.com/Images/Atmel42735-8-bit-AVR-Microcontroller-ATmega328-328P_datasheet.pdf (accessed on 24 June 2016). Analog Devices, Inc. AD623: Single Supply, Rail-Rail, Low Cost Instrumentation Amplifier. Available online: http://www.analog.com/en/specialtyamplifiers/instrumentation-amplifiers/ad623/products/ product.html (accessed on 24 June 2016). Fairchild Semiconductor. AN-118 - CMOS Oscilators; Application Note; Fairchild Semiconductor Corporation: Sunnyvale, CA, USA, 1974. NXP Semiconductors. General Purpose CMOS Timer. Available online: http://www.nxp.com/documents/ data_sheet/ICM7555.pdf (accessed on 24 June 2016). Maxim Integrated Products. DS18B20 Datasheet – Programmable Resolution 1-Wire Digital Thermometer. Available online: http://pdfserv.maximintegrated.com/en/ds/DS18B20.pdf (accessed on 24 June 2016). Atmel Corporation. ATtiny13A Datasheet. Available online: http://www.atmel.com/Images/doc8126.pdf (accessed on 29 June 2016). Atmel Corporation. ATtiny25 Datasheet. Available online: http://www.atmel.com/Images/doc2586.pdf (accessed on 29 June 2016). Atmel Corporation. AVR307: Half Duplex UART Using the USI Module. Available online: http://www. atmel.com/Images/doc4300.pdf (accessed on 29 June 2016). Paret, D.; Fenger, C. The I2C Bus: from Theory to Practice; John Wiley and Sons Ltd: New York, NY, USA, 1997. Crump, S. SMBus Compatibility with an I2C Device; Application Report; Texas Instruments: Dallas, TX, USA, 2009. NXP Semiconductors. I2C-bus Specification and User Manual. Available online: http://www.nxp.com/ documents/user_manual/UM10204.pdf (accessed on 29 June 2016). ON Semiconductor. How to Read Temperature through I2C Bus for NCT75-based Thermostat. Available online: http://www.onsemi.com/pub_link/Collateral/AND9032-D.PDF (accessed on 29 June 2016). Dangerous Prototypes. Open Bench Logic Sniffer. Available online: http://dangerousprototypes.com/docs/ Open_Bench_Logic_Sniffer (accessed on 29 June 2016). Hexadecimal Object File Format Specification. Available online: http://microsym.com/editor/assets/ intelhex.pdf (accessed on 29 June 2016). Dean, B.S. AVRDUDE - AVR Downloader/UploaDEr. Available online: http://www.nongnu.org/avrdude/ (accessed on 21 June 2016). YS. Fuse Bits Aren’t That Scary. Available online: http://embedderslife.wordpress.com/2012/08/20/fusebits-arent-that-scary/ (accessed on 21 June 2016). Ferrando, M.P. Troubleshooting I2C Bus Protocol; Application Report; Texas Instruments: Santa Clara, CA, USA, 2009. © 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/).

Suggest Documents