Macroporous Silicon for Gas Detection

Macroporous silicon (MPS) has been shown to be a promising material in many areas of technical interest. In particular, MPS has been applied for electronic devices and microfluidic applications. One of the most promising features of MPS is that it enables the development of optical applications using simple and cost-effective technology, compatible with MEMS fabrication processes and suitable for mass production. This chapter describes the application of MPS structures fabricated using electrochemical etching (EE) for the detection of gases of environmental concern in the wavelength range comprising 4 μm to 15 μm, such as CO2. Vertical-modulated MPS structures are reported, whose photonic bandgaps can be placed at different wavelengths depending on the application needs. These structures have been applied to the quantification of CO2, and these results are summarised here. Detection is performed by the direct measure of absorption, obtaining promising results with short optical paths.


Introduction
Macroporous silicon (MPS) has been shown to be a versatile material with a broad spectrum of promising applications [1]. MPS was first described by Lehmann in the early 1990s [2][3][4] and has since attracted great interest among researchers. Of the initial works in MPS development, it is also worth mentioning those from Zhang [5], Propst [6], and Parkhutik [7]. Of particular interest is the ordered form of MPS. In such form, pores are etched in a silicon substrate arranged in a uniform pattern. This results in an engineered material whose dielectric constant ε x; y; z ðÞ has now a characteristic spatial distribution. Given a regular, periodic ε distribution, the propagation of an electromagnetic wave through the media is affected. In particular, with an adequately designed pattern, it is possible to create an interference pattern giving rise to photonic bandgaps (PBGs) and other optical characteristics for the specific structure. Such structures are thus termed photonic crystals 1 (PCs) [8]. A PBG defines a specific frequency range and, possibly, direction in the crystal, in which an electromagnetic wave propagation is forbidden through the material [9].
Thanks to the existence of PBGs, photonic crystals have been used for advanced applications in optical communications [10], photovoltaics [11], photonics [12], light emission [13], antireflection/blackbody emitters [14], and gas sensing [15,16]. Particularly, in this field, the peculiar functionalities of PCs make these structures very attractive for their use in chemical sensing: gas detection [15,17,18] and bio-sensing [19]. The main advantage of using PCs for these areas is their potential to design and fabricate very compact and cheap photonic devices [20,21]. Furthermore, the possibility of integration into large-scale circuits or microelectronic fabrication processes [21,22] opens up vast opportunities for novel devices.
In particular, in this chapter, we focus on the use of MPS PCs for the optical detection and quantification of gases. More specifically, the characteristic absorption lines, or bands, of a gas in the infrared-that is, the fingerprint of the gas-are used to quantify the presence of the gas of interest. MPS demonstrates that is a suitable material and technology to operate in the midinfrared (MIR), and is useful for the detection of environmental concern gases, such as carbon dioxide (CO 2 ), methane (CH 4 ) or nitrogen oxides (NO x ).

Sensing application: gas detection
Sensor demand for everyday applications is rapidly growing. The areas of use are many and multidisciplinary [23,24]-to name a few: environmental [25,26], safety [27], security [25], health, transportation, and wearables. Market research shows that gas sensor segment has strong growth [24] (forecast to achieve $765 M in 2020 [23]). Furthermore, climate change concerns is making governments and other agencies push the research and deployment of smart sensor grids for large area monitoring [28], resulting in new opportunities for emerging technologies such as ultra-compact PC sensors.

Detection strategies: optical
Optical gas detection provides very desirable advantages over other methods. In first place, pure optical methods like spectroscopy have exceptionally fast response times to changes in mixture concentration. Furthermore, the spectroscopic optical systems are highly selective: they permit identifying a target gas by its spectral signature or fingerprint 2 . Optical systems can be made extremely sensitive, though this generally requires very long optical paths.
Traditional optical-based measuring is based on the direct measurement of optical power. One of its main drawbacks is that the equipment is large and expensive. Indeed, one has to trade-off space for detection limit. Some applications require several centimetres or even metres of optical path to reach the required sensitivity. Furthermore, spectroscopic systems are energy limited, thus they require stable and high power light sources such as lasers or thermal radiators. Spectroscopic systems also require additional complex mechanical and electronic equipment for the signal conditioning and processing. On the other hand, non-spectroscopic optical systems impose less strict requirements on some of these aspects. However, reducing the optical path length has not found a good solution until recently with the advent of PCs.
Other optical systems exist that use alternative detection strategies. Nevertheless, these alternative systems lose some of the more desirable traits of optical detection, like response time and selectivity. Special mention has to be done with respect to terahertz gas detection.Thistechnology is closely related to IR optical detection: typical working frequencies range from 0:1t o1 0 T H z which correspond to wavelengths from 3 mm to 30 μm [29]. At these frequencies, gas molecules have mainly vibrational resonances which are then used in the same manner as for IR optical detection: by absorption measurement. Terahertz technology has been successfully applied for the detection of air pollutants and health applications [30] and long range detection. However, terahertz technology has some serious drawbacks: the principal being the generation of terahertz waves [29].For commercial and industrial applications, non-dispersive infrared detection seems to be the most promising optical solution. This is discussed latter in more detail.

