*3.7.1 Hardware circuit design*

Implementation of the hardware can be a challenge without the correct equipment. Following the initial designs, in the prototyping stage, a breadboard was used (see above) to manually switch wires and avoid soldering until the circuit was fully working. However, breadboards are not a long-term solution, and the wires will begin to fall out of the sockets, so at the point that a working circuit is created, it should be noted down in a form such as this (**Figure 6**).

This then allows the creation of a long-term solution: a custom printed circuit board (PCB) soldering is required to do this, but it is much more secure and thus more reliable, especially in projects which experience a high level of movement. PCB designs usually represent the following (**Figure 7**).

#### **3.8 Track design**

A more modular layout is required for a project of this sort, because it is designed to be totally mobile and adaptable to different circumstances. Consequently, a Scalextric-type (modular) approach with around 6 corners and 10 straight pieces would be a good idea.

The turning circle of the car required a large space, and the size of an A2 paper was chosen to make a modular-type design of which various sheets could contain different directions which led to the following two possibilities:

#### **Figure 6.**

*Hardware circuit, sensors and motor controller.*

**Figure 7.** *Final PCB design of the hardware.*

**313**

*Computational Efficiency: Can Something as Small as a Raspberry Pi Complete…*

Due to the nature of the testing environment/demonstration environment—a floor—a decision was made to determine the track would have to blend into the background on which the track was being set, in case of the unlikely event when the track went off course. It was viewed, while considering the "canny edge detection" in **Figure 8**, that the white background may interfere with the surrounding environment and the image preprocessing would essentially and completely alter the image, so it is viewed that the black background would be more suitable for the

1.The images are scaled down from 1024x720 to 10x10 to add efficiency to the network as the larger the image, the larger is the network; 100 bits was an

2.The neural network should have five layers, to account for a steady rate of drop off in the number of nodes per layer, inevitably aiming to end up with three

3.Given the objective was to achieve 5 FPS while the vehicle was driving and the length of the test track was around 25 m, we determined at a steady speed of 2.5 km/h; the vehicle would undergo around 300 frames per iteration. This was then used to calculate that at a high level, while taking into account the possibility of overtraining and undertraining, the training set should be around 50x the size of the data it would be handling, taking into account duplicate images around corners and other variables, so a training set of ~15,000 images were

The first layer is the input layer—this has 100 nodes to represent the 100 values in the one-dimensional array the live image is converted to. Each one of these nodes

efficient base level for the number of nodes in the input layer.

*DOI: http://dx.doi.org/10.5772/intechopen.88342*

environment the vehicle will be in (**Figure 9**).

The following decisions were made:

collected manually and labelled accordingly.

represents 1 pixel in the 10x10 image.

The MLP topology for this project is as follows (**Figure 10**):

**4. Implementation**

*Black background with white lines.*

**Figure 9.**

**4.1 Machine learning**

outputs.

*4.1.1 Neural network topology*

**Figure 8.** *White background with black lines.*

*Computational Efficiency: Can Something as Small as a Raspberry Pi Complete… DOI: http://dx.doi.org/10.5772/intechopen.88342*

**Figure 9.** *Black background with white lines.*

*Control Theory in Engineering*

**Figure 6.**

*Hardware circuit, sensors and motor controller.*

**312**

**Figure 8.**

**Figure 7.**

*White background with black lines.*

*Final PCB design of the hardware.*

Due to the nature of the testing environment/demonstration environment—a floor—a decision was made to determine the track would have to blend into the background on which the track was being set, in case of the unlikely event when the track went off course. It was viewed, while considering the "canny edge detection" in **Figure 8**, that the white background may interfere with the surrounding environment and the image preprocessing would essentially and completely alter the image, so it is viewed that the black background would be more suitable for the environment the vehicle will be in (**Figure 9**).
