### 2.1 Design

The circuit layout of the fuel-level sensor is shown in Figure 1.The fuel-level sensor was properly placed on a fuel tank with total volume of 27 cm × 27 cm × 37.5 cm. This is shown in Figure 2a. The geometry formed by the sensor arm and floater is shown in Figure 2b.It is obvious from Figure 2b that

cos\mathit{\theta}=\frac{\mathit{Z}}{\mathit{l}}\phantom{\rule{0.75em}{0ex}}\mathrm{or}\phantom{\rule{0.87em}{0ex}}\mathit{z}=\mathit{l}\phantom{\rule{0.25em}{0ex}}cos\mathit{\theta}

(1)

where *l* is the length of the sensor (in cm), *z* is the height of the vacuum existing between the top of the fuel level in the tank and the top of the tank (in cm).

Since *l =* 23 cm, it then implies that

\mathit{z}=23\phantom{\rule{.25em}{0ex}}cos\mathit{\theta}\phantom{\rule{0.62em}{0ex}}\left(\mathrm{cm}\right)

(2)

and also

\mathit{H}=\mathit{z}+\mathit{h}\phantom{\rule{1.37em}{0ex}}\mathrm{or}\phantom{\rule{0.87em}{0ex}}\mathit{h}=\mathit{H}-\mathit{z}

(3)

where *h* is the height of the fuel in the tank.

Substituting Equation 2 into Equation 3 and knowing well that *H* = 37.5 cm, Equation 4 is then established.

\phantom{\rule{0.25em}{0ex}}\mathit{h}=37.5-23\phantom{\rule{.25em}{0ex}}cos\mathit{\theta}\phantom{\rule{0.75em}{0ex}}\left(\mathrm{cm}\right)

(4)

Volume *V* of the fuel in the tank is given by

\phantom{\rule{0.25em}{0ex}}\mathit{V}=\mathit{h}\times \mathit{A}

(5)

where *A* is the area of the tank.

Substituting Equation 4 into Equation 5 and knowing that area *A =* 27 cm × 27 cm, Equation 6 below is achieved.

\phantom{\rule{0.25em}{0ex}}\mathit{V}=\left(37.5-23\phantom{\rule{0.25em}{0ex}}cos\mathit{\theta}\right)\phantom{\rule{0.5em}{0ex}}\mathrm{cm}\times 27\phantom{\rule{0.25em}{0ex}}\mathrm{cm}\times 27\phantom{\rule{0.25em}{0ex}}\mathrm{cm}

(6)

\phantom{\rule{0.25em}{0ex}}\mathit{V}=729\left(37.5-23\phantom{\rule{0.25em}{0ex}}cos\mathit{\theta}\right)\phantom{\rule{0.25em}{0ex}}\left({\mathrm{cm}}^{3}\right)

(7)

Since 1,000 cm^{3} = 1 L, *V* therefore becomes

\mathit{V}=\frac{729}{1,000}\left(37.5-23\phantom{\rule{0.25em}{0ex}}cos\mathit{\theta}\right)

(8)

\therefore \mathit{V}=27.3375-16.767\phantom{\rule{0.25em}{0ex}}cos\mathit{\theta}\phantom{\rule{1em}{0ex}}\left(\mathrm{liters}\right)

(9)

The potentiometer equation states that

\phantom{\rule{0.25em}{0ex}}{\mathit{V}}_{\mathrm{out}}={\mathit{V}}_{\mathrm{in}}\times \frac{\mathit{\theta}}{{\mathit{\theta}}_{\mathrm{T}}}

(10)

where *θ* is the angle of rotation of the potentiometer, *θ*_{T} is the total angle through which the potentiometer can rotate (280°), *V*_{in} is the input voltage from a direct current (DC) source (9 V = 9,000 mV).

\phantom{\rule{0.25em}{0ex}}{\mathit{V}}_{\mathrm{out}}=\frac{9,000\mathit{\theta}}{280}\phantom{\rule{0.87em}{0ex}}\mathit{or}\phantom{\rule{0.62em}{0ex}}\frac{225\mathit{\theta}}{7}\phantom{\rule{0.5em}{0ex}}\left(\mathrm{volts}\right)

(11)

It is established from Equation 4 that

\phantom{\rule{0.5em}{0ex}}\mathit{\theta}={cos}^{-1}\left(\frac{37.5-\mathit{h}}{23}\right).

(12)

By putting Equation 12 in Equation 11, Equation 13 below is established.

\phantom{\rule{0.5em}{0ex}}{\mathit{V}}_{\mathrm{out}}=\frac{225}{7}{cos}^{-1}\left(\frac{37.5-\mathit{h}}{23}\right)\phantom{\rule{0.75em}{0ex}}\left(\mathrm{volts}\right)

(13)

The height *h* of the fuel in the tank can also be calculated in terms of output voltage by making *θ* in Equation 11 the subject of the formula, i.e.,

\mathit{\theta}=\frac{7}{225}{\mathit{V}}_{\mathrm{out}}.

(14)

Putting Equation 14 into Equation 4, Equation 15 is derived.

\mathit{h}=37.5-23\phantom{\rule{0.25em}{0ex}}cos\left(\frac{7}{225}{\mathit{V}}_{\mathrm{out}}\right)\phantom{\rule{0.75em}{0ex}}\left(\mathrm{cm}\right)

(15)

Therefore, the fuel volume at a given output voltage can be derived by putting Equation 15 into Equation 5. Equation 16 is therefore obtained.

\phantom{\rule{0.25em}{0ex}}\mathit{V}=\mathit{A}\left[37.5-23\phantom{\rule{0.25em}{0ex}}cos\left(\frac{7}{225}{\mathit{V}}_{\mathrm{out}}\right)\right]

(16)

Since the tank has a constant area *A* of 27 cm × 27 cm, Equation 17 below is established.

\phantom{\rule{0.25em}{0ex}}\mathit{V}=0.729\left[37.5-23\phantom{\rule{0.25em}{0ex}}cos\left(\frac{7}{225}{\mathit{V}}_{\mathrm{out}}\right)\right]\phantom{\rule{1em}{0ex}}\left(\mathrm{liters}\right)

(17)

### 2.2 Construction of a fuel-level sensor

Construction of the sensor was carried out with materials such as a rotary potentiometer (or variable resistor), 9-V battery, switch, LED, resistor, floater, steel arm, plastic adaptor, screws, wire, and fuel tank. The arm and floater assembly was constructed by mounting the floater with a bolt and nut to an accurately dimensioned steel arm. A plastic adaptor was then attached on this assembly as shown in Figure 3a. The sensor circuit was properly placed in a suitable casing. With the potentiometer extending out of the casing, an assembly of arm and floater was mounted on the potentiometer with the aid of the plastic adaptor as shown in Figure 3b.

After the whole construction, the workability of the fuel sensor was confirmed. This was done by mounting the fuel sensor on the fuel tank, and as the fuel level in the tank increased, the floater began to rise up, thereby rotating the potentiometer. The voltmeter was used to verify the expected increase in voltage.