Gases of environmental concern
The growing global consciousness in environmental preservation and climate change has driven the research and development of sensing devices. In particular, monitoring the environment for pollution control [25,31] is one of the most important applications. Gas sensors are also significant for health [32] and indoor air quality assessment [33].
Air pollutants and greenhouse gases are primarily related to the exhaust gases of combustion processes. Major air pollutants are carbon monoxide (CO), ground-level ozone (O 3 ), nitrogen dioxide (NO 2 ), and sulphur dioxide (SO 2 ). Greenhouse gases are carbon dioxide (CO 2 ), methane (CH 4 ), and nitrous oxide (N 2 O) [34]. There are many other toxic air pollutants such as nitric oxide (NO), ammonia (NH 3 ), and hydrocarbons.
These gases have simple molecular composition with strong light absorption in the medium infrared wavelength range. The absorption spectrum of a gas at these light frequencies is caused by the different vibrational and rotational modes of the atomic bonds in the molecules [35]. The absorption coefficient spectra for several of the environmental concern gases are plotted in Figure 1. Absorption data of several gases can be found on the freely available HiTRAN database [35]. Each vibrational-rotational mode of a gas corresponds to an absorption line. These modes are narrow and close together 3 . However, at atmospheric pressure line mixing occurs, and the instrument resolution further broadens the spectra, transforming the absorptionlines into an absorption region or band, as seen in Figure 1.
From the data shown in Figure 1, it is clear that CO 2 is potentially the largest contributor to greenhouse effect. In addition, its absorption band is clearly separated from other strong absorbers, making this gas easy to detect and quantify in an unknown mixture.

Non-dispersive infrared detection of gases
Non-dispersive infrared (NDIR) detection relies on the fact that certain absorption lines of gases are "isolated" and their wavelengths have little overlap with other gases, as seen in Figure 1. This is profited to simplify the design of a gas detector reducing cost, complexity, space requirements, and power [36]. Identification and quantification of a certain gas can be done looking at a narrowband region of the spectrum. This can be done using optical filters or selective light sources, or a combination. At the other end, the detector (a photodiode: PD) will give a measure of the optical power received, directly corresponding to the concentration of the gas. When light passes through a gas mixture, some wavelengths will be absorbed following the Beer-Lambert (B-L) law where I 0 is the optical intensity of the source (or the reference value), I is the received optical power, l is the optical path, c is the gas concentration, and a is the absorption coefficient of the gas; source intensity and absorption coefficient depend on wavelength λ. An optical filter thus selects the absorption lines to measure. This allows for a multigas detection scheme using different filters for each gas [37]. Alternatively, the absorption can be measured as follows: where A is the absorption, and T the transmission). This is valid under the assumption that no light reflection occurs at the gas interfaces 4 . Figure 1. Absorption coefficients of some of the most relevant health and environmental concern gases. The coefficients are calculated from HiTRAN data using an apparatus function of sinc 2 x ðÞwith an aperture resolution Δf ¼ 4cm À1 .
The simplest NDIR system is depicted in Figure 2a. A sample of the unknown gas mixture is placed in a gas cell. Light is then passed through the cell from a source to a detector. From Eq. (1), it is clear that optical path length l is critical for the performance of the system. The necessary optical length l to achieve a desired detection limit can be several meters. Such long paths are highly impractical. Typical commercial products employ special cells (e.g., a Harriot cell) or optical systems using several mirrors to extend the effective optical path keeping a small volume.
To remedy the need of complex, bulky, and fragile optical systems to achieve the long optical paths required, a PC can be used as proposed in Figure 2b. PCs-based sensors are projected to require very small footprints, a few centimetres at most. The idea is to take advantage of the special features that PCs exhibit. One of such is the existence of propagation modes with extremely slow group velocity v g (also called slow light modes,) such that interaction time of the propagating electromagnetic wave is increased. Another possibility is the inclusion of defects in the PC to create resonant states. These are localised [38,39] and can have very highquality factors (Q-factor) prolonging the interaction time of light with the gas. Other alternative sensing methods can be used where PCs can enhance the system response, e.g., photothermal [40,41] or refractive index change. On the other hand, PCs can be simply used as highly selective filters.

