1 Introduction

In recent couple of years, magnetic alloy nanowires have attained a particular interest due to their novel applications in Spintronics, domain-wall motion devices [1]. Anodic aluminum oxide (AAO) membranes have been broadly used to get nanowires, which exhibit self-composed, round and hexagonal, and uniform openings. Numerous systems have been utilized to manufacture promising nanowires [2, 3]. However, the template-based electrodeposition technique has been proved to be one of the easy, inexpensive, and effortlessly controlled strategies. The cell size, pore width, and thickness of barrier layer depend upon anodizing voltage, and the thickness of AAO templates is controlled by anodizing time [4]. These nanoporous templates can be utilized as the most suitable material for growth of nanowires and protect them from oxidation.

In the last decade, novel and interesting phenomena were observed in ferromagnetic–nonmagnetic alloy nanomaterials [5]. In order to use magnetic nanowires in magnetic devices and tune its structural and magnetic properties, the addition of nonmagnetic elements in magnetic elements has been an effective technique [6]. A number of studies on ferromagnetic/non-magnetic multilayered and binary nanowire arrays, including CoCu, FePd, CoAg, CoPd, and NiCu [7,8,9], have been reported in the literature due to their interesting magnetic and magneto-transport properties.

The cobalt (Co) is ferromagnetic material with large coercivity and high Curie temperature (1388 K), and is widely used in magnetic recording media. Since Co has well-defined magnetic moment, so CoMg is an ideal case for studying the change in properties by alloying ferromagnetic Co and paramagnetic Mg. However, Co-Mg alloys with hexagonal close-pack (hcp) phase is proposed to have high net magnetic moment which also make them potential candidate for magnetic data storage applications [10]. Theoretical studies show that Co2Mg alloy with hcp phase has 10.47μB per formula net magnetic moment [11]. So far, a number of studies have been done on the electrodeposition of Mg. Gao et al. briefly investigated electrodeposition of Mg with different ionic sources and electrolyte temperatures [12]. The co-deposition of Co and Mg might be a relatively easy task in the presence of complex agents, and with the best of our knowledge, no research reports on co-deposition of Co and Mg by electrodeposition have been published yet.

In this work, the synthesis of CoMg nanowires in AAO templates is done at room temperature by changing AC potentials from 13 to 17 V to change the structural and magnetic properties. In this way, instead of changing the molarity, pH, or concentration of electrolyte solution each time, synthesis of CoMg nanowires by changing only AC potential to tune structural and magnetic properties according to our own desire becomes the smart and valuable choice.

2 Experimental Procedure

2.1 Template Fabrication

AAO templates were fabricated by two-step anodization according to Masuda and Fukuda [13]. A 99.99% aluminum sheet was used as starting material, and prior to anodizing, Al sheet was annealed at 500 °C to obtain homogenous pore growth conditions. Therefore, Al sheet was electro-polished in a 1:4 by volume mixture solution of HClO4 and C2H5OH at 9 V DC to reduce the surface roughness. Afterward, the first anodization of pre-treated Al sheet was formed in 5% H3PO4 acid at 60 V DC for 6 h and during anodization temperature of electrolyte was kept constant and stirred continuously. Then, the anodized foils were immersed into mixture solution of 6 wt% H3PO4 and 1.8 wt% CrO3 at 60 °C for 2 h to remove the formed anodized layer because it has non-uniformity in pores [13]. After removal of anodization layer, Al sheet was again anodized under the same conditions as first anodization for 20 h, and at last, anodization voltage was reduced systematically from 60–0 V to promote thinning of the barrier layer.

2.2 Synthesis of CoMg Nanowires

After successful fabrication of AAO templates, CoMg nanowires were electrochemically deposited into pores with electrolyte containing 0.3 M CoSO4·7H2O, 0.2 M MgSO4·7H2O, 0.5 MgCl2·6H2O, 0.1 M H3BO3, and 0.1 M CH3(CH2)11SO4Na with pH = 4. In the electrolyte, H3BO3 and CH3(CH2)11SO4Na are used as buffering and complex agents, respectively. To deposit the high content of Mg, electrodeposition was carried out at 80 °C and compositions of Mg and Co were varied by applying different electrodeposition voltages; five different samples were prepared at 13 V, 14 V, 15 V, 16 V, and 17 V AC. After preparation of all samples, they were investigated via different characterization techniques such as scanning electron microscopy (SEM), energy-dispersive X-ray (EDX) spectroscopy, X-ray diffraction (XRD), Fourier transform infrared spectroscopy (FTIR), and vibrating sample magnetometer (VSM).

3 Results and Discussions

3.1 AAO Templates

The current versus anodization time curves have been recorded at the constant voltage during first and second anodization as shown in the Fig. 1. Within initial few moments as DC potential is applied across electrodes, the anodization current is maximum which gradually decreases with passage of time due to oxidation at the surface of electrode and barrier layer of alumina is formed in this region. Then current starts increasing because of dissolution of alumina barrier layer, and the nucleation of pores starts at the surface. The current becomes constant with the passage of time, because of balance between dissolution of barrier layer and alumina layer formation at the electrolyte interface, and this stability in current provides exactly regular and round shape pore structure.

