I recently took part in the Engineering Education Scheme as part of a group from my school. We were tasked with designing and building a prototype rover to explore and detect metals on Pluto. This culminated in an 120 page report detailing our research, design, construction and problem solving to produce a product that suited our clients’ needs.

I carried out the circuit design component of the project and have documented how I designed and assembled it below.

Details and sources not included below are covered in the full project report which can be found here.

## Requirements

I derived the requirements for the circuit board from the overall requirements of the rover. Its key functions were:

• Driving the 6 rover motors, including speed control and direction control.
• Driving the 4 steering servos.
• Interfacing with the Raspberry Pi (which controls the autonomous navigation).
• Detecting metals with use of a detector coil mounted to the underside of the chassis.
• Stepping down the battery voltage to useful voltages for each part of the circuit and the external Kinect.

## Research

Once I knew what the general requirements of the circuit were, I began to research how each could be fufilled.

### Metal detection and pulse induction detectors

#### Inductors

Metal detectors work by the principle of inductance.

Inductance is the tendency of an electrical conductor to oppose any change in electric current flow. While all non-ideal conductors have inductance, inductors are components that take advantage of this property and are shaped in coils to have larger inductances. Where capacitors store energy in the form of an electric field, resisting sudden changes in voltage, inductors store energy in the form of a magnetic field and resist sudden changes in current.

The instantaneous potential difference, V, across an inductor can be characterised by

V = L \frac{dI}{dt}

where L is the inductance of the inductor and dI/dt is the rate of change of current through the inductor. V can be described as a back electromotive force as it is a self induced e.m.f. opposing the change in current through the inductor.

Inductance, L, of a coil is given by

L = \frac{N^2\mu A}{l}

where N is the number of turns in the coil, μ is the absolute permeability of the core material, A is cross sectional area of the coil and l is the length of the coil.

#### Use in metal detectors

A metal near a detector coil will alter the coil’s properties.

Detector coils typically have an air core so μ is relativity low. The permeability of ferromagnetic metals is substantially higher than air, so when the magnetic field created around the detector coil interacts with these metals, the μ of the detector coil will increase. This will increase the inductance of the detector coil.

When other metals interact with the magnetic field around the detector coil, eddy currents will be induced in the metals, increasing the effective series resistance of the detector coil.

#### Detecting metals with an Arduino

Inductance can be measured with an LCR meter but they are very expensive. Fortunately in this circumstance I did not need to know the actual inductance and resistance of the coil – an abstract relative value would suffice.

This circuit, based off this design, forms the basis for a very simple pulse induction metal detector.

The square wave is supplied by a microcontroller. On the rising edge of the square wave the current through L1 will begin to increase. As given by the equation above, L1 will develop a back e.m.f. across it opposing this change in current. While there is a p.d. across L1 the capacitor C1 charges. C1 will stop charging as the p.d. across the inductor stabilises to 0V and the p.d. across D1 drops below the diodes forward voltage.

The greater the inductance of L1 during a given pulse, the longer it will take for the back e.m.f across it to collapse, and the longer C1 will charge. The cycle can then repeat.

After a set number of pulses (~200) the microcontroller ADC can be used to measure the voltage across the capacitor giving a relative value for coil inductance. The resistor R1 prevents too much current being drawn through the microcontroller and protects the microcontroller from voltage spikes. The diode, D1, prevents the capacitor discharging on the falling edge of the square wave.

### Motors and servos

#### H-bridges

The mechanical research concluded that geared DC motors would be most suitable for this application and the specification requires that these can be driven in either direction and are speed controllable. To switch the polarity of a load, a H-bridge can be used. Typical H-bridge with a two P-channel and two N-channel MOSFETs in enhancement mode.

In this setup, two of four MOSFETs have a control signal applied to their gate, allowing flow of current through the motor in one direction. To flip the direction, the control signals to the initial two MOSFETs are switched off and applied to the other two MOSFETs. Current then flows through the motor in the opposite direction. For speed control, the control signals can be pulse width modulated.

#### Servo control signals

For steering the rover, the servos each needed to be independently controllable.

Servos contain small DC motors and a servo controller IC. A square wave is inputted into the servo data line and the pulse width of this square wave determines the angle to which the servo controller will move the shaft. Usually a 1ms pulse width indicates -90° and a 2ms pulse indicates 90°.

### Power management

The power source for this board is a Li-Ion battery, and while it does have a protection circuit, its output voltage is unregulated and depends on how much it is charged. Two widely used methods of regulating voltage are linear regulators and switching regulators.

Linear regulators function like potential dividers, with their resistance dependent on input voltage as well as load so a constant output voltage is maintained. They are relatively inefficient as the lower output voltage is regulated through dissipation of heat.

Switching regulators turn on and off the input supply and smooth the output to produce a stable voltage. Many use inductors to stabilise the current through the regulator. Much less energy is dissipated as heat in a switching regulator, making them more suitable for our high current application.

#### Buck converter working principles Voltage and current observations as the switch is opened and closed.

When the switch is closed V_{out} - V_{in} is applied across the inductor, L_1, which causes a linearly increasing current through it (\frac{dI}{dt} = \frac{V}{L}). This current flows to the output capacitor and load.

When the switch is opened, current continues to flow through the inductor. D_1, the freewheeling diode, is now forward biased and completes the circuit. L_1 has a fixed voltage (V_{out}-V_{diode}) across it so the current through it decreaces at a constant rate as it releases energy into the circuit. The output capacitor smooths the inevitable sawtooth ripple.

In reality the switch would be a transistor with connected to a PWM signal. The average voltage across L_1 must be zero as the output current averages to a constant.
Ignoring voltage drop across the diode to simplify:

• (V_{out}-V_{in}) is the voltage across L_1 when the switch is closed, t_{on}.
• V_{out} is the voltage across L_1 when the switch is open, t_{off}.
\therefore (V_{out}-V_{in})t_{on} +V_{out} \times t_{off} = 0
D=\frac{t_{on}}{t_{on}+t_{off}}  \space \Rightarrow \space V_{out}=DV_{in}

### Communication protocols I2C transfer being sent along bus. The first byte is the the slave address (08) and an indication that the master intends to write. The second byte is the data being sent from the master to the slave.

To interface with the Raspberry Pi, I needed to pick a suitable communication protocol for the circuit board to use. The Pi supports both SPI and I2C serial interfaces, two popular standards for communication between ICs and microcontrollers.

The only data being transferred between the Pi and the board was movement instructions and metal detector results, so the speed and capacity of the interface were less important. Because I wanted to minimise the amount of signal lines being used, I decided to look further into I2C which only uses two wires (as opposed to SPI’s four).

In this case, the Raspberry Pi was designated the master and the circuit board the slave.

### I2C

The I2C bus consists of a master-controlled clock line (SCL) and a bi-directional data line (SDA). Both lines are pulled up to V_+ with resistors. All I2C transfers are in 8-bit groups with a 1-bit acknowledgement (pulled down) after each.