Macroporous silicon applied to gas detection
Macroporous silicon is a structured material which has some very desirable properties. In particular, MPS has been extensively applied for the fabrication of PCs. In the first place, silicon is widely used in the industry, and many techniques and tooling exist. Additionally, MPS can benefit of established fabrication processes such as those used for micro electro-mechanical systems (MEMS). For dedicated applications, there are available fabrication technologies suitable for mass production, like electrochemical etching (EE). Given these advantageous traits, MPS has been proposed as a revolutionary material in many application areas. One of such areas is gas sensing. There has been some very intense work in order to develop the technology of MPS as gas sensing devices or as enhancers. Figure 2. Conventional optical gas sensor using mirrors to attain a long optical path. A PC-based gas sensor can be made much more compact exploiting the special properties of PCs such as slow light. Reprinted from [18], with permission of SPIE.

Seminal works
One of the first uses of MPS for gas sensing is in the work by Geppert [18]. From the analysis of the photonic band structure 5 of the PCs, they observe that some bands are very flat at certain wave vectors, thus the group velocity v g reduces to values about 0:02c to 0:05c (c, the speed of light). The slow propagating light has more time to interact with the media making possible to reduce the physical path length while maintaining an acceptable interaction time. It is also observed that some bands have the maximum field intensity located in the high dielectric region (dielectric bands), while other bands have the maximum in the low ε region (air bands).
Thus, air bands must be used for the maximum interaction.
Some of the described devices are three-dimensional (3-d) PCs made of MPS. For these devices, light is shone normal to the surface, propagating parallel to the pores' axis. The devices were used to detect ammonia (NH 3 ) and sulphur hexafluoride (SF 6 ). Transmitted light was measured through the PC and a small cavity of 300 μm depth filled with gas. They show promising results, but they argue that the small figures obtained are due to the low coupling efficiency of the PC. Furthermore, no enhancement was observed by the presence of the PC. This is also attributed to the large change in the effective refractive index 6 (n eff ) as for high contrast materials the transmittance T ≈ 1=n eff , thus reducing the coupling efficiency. In [18], it is also discussed a simple way to compensate for deviations in the bandgap due to fabrication tolerances: tilting the sample 15 , ashiftaslargeas35cm À1 of the PBG (about 4%) can be achieved.
They also present an alternative structure, refined in later works [17,42], which uses twodimensional (2-d) MPS structures. These are easier to fabricate and tolerances are better. As the structure is two-dimensional, the photonic band structure exists only for in-plane propagation. Thus, light must be coupled to the side o ft h eP C .A ne x a m p l eo fs u c ha r r a n g e m e n ti ss h o w ni n Figure 3a. Additionally, small v g implies large n eff , diminishing coupling efficiency. To avoid this problem, a special tapered section is placed on the interfaces of the PC. This tapered section gradually adapts the air n air to the n eff of the mode. This section can be done by deforming the lattice (elongating one axis) [18] or by leaving additional bulk material at the interfaces (promoting surface waves) [17]. The measurement results of these samples, see Figure 3b, show that in this case the PC does enhance moderately the detection of CO 2 (assumed 0 to 100% change). The devices have a 15 dB=mm insertion loss, and variability in the enhancement factor is high. These are attributed to uncertainties during fabrication: a fluctuation of 1% of the pore diameter is reported.

Structure design
From the possible strategies when using MPS structures as gas sensors, 2-d crystals impose the need to inject the light from the sides. In this way is easy to obtain long optical paths along the samples, but light coupling is complicated. However, from a practical standpoint, a system based on the normal incidence on the sample, using 3-d PCs, is easier to assemble, align, and calibrate 7 . In this chapter we expose results based in this option with PCs produced with macroporous silicon.
The designed MPS silicon structures are simulated using a simplified model by the finitedifference time-domain (FDTD) numerical method. Some MPS structures will be used as reflectors, while others will be used as filters. Reflection design requires a PBG encompassing just the absorption region of the desired gas. On the other hand, transmission design needs a PGB as wide as possible, with some crystal defects to block all light but the corresponding to the gas absorption line. The largest PBGs are obtained with an opal like PC [43]. As the samples will be illuminated from the top 8 , the horizontal pore arrangement is not as important. Our samples pore disposition is a square array. The EE of silicon does not allow getting perfect spherical shapes (opals), but the actual pore profile has a sinusoidal-like shape, or skewed sinusoidal shape as seen in Figure 4. For the simulations, this profile is approximated by a cylinder and an ellipsoid, or by cylindrical slices, see Figure 4.
To place the PBG at the CO 2 absorption line, the vertical period is calculated to be around 700 nm. As a rule of thumb, in a silicon PC, optical bandgaps can be found at about four times the pitch. Therefore, to have a PBG at λ 0 ¼ 4:25 μm, l 0 ≈ 1:1 μm. Considering the MPS porosity 9 p is about 40%, the effective refractive index n eff ¼ n Si p ¼ 1:48 [44], where n Si ¼ 3:47 [45]. This gives that the vertical period has to be l Si ¼ l 0 =n eff ¼ 718:0 nm. Reprinted from [17], with the permission of AIP Publishing. 7 Indeed, using 3-d PCs, the light can be launched into free space and coupled into the crystal from the top or bottom surface, which are much larger than the sides of the MPS structure. 8 Concretely, the "top" surface is the surface from where the pores are etched. This surface has the initial pattern of the pore sites. For prime quality wafers, this face is polished and the incident light will have little scattering. 9 Porosity is defined as the ratio of air to silicon volume in the unit-cell.
Macroporous Silicon for Gas Detection http://dx.doi.org/10.5772/intechopen.76439 The FDTD simulations show that in the vertical direction there is a narrow PBG (7:1%). A chirped modulation smoothly varying the vertical period can double the PBG width [46]. For the samples with included defects, initially the photonic response for a single defect was studied. As a further step, the use of several defects has also been analysed. In particular, the coupling between resonant cavities creates additional resonance modes [47]. Using two cavities, the fundamental resonant mode splits into two, making it possible to filter two separate frequencies using a simple PC design, to perform a differential measurement. One of the resonances selects the gas absorption line, while the other is placed in a "safe" wavelength were it will not be influenced by the media. Such configuration would allow ultra-compact filters or selective emitters.