Fig. 1
figure 1

The current-time curves

3.2 Morphological and Elemental Composition

SEM was used for investigation of the morphology of all samples, and before performing SEM analysis, AAO templates were partially etched out through dipping into 0.1 M NaOH solution at temperature 60 °C for 1 h to obtain clear images of nanowires. SEM images reveal that ultrafine and uniform CoMg nanowires have been successfully fabricated into AAO template pores by AC electrochemical deposition, as shown in Fig. 2(a–c). The average diameter of nanowires has been calculated by ImageJ software, which was found about 150 nm, as shown in Fig. 2(b), whereas the length of nanowires was about 23 μm, which is equal to pores lateral length of templates. Therefore, the synthesized nanowires have 150 aspect ratio.

Fig. 2
figure 2

The (a–c) SEM and (d) EDX of CoMg nanowires

The elemental analysis of all samples was also performed by built-in EDX spectrometer of SEM. The obtained elemental composition of all samples is listed in Table 1. As observed, maximum atomic percentage (at%) of Mg was found in nanowire sample electrodeposited at 17 V which is displayed in Fig. 2(d). Furthermore, the nanowires only consisted of Mg and Co atoms, and atomic ratio of Mg/(Co + Mg) showed increasing tendency with deposition voltage, as presented in Fig. 3. These results attribute that higher AC electrodeposition voltage is more suitable for Mg-rich deposition due to higher mobility and reduction potential.

Table 1 Calculated values of EDX and XRD
Fig. 3
figure 3

Deposition potential dependent concentration variation of Co and Mg

3.3 Crystal Structure

The crystal structure of all samples was investigated by XRD under Cu-Kα (1.54 Å) radiation source. Figure 4 depicts stock representation of the obtained diffraction patterns of all samples. Obtained diffraction patterns were compared with standard data of Mg (JCPDS no. 001-1141) and CoMg (JCPDS no. 029-0486). It was found that diffraction peak (004) at 2θ ≈ 72.5° corresponds to hexagonal close pack (hcp) structure of Mg, while all other diffraction peaks [(100) at 2θ ≈ 21°, (200) at 2θ ≈ 43°, (201) at 2θ ≈ 44.5°, (202) at 2θ ≈ 42°, (205) at 2θ ≈ 65°, and (220) at 2θ ≈ 78°] correspond to hcp structure of CoMg. Thus, the search/match analysis exhibited that synthesized nanowires have hcp crystal structure with polycrystalline nature. It was also observed, when the electrodeposition voltage was 17 V, that diffraction peaks of CoMg became more prominent due to increase in Mg2+content in CoMg. As the concentration of Mg increases, the material becomes more crystalline and more planes are introduced. That is why all missing peaks are observed at higher concentration of Mg. Another reason is due to change in grain orientation. At lower Mg concentration, the intensity of (201) diffraction peaks was relatively high but as the Mg concentration increased (12%), the intensity of (201) decreased and (100) peak induced, which proves that preferred grain orientation changed with increase of Mg content up to 12%. Furthermore, the lattice constants of all samples were calculated by employing following equation and values are listed in Table 1.

$$ \frac{1}{d^2}=\frac{4}{3}\left(\frac{h^2+ hk+{k}^2}{a^2}\right)+\frac{l^2}{c^2} $$
(1)

where a and c are the lattice constants; h, k, and l are the miller indices; and d is the inter-planer distance calculated experimentally with the help of Bragg’s law [14, 15]. It can be seen from Table 1 that the lattice constants were increased with electrodeposition voltage. It might be due to more accumulation of Mg2+ ions into the crystal which have larger ionic radii as compared to Co2+ ionic radii.

Fig. 4
figure 4

The XRD results of CoMg nanowires

The grain size and lattice strain are important parameter for understanding the magnetic and electrical properties of any material. Consequently, the grain size and lattice strain of all samples have been determined by well-known Scherrer’s formula [16] and Stokes-Wilson equation [17], respectively, and obtained values are listed in Table 1. Grain size and lattice strain both are two opposite parameters of each other. The grain sizes revealed decreasing trend as a function of electrodeposition voltage, as displayed in Fig. 5. Grain size in electrodeposition strongly depends upon the nucleation rate; the higher the nucleation rate yield, the smaller the grain size, and vice versa. Thus, the increasing electrodeposition voltage caused increase in nucleation rate; as a result, grain sizes were reduced.

3.4 Chemical Composition