Fabrication
For MPS fabrication, the EE method is one of the most versatile, and one of the preferred for three-dimensional structure definition. A general description of the method is the dissolution of silicon by an electrically promoted reduction-oxidation chemical process (redox reaction). The particular implementation of EE used for the fabrication of ordered MPS uses a pretreatment of the silicon substrate to define the sites (nucleation points) where localised etching of the material occurs. This method was first described by Lehmann in the early 1990s [3,4]. Succinctly, the silicon substrate to be processed is placed in a bath of hydrofluoric acid (HF). Silicon is unreactive in normal conditions with HF; however, passing a current activates the redox reaction [48]. As detailed in previous works, the reaction exchanges holes at the semiconductor-HF interface. Either n-type or p-type doped silicon substrates can be used; however, for the controlled growth of macro-pores 10 , n-type substrates are advantageous, as holes are minority carriers. To etch the substrate holes must then be generated somehow. The most common way is by using photogeneration (light assisted EE). This provides great control on the etching process.
The etching setup places the patterned face to be etched in contact with the electrolyte, opposing to the cathode. The back-face (i.e., the other side) is contacted electrically to close the electrochemical circuit. The illumination can be provided from either the front or back surfaces. For practicality reasons, it is simplest to irradiate from the backside. Our etching setup follows these principles, plus the IR light is provided by IR LEDS with λ LED ¼ 950 nm, and HF is continuously pumped through the etching cell at a controlled temperature.
The pore growth and morphology depend on several factors of the etching process. The pore front (i.e., the tip of the pores) advances at a speed (etching velocity) relatively unaffected by the electrical conditions; however, the etch rate (i.e., the amount of dissolved silicon) is proportional to the electrical current flowing through the electrochemical cell. Thanks to this behaviour, it is possible to use the EE method to fabricate 3-d MPS structures by the modulation of the current and potential during the etching process [49]. More detailed information on the etching process can be found in the works of Lehmann [2], Zhang [5], and Kolasinski [48].
The MPS photonic crystals developed in this work have all been fabricated using the light assisted EE of silicon using n-type substrates. Having pores arranged in an ordered fashion generates internal interference patterns for an electromagnetic wave propagating through the porosified media. These interference patterns will depend on the direction of propagation and frequency; hence, the materialisation of a PC. To arrange the pores in a desired pattern, the method by Lehmann [4] is used. This method prepares the wafers before etching using lithography to define the pore sites. Then nucleation points are created by a short silicon anisotropic etching at the sites. This creates small pyramidal pits in the surface, which promote the electrochemical etching at these spots. EE also allows the formation of very large aspect-ratio (AR, ratio of pore diameter to pore length) pores in relatively short time. For example, AR ¼ 1 : 465 has been reported [12].
After the porosification, some samples were post-processed to create a membrane. The membrane is done by anisotropic etching of the back face. For gas measurements, an open membrane is the best option: gas can flow freely through the MPS sample, solving any issues with gas trapping or residence time for the sensors.

Fabrication quality
In general, the EE of silicon produces good quality porous silicon. What is "good quality" with respect to MPS? In a minimal sense, macroporous silicon is of "good quality" if pores are of the same shape and have grown uniformly. Of course this does not provide much information whether the "quality" is acceptable for the intended application. In particular, for photonic applications, the requirements can be very strict. Fabrication imperfections arise due to numerous reasons: wafer crystalline defects, crystal alignment, and local dopant distribution; but also the etching process itself can account for some variability, and lithography errors will also cause flaws in the grown pores. The common fabrication defects one can encounter in a MPS structure fabricated by EE are summarised in Table 1.
From Table 1, the defects that are of greater concern are the ones classified as "large optical influence." Here surface roughness is not considering as a defect. It is a consequence of minute variations inherent in any fabrication process. The amount of perturbation does not alter the pore morphology or cause long-range effects and will not give unexpected results.
Pore death is the premature ending of a pore resulting in a shortened pore with respect to its neighbours. This can be single, isolated pores or can affect several pores. Current starvation is the most common cause. During etching, there is a minimal current under which there are not enough carriers to sustain stable growth. In this situation, current will concentrate on some pores resulting in wider, distorted, and shorter pores. The solution is increasing the etching current. Also, shorter structures are less susceptible to suffer from pore death.
Pore branching is generally a consequence of pore death but can also happen if the etching parameters are not adequate: if applied potential is too small, the space charge region (SCR) will be small and unintended holes could find their way to spots in the pore wall far from the pore tip and secondary pores grow from that points.
Pore axis alignment depends on the crystalline direction of the Si substrate. Pores preferentially develop following the principal crystalline directions of the silicon substrate; however, the pores also have a tendency to grow following the current paths. If the crystal is severely misaligned, the mismatch between the crystal direction and the current direction will cause that the pores grow in several directions simultaneously [50]. The pore cross-section affects the symmetry of the PC. In the stable growth phase, cross-section approximates a circle; however, under certain condition of applied potential and electrolyte additives, the cross section can change its shape.
Spiking is the appearance of random streaks of nanometric branches, spreading out in random directions and with irregular shape. Excessive voltage during the etching promotes spiking. Moderate to low spiking has little influence on the optical performance. However, it changes the porosity, which may shift the wavelengths of the optical features. Unstable growth is basically caused by substrate inhomogeneity, though the dynamic behaviour of the etching system may also influence [51]. In general, unstable growth is mild and can be observed with pores not evolving in a straight line but slightly wandering. Another form of unstable growth is the long-range variation of pore diameter.

Applications of Silicon Photonics in Sensors and Waveguides
Profile fidelity refers to the closeness of the actual pore profile to the intended profile. It is considered a defect because it is an unintended result which affects severely the optical response of the etched sample. Several test runs with progressive refinements are needed before the near-optimal conditions and waveforms are found. After EE, the pore's walls may be covered with a layer of microporous silicon. This layer will depend on the electrolyte concentration and present additives. It has no noticeable optical influence in the MIR, and it can be left; however, it is very easy to remove by a quick dip in HF.
The abovementioned discussion was made considering the local effect of perturbations in the pore shape and outcome of the etching process. Nonetheless, the uncertainties of etching, the inhomogeneity of the substrate, and the flaws in lithography can be considered on a larger scale or long-range. Pores at distant locations 11 are also affected by the etching system. The most common long-range effect is the variation of pore diameter of up to a few percent [42]. Also, the etching process generates H 2 bubbles which must be removed otherwise they adhere to the surface and create big spots where the etching stops. More in-depth analysis can be found in the works by Föll and co-workers [52,53].

Absorption and losses of macroporous silicon
One important concern is determining how absorption and fabrication tolerances will affect the performance of the detection system. Intrinsic silicon absorbs light at wavelengths shorter than 950 nm, approximately, however when silicon is doped with impurities, strong absorption may be observed in the MIR range. Several papers report on the absorption dependence with doping level in silicon [54]. Interestingly, for the doping concentrations used in the fabrication of optical gas sensors working in the middle infrared (n < 5 Á 10 17 cm À3 ), it is found that material absorption is negligible [54,55].
On the other hand, fabrication tolerances definitively do have an impact on optical performance. For instance, in [17], it is reported that a 1% variation of the pore radius attenuates 15 dB=cm the transmitted light. This is further studied in [42], global pore diameter fluctuation of 3:5% was caused by the spatial variation of dopant. They further claim that, for a better than 90% transmission in a 1 mm thick PC, the pore position should change less than 0:3% and diameter has to be within 0:5%. A systematic study of the effect of in-plane disturbances in electrochemically etched MPS is presented in [56]. Some interesting conclusions extracted from this work are that ellipsoid perturbation up to AE10% has little impact on the PBG if the porosity is maintained near its optimum, and that a small variation of the air fraction of just AE4% is enough to shift a narrow PBG (Δf ¼ 5%) out of the designed central gap frequency f 0 . Similar conclusion was found in the work by our group [57], where the effect of vertical period variation in 3-d MPS was analysed. Wide PBGs were designed for the samples used in this work, but noticeable narrowing and shift could be observed with periodicity variations above AE5%. Furthermore, it was found that the PBG became more transparent allowing light transmission higher than a 10% in the forbidden band.