Mg has high chemical reactivity; it rapidly reacts with boiling water and makes different oxides and hydroxides, as the electrochemical deposition was carried out under high temperature which can cause the oxidation of Mg during electrochemical deposition. Therefore, FTIR was utilized to investigate the presence and absence of impurities in nanowires. The FTIR spectrums of all samples that were recorded from 4000 to 400 cm−1 as shown in Fig. 6. In obtained spectrums, broad bands of vibration modes of O–H and C=O appeared about 3200–3600 cm−1, 2500–2300 cm−1, and 1650–1850 cm−1, due to existence of moisture in our samples. Intense bending mode and stretching mode of Al-O molecule were observed about 1650–1850 cm−1 and 669 cm−1, respectively, due to existence of AAO templates in our samples. Although the sprinkle band at 560 cm−1 was observed which belongs to bending mode of Mg–O, it indicated that MgO molecules also exist in nanowires, but the low intensity of bending mode confirms that MgO exists in very small quantity into nanowires that cannot affect the overall properties of CoMg nanowires (Fig. 6).

Fig. 5
figure 5

The FTIR results of CoMg nanowires

Fig. 6
figure 6

Variation in grain size and lattice strain with deposition voltages

3.5 Magnetic Properties

The vibrating sample magnetometer (VSM) has been used to determine the magnetic properties of the Co89Mg11 nanowires by applying magnetic field along parallel and perpendicular to nanowire axis as shown in Fig. 7 (a). Actually, we want to observe magnetic properties of CoMg alloy nanowires whether they show ferromagnetic behavior or not. The incorporation of Mg in Co may reduce its magnetic properties like saturation magnetization and coercivity. We envisage that if a sample with maximum concentration of Mg will show magnetic properties, then other samples with low concentration will certainly show ferromagnetic order. From XRD, it is also clear that Co89Mg11 show all peaks and maximum crystallinity is observed. That is why other magnetic properties of other samples were not shown. The corresponding hysteresis parameters are listed in Table 2. Here, the curves are different in shape along both parallel and perpendicular directions, and it defines the uniaxial anisotropy for CoMg nanowire axis. The curves show that the coercivity of both the axis is different, but the squareness along parallel axis is greater than that of perpendicular axis. Here, the coercivity of the curve is low which shows that the material is soft ferromagnetic material. The angular dependence of coercivity Hc and squareness (Mr/Ms) is shown in Fig. 7 (b) where Mr is the remanent magnetization and Ms saturation magnetization.

Fig. 7
figure 7

(a) MH loops of Co89Mg11 nanowires (b) Angular dependence of Hc and squareness S*=Mr/Ms

Table 2 Measured parameters of hysteresis loops

Conventionally, difference between saturation field of parallel loop (Hs)para and saturation field of perpendicular loop (Hs)perp gives the idea about easy and hard magnetization axis. As (Hs)perp − (Hs)para is negative, it dictates that easy axis lies parallel to long axis of nanowire. Here, in our case, (Hs)perp − (Hs)para was also negative that also confirms Co89Mg11 have easy axis along the long axis of nanowires.

The angle dependent of coercivity gives information about the magnetization reversal (MR) mechanism. If the coercivity increases with the increase of angle, magnetization reversal mechanism occurs by nucleation mode, and if coercivity decreases with increase of angle, MR occurs by curling mode. In our case, we observed M-type curves showing increase and decrease of coercivity with the increase of angle. It shows that CoMg nanowires show the combination of nucleation and curling mode of magnetization reversal behavior.

There are three main factors to determine the effective anisotropy (Hk) in ferromagnetic nanowires: (i) the shape anisotropy (2πMs), which will encourage a magnetic easy axis along the nanowire axis; (ii) dipole-dipole interactions among the nanowires persuading the easy axis perpendicular to the nanowire axis; and (iii) the magnetocrystalline anisotropy (Hma). The total effective anisotropy (Hk) is given as follows [18]:

$$ {H}_k={H}_{mc}+2\pi {M}_s-\frac{6.3{M}_s\pi {r}^2L}{D^3} $$
(2)

where Ms is the saturation magnetization, L is the length, D is the interpore distance, and r is the radius of the nanowires. The crossover of easy axis is possible in the nanowires from along the nanowires to perpendicular to nanowire depending upon critical length and diameter of nanomaterials from Eq. (2). Demagnetization factor depends upon shape and morphology of nanomaterials. Since our nanomaterial is nanowires and we did not change its morphology, so, we did not change demagnetization factor.

We found that from angle-dependent squareness, easy axis lies along the nanowires due to higher value of squareness as shown in Fig. 7 (b). It means that effective anisotropy is also in the direction of easy due to dominance of shape anisotropy and suppression of dipole-dipole interactions.

4 Conclusion

We successfully deposited Co1-XMgX(X = 0.04–0.12) nanowires of average diameter of 150 nm and length of about 23 μm using AAO template method at high temperature by varying voltage. The SEM results show that the morphology of our prepared material is nanowire and the EDX proved that the deposited material is CoMg. The XRD results show that the material contains hcp structure with polycrystalline in nature. The resulting nanowires obtained by tuning Co (ferromagnetic) and Mg (paramagnetic) materials are a soft ferromagnetic material which is proved by VSM results. Magnetization reversal mechanism is found to be the combination of curling and nucleation mode from angle-dependent coercivity.