Measurements and results
Samples of MPs photonic crystals were fabricated with a lattice pitch of 700 nm and modulated pore profile. The fabrication conditions were the ones described earlier in Section 3.3-using the EE method. The modulation profiles for the 3-d PCs were programmed to generate a "strong" 12 profile having a 700 nm vertical period, the same as the lattice pitch. The samples were initially characterised to obtain their optical spectrum in the MIR range using a Vertex 70 Fourier-Transform Infrared Spectrometer (FT-IR) from Bruker Optics. Also some of the structures were cleaved and latter inspected by SEM to determine the pore morphology and actual etched profile. After the samples were analysed, the valid samples were used in a dedicated gas measuring system also using FT-IR spectrometers to measure the performance of the PCs in sensing carbon dioxide.

Fabrication, sample characterisation, and morphological study
The fabricated samples were etched using a silicon substrate with 001 hi crystal orientation. For the 700 nm period MPS structures, substrates of the appropriate resistivity were used. The pores are arranged in a square pattern. This pattern is transferred to the substrate surface using nano-imprint lithography (NIL). The etching temperature was set to 10 C. The resulting PCs are to be used with light coming from the top, aligned to the pores' axis, with normal or quasinormal angle of incidence (θ i from 0 to 13 ). The actual modulation waveforms depend whether the samples will be used for reflectance or transmittance. For the samples used in transmission gas measurements, membranes were made. However, the structure resilience is critical given the thin porous layer, so membranes are not open. Indeed, the porosified depth of the MPS crystals ranges from 20 to 50 μm. Such thin layers are very fragile. For this reason, membranes did not reach the pore tips.

Morphological analysis
The morphological analysis of some samples shows, as seen in Figure 5, that the etched profiles of the MPS structures have some imperfections. The observed flaws are mainly small variations in pore radius between adjacent pores, pore "wiggling", skew, and pore death. On the surface of the pores, a rough finish due to microporous silicon can be appreciated (see Figure 5). Pore radius variation is small-less than 10%-for the samples used here. This has a small impact on the optical response of the PC as has demonstrated by our works [57] and others [58,59]. Skew is generally not an issue. Some extreme cases have shown up to 5 of crystal misalignment from the 001 ½ direction (see Figure 5b), but otherwise pores grow fine. Some pore "wiggling" can be observed in the fabricated samples (see Figure 5a). As a consequence, there is some decrease of the optical performance of the PC. In general, the degree of wiggling in our samples is small.
The fabrication process for the MPS samples has been optimised to obtain structures virtually free from dead pores. In general, optical performance is preserved if dead pores are few, or if pores die late during etching. To avoid pore death in the initial samples, the lower current limit was increased, so dynamic range was reduced and modulation could not be as strong as desired (compare Figure 5a and b).
The most significant defect found in the samples here used was vertical period variation 13 .As seen from Figure 5, for neighbouring pores, the beginning and ending of each vertical period is slightly different. As shown in our previous work [57], this variation has a noticeable influence on the PC optical response. In general, the 700 nm samples fabricated with our equipment show about 5% variation in periodicity which results in about 30% PBG narrowing from the ideal and nearly 10% minimum transmittance [57] 14 .
Two types of PC structures were fabricated for this work. Samples used for reflectance measurements are regular 3-d structures with a continuous sinusoidal-like profile for the pores. Such samples are shown in Figure 5 along with an example of current waveform used to generate them. The cross section images reveal that the modulation is slightly skewed to the beginning of the modulation. The vertical period is measured to be 700 nm which is the desired length. Total etched depth is 25 μm and the mean pore diameter is d ¼ 500 μm. The programmed "modulation index" 15 is about m in ¼ 0:7, but results in m etch ≈ 0:1. Despite this, this structure has good enough optical performance.  13 That is for the current way the PCs are being used: with light coming from the "top" along the pores' axis. 14 These performance figures were achieved with the latter fabricated samples, with an optimised EE process. 15 The input waveform is a square signal, so the concept of modulated index in AM is extended here as m ¼ max rt ðÞ ½ ∕min rt ðÞ ½ , where rt ðÞis the radius of the poresuperfluous.
Comparing the etched pore profile from the input waveform (Figure 5c), it can be seen that during the high plateau portion of the profile, once the pore has reached its maximum diameter, it slowly starts narrowing as the pore front advances. Presently, this can only be "corrected" by trial and error and judicious changes to the current and potential waveforms. For example, a second profile was designed with smoother transitions and "pre-skewing" resulting however in the PC of Figure 5b. Better modulation index was obtained (m etch ≈ 0:2) but the skewing did not improve. In addition, the vertical period increased to 850 nm, which corresponds to a PBG centred at λ 0 ¼ 5:03 μm.
Samples used for transmittance measurements include one or more defects, as shown in Figure 6. These structures have been fabricated using a refined profile. As seen on the SEM cross-section micrograph, the modulation skew is still present 16 , but the vertical period length is better adjusted. Otherwise, the quality of the fabricated structures is maintained. The modulation index has been increased, with pores having a smaller diameter at the necks. This greatly improves the PBG (both width and transmittance blocking) of the PC compared to the first structures depicted in Figure 5. The vertical period of the PC used for these samples is p v ≈ 1 μm. These samples have at least one planar defect in the regular PC profile to define a resonant cavity. These cavities have a diameter d def ¼ 230 nm, and length was varied around l def ¼ 2:1 μm [60], to place the resonance at λ ¼ 4:25 μm.

Optical response
Samples were optically characterised after fabrication to ensure the adequacy to sensing CO 2 . This was done in a FT-IR spectrometer in reflection mode with light incident at a quasi-normal angle of θ i ¼ 13 . Also some samples were analysed in transmission mode with light illuminating in normal angle of incidence. The wavelength range of the analysis extends the MIR and some of the NIR regions from λ ¼ 1 μmto20μm. Samples used for reflectance gas measurements, such as the one in Figure 5a, have a single PBG in the optical response. The morphological analysis shows that, as the modulation index is small, the PBG will be relatively narrow. This is confirmed in the measurement shown in Figure 7. The results confirm that as expected by the criteria given above, the PBG of a 3-d PC with a vertical period of 700 nm is centred at λ 0 ¼ 4:25 μm. PC quality and modulation index limit the reflectance to about 30%. In spite of these shortcomings, the obtained response is good enough to be used for the sensing of carbon dioxide.
The samples for transmission measurements have different responses according to the number of PC defects placed. As seen in Figure 8a, b, placing two defects gives rise to two resonant  states, and three states if three defects are used. Coupling between resonant cavities induce the appearance of several resonances in the optical spectra even if all cavities are of the same dimensions. The placement of the defect along the PC depth also influences the coupling efficiency and quality factor of the resonance. The creation of a membrane also improves the transmitted signal, compare Figure 8c and d where the transmitted peak is almost 10% to the 4% of the non-membrane sample.

Gas measurement system
After the devices were characterised, they were measured under different atmospheres consisting of CO 2 diluted in pure nitrogen. The amount of carbon dioxide was controlled using a two gas mixer in which one line is pure nitrogen as the carrier gas, and the process gas (CO 2 is this case) is connected to the second line. Each line is controllable separately: shutting, pressure, and flow. Both gas lines are then mixed in a manifold and the mixture is then output to the gas cell. The gas cell is sealed with one input port and one exhaust port. The flow control is performed using mass flow controllers (MFCs) of different range: the carrier gas controller (MFC1) is 2 l=min full scale (FS), and the process gas controller (MFC2) is 200 ml=min FS. Both MFCs are calibrated for N 2 , so for the process gas a correction factor is used. For the measurements, a constant flow rate of _ V ¼ 400 ml=min for the mixture is used. In these conditions, the minimum gas concentration goes from 7500 ppm to 50%. Given the performance data of the MFCs, the concentration uncertainty is given by B 2 c ≈ c 2 3:15 Á 10 À3 þ 0:25 Á 10 À3 c À1 À 1 is the gas concentration, and _ V 1 and _ V 2 are the flow rates of carrier and gas, respectively. Note that _ The gas mixture is fed to a gas cell purposely built where the MPS photonic crystal is placed. The gas flows continuously through the cell. For the measurements, a broadband infrared light source is used. This light is directed to the cell and then collected by a photodetector (PD). In the work here presented, the MPS structures were characterised by FT-IR spectrometry. The expected response of an autonomous NDIR measuring device can be then extrapolated from the spectroscopic gathered data in the characterisation of the PCs.

Principle of detection and method
The basic idea here proposed for an NDIR system is to use a MPS photonic crystal with a PBG wide enough to comprise one of the gas absorption regions. In the case of CO 2 , this region extends from λ ≈ 4:20 to 4:35 μm (see Section 2 -above). Ideally, all light outside the PBG should be discarded and not arrive at the detector. Once the light has been filtered, the photodetector gives a reading proportional to the incoming optical power, and further filtered by the detector's photo-response. In the following discussion, it is assumed that the PD response is flat in the absorption region of the gas.
From the characterisation measurements, it is straightforward to approximate the expected response of the NDIR system. The spectra can be any of the reflectance, transmittance or absorbance, as these are proportional to the power of the electromagnetic wave: E r λ ðÞ jj 2 , and so on. Now it is possible to define the quantity S R ¼ Ð R λ ðÞ dλ as the normalised optical power received at the PD from the reflectance data. S R is thus proportional to the gas concentration and estimates the actual output of a PD. Equivalent power quantities S T and S A can be defined for the transmittance and absorbance spectra respectively. A second measuring criteria is simply evaluating the reflectance spectrum at a given wavelength R λ gas ÀÁ ¼ R gas (equivalent quantities are defined for transmittance and absorbance). Such wavelength is chosen to be where absorption is the greatest. The relation of this quantity with an actual output of a PD is less clear but serves to evaluate the performance of the gas cell and PC.

Reflection CO 2 measurement
Reflection measurement of CO 2 uses a PC as a selective reflector. The reflection spectra are obtained from which the absorbance spectra are calculated as A λ ðÞ ¼ 1 À T λ ðÞ ¼ 1 À R λ ðÞ ∕R 0 λ ðÞ ; where R λ ðÞis the measured spectrum at some gas concentration, and R 0 λ ðÞis the reference spectrum (only N 2 ). The "optical power" is then S ¼ Ð A λ ðÞ dλ. Using a reference spectrum removes any effect of the optical system, such as reflectance at optical interfaces.

Setup
The measurement setup consists of the gas mixer connected to a specifically built gas cell. A schematic view of the cell design is shown in Figure 9 alongside the actual built device. The cell consists of two plates separated with an O-ring such that the cell is made airtight. The top plate has one port for gas input and another for output, and a central opening where a potassium bromide (KBr) window is placed and held in place by a sealant. When assembled, the two plates are held by several screw ensuring mechanical stability and airtightness, with the PC underneath the IR window. The gap from the sample to the window is about 0:5 mm, resulting in a total 17 light path of 1 mm. The cell is then placed in the spectrometer to make the gas concentration readings. In particular, a Renishaw Raman microscope equipped with Smiths IlluminatIR FT-IR module is used to take reflectance measurements at normal incidence, θ i ¼ 0 . The aperture sizes used in the optical setup was 50 μm Â 50 μm. The wavelength range extends from k ¼ 1000 cm À1 (10 μm) to 3500 cm À1 (2:86 μm). Resolution is 4 cm À1 .Each spectrum at a given concentration was averaged over 256 scans.

Results
Reflectance spectra were measured for CO 2 at concentrations from 3 to 43%, the results summarised in Figure 10. Lower concentrations were tested but for concentrations below 3% changes are very small and difficult to discriminate. This effect is then observed in the "optical power" signal S at the output ( Figure 10b) calculated as mentioned above. Figure 10b also shows that the Beer-Lambert law is closely followed by the measured data for concentrations above 10%. From the fitted B-L model, it is possible to extract the exponential term l Á a ≈ 3:65 (where l is the optical path length, and a the absorption coefficient). From the HiTran data for carbon dioxide, at λ ¼ 4:25 μmand4cm À1 instrument resolution, a CO 2 ≈ 50 cm À1 .Thisgivesthat the effective path length is l eff ≈ 0:75 mm. Measurement uncertainty is dominated by the mixer uncertainty, as seen in Figure 10b, as power measures are averaged over a large number of scans. This results in a fairly constant uncertainty across the full measurement range about AE2%.

Conclusion
Macroporous silicon is a versatile material that has shown to be a good candidate for the obtainment of PCs for gas sensing applications. Using fabrication methods such as EE opens up the possibility of obtaining high-quality photonic filters, in large quantities, and economically competitive. Furthermore, this fabrication technique is very flexible allowing creating customised designs with little effort. Using silicon as the base material has other benefits, such as the reutilisation of the existing manufacturing tooling and the reuse of process flows. Moreover, EE is compatible with microfabrication technology and might be incorporated in VLSI designs to build complete sensing devices. This will result in more compact and integrated system design lowering the bill of materials, costs, and improving manufacturability.
Here we demonstrate one possible way to use MPS PCs for gas sensing: as selective filters. Carbon dioxide has been detected and quantified using NDIR reflectance measurements. It has been found the MPS crystal has also an effect in the measured absorption. This is due to the very nature of the PC, slowing the group velocity of the incident light and enhancing the interaction time-increasing the effective optical path length-with the gas mixture. The inclusion of resonant cavities further enhances light absorption by inducing resonant states and spatially confining the IR radiation.
The PCs here shown, prove that a compact CO 2 sensor using MPS technology is feasible, achieving a detection range near to that of commercial optical devices based on IR PD/LED. The devices shown here have room for improvement in particular regarding the fabrication, and progress is steadily being made in this area.