Chapter 10

Conclusions

Congratulations – you have now completed the material in this book! The last nine chapters have looked at three core areas of electronics concepts, Arduino control and audio circuits (Figure 10.1).

Figure 10.1Textbook organizational structure. This diagram is taken from the introduction chapter and shows the three main areas of this textbook: electronics concepts, Arduino control and audio circuits. The first three chapters introduced systems and DC circuit theory, leading to chapters 4 and 5, which covered programming the Arduino to build the milestone project of a MIDI drum trigger. Chapters 6–8 then introduced audio-related topics of AC circuit theory, amplification and filtering. The final project in chapter 9 combined all of these areas to build an Arduino-controlled 2-band equalizer amplifier.

This book has aimed to provide you with an introduction to audio electronics and Arduino control, and has covered a lot of material within a single introductory text. In each chapter, practical projects were used to underpin the concepts and methods involved to help ground your learning. The first three chapters focussed on electronics concepts, where chapter 1 introduced the fundamental quantities of current, resistance and voltage that are used throughout electronic circuits. This chapter also discussed how some of the scales and the number of quantities involved can often confuse the new learner – even though the actual equations used in electronics (e.g. Ohm’s Law, Kirchoff’s Laws) are often quite simple arithmetic operations. The next chapter looked at electronic systems to show how sensors (inputs) are processed by microcontrollers like the Arduino to produce actuator (outputs). Chapter 3 then introduced Ohm’s Law and Kirchoff’s Laws as the fundamental equations that govern direct current (DC) circuits. At this point, the important concept of the voltage divider was also introduced – which is used in operational amplifier biasing, feedback, audio filtering and also digital potentiometers.

Chapters 4 and 5 moved on to look at Arduino control, where the ATmega328p microcontroller can be programmed using the C (or C++) language – though it was noted that these chapters provide an overview of programming instructions and methods, as a full programming course is outwith the scope of this book. Chapter 4 looked at variables, functions and Arduino output (using PWM) while chapter 5 moved on to arrays, digital/analogue input, and working with external libraries to set up serial communication through a standard 5-pin DIN MIDI interface. The chapter 5 project used this interface with a piezo sensor to build a MIDI drum trigger system – representing the first milestone of the book.

Chapter 6 introduced alternating current (AC) signals, which vary over time. Sinusoids are used extensively in audio analysis, and so understanding the time-varying response of capacitors is key to working with audio circuits. Chapter 7 discussed amplification as a means of increasing the small signals from sensors like microphones to a level that can drive a load like a loudspeaker. The chapter looked at how semiconductors are used in amplification, providing an overview of BJT amplification as a reference for many audio schematics. The combination of BJTs within an integrated circuit creates an operational amplifier, which is much more stable to work with. The chapter project built a minimal LM386 audio amplifier, showing how capacitors can be used for DC blocking, power decoupling and adding a Zobel network to balance the inductive load of a loudspeaker output. Chapter 8 used this amplifier project as the basis of a 2-band equalizer project that combines first-order low- and high-pass filters in a passive design – noting the limitations of such circuits in practical terms.

The final chapter 9 project adapts this 2-band equalizer amplifier circuit and combines it with digital potentiometers to allow the Arduino to control the filter levels within the amplifier circuit. In so doing, a much more complex build process was required that uses the entire space available on a 30-row breadboard. This project covered the use of the serial peripheral interface (SPI) protocol to allow the Arduino to control MCP413-103 digital potentiometer chips that were connected to first-order passive low- and high-pass filter stages. These control points represent the second milestone of the book – where Arduino digital control has been integrated with an analogue audio circuit for filtering and amplification.

10.1 Future work

As an introductory text, the aim of this book was to provide you with enough information to begin practical audio electronics work without becoming too detailed in areas that will require further time and study. This is most notable in relation to both computer programming and AC circuit theory, where the introductory nature of these chapters is apparent (and necessary for brevity). Thus, chapters 4, 5 and 6 should not be considered as comprehensive and further investigation will be required by the reader to develop a deeper understanding of these topics. For now, the three core areas of the book can be considered as initial directions for further study – there is always more to learn!

10.1.1 Electronics fundamentals

The fundamental concepts of current, resistance and voltage can take time to become fully familiar with. Even though you may now understand what voltage and current are and how they behave at a basic level, synthesizing these quantities into a working understanding of circuit behaviour requires both further learning and practical experience – the more circuits you build, the more you will become familiar with the practicalities of the movement of electrons. Although Ohm’s Law and Kirchoff’s Laws are both simple and powerful, they describe ideal conditions that do not always manifest themselves in practice. The effects of small variances (such as resistor tolerances or battery current) can all combine to produce less than expected results, and so practising with circuits that combine series and parallel components is recommended to study how they deviate from the expected values. LTspice can quickly simulate a circuit that can then be transferred to breadboard for analysis, where a multimeter can then be used to measure the actual levels in the circuit.

In addition, as circuits become more complex, an equivalent circuit is often used to reduce the number of the components involved in the analysis of the current stage of the system. A Thevenin circuit will represent all the components before a specific node in the circuit as a single voltage source and resistor that is their equivalent. Similarly, a Norton equivalent would represent these components as a single current source with a resistor – either can be used depending on the type of signal analysis being performed on the following stage of the circuit. In practical terms, the audio filter stages in the chapter 8 project could have been modelled as a Thevenin equivalent circuit to determine the input source impedance (and signal voltage level) seen by the LM386 audio amplifier. Though not overly complex as a technique, Thevenin and Norton equivalence was omitted to keep the focus of chapter 8 on audio filtering only – nevertheless they are very useful techniques that are worth learning.

Audio electronics can become quite complex due to the use of AC signals, and it is important to understand that this book has not provided a detailed discussion of several important areas. Although the theoretical complexity of AC signals has been reduced where possible to allow time-varying signals to be used, there are significant elements (notably phase) that require further study if you wish to extend your knowledge of audio electronics. For phase calculations, complex numbers can be daunting for many learners (the clue is in the title!) but they are a very elegant solution to the problem of representing a dimension of variance (in this case magnitude over time) within a set of data. When AC circuit theory was first proposed, the use of imaginary numbers was a very clever way of linking the magnitude and phase of a signal together. In this system, the symbol j represents the value of 1 (in mathematics this is the symbol i, but as i is used for current in electronics the next letter  j is used), which helps to define the portions of a sine wave where the amplitude is negative. Although initially more difficult mathematically, complex numbers are nevertheless essential to progressing your knowledge of audio electronics beyond the basic usage discussed in this book.

In the introduction to this book, it was noted that no soldered components (other than the analogue potentiometers in chapter 8) are used. This decision was made mainly to keep costs down (a soldering station can be expensive) and reduce the working area needed to complete the projects – but it was also made for safety reasons. Soldering is an essential technique that every electronics engineer should know, and it should not be feared (no more than learning how to safely use a hob to boil a pot of pasta or rice), but it can often be forgotten that solder melts at ~180°C for lead alloy and ~240°C for lead-free (the iron will typically be ~350°C), which are much hotter temperatures than those typically found in most home kitchens. For these reasons, soldering was avoided in this introductory text but learning how to solder a jack connector onto an audio cable is a useful skill to learn and it is recommended that you investigate this further.

10.1.2 Arduino control

This book has covered the basic use of the Arduino as a microcontroller, but there are a plethora of other resources available that look at many of the other possibilities of this board. The Arduino community is large and very innovative, comprising everyone from electronics educators and students through to hobbyists and those from completely different areas who wish to add electronic control to their activities. There are also numerous resources available for learning computer programming that will help to extend your knowledge of what the Arduino is capable of. For modern programming (which is primarily focussed on mobile or ‘always on’ devices) a more thorough investigation of event-driven programming (EDP) is recommended to better understand how a microcontroller like the ATmega328p will respond to inputs within the code – the loop() function is effectively the ‘heartbeat’ of the Arduino.

It is also recommended to progress your learning of programming through a strictly typed language like C/C#/C++, as these languages enforce memory management (unlike languages such as JAVA that provide automatic garbage collection). When working with microcontrollers, maximizing the available resources is crucial and so learning to think of data in terms of its size is a very useful approach. In addition, if you wish to progress into audio digital signal processing (DSP) then memory allocation (and pointers) becomes fundamental to processing and rendering – the C language is still widely used in audio callback structures due to its simplicity and speed. There are many Arduino audio DSP examples available, but this book has avoided working directly with digital audio as the Arduino is arguably not powerful enough for any useful DSP processing of a digital input signal. For more advanced audio programming, the JUCE platform (https://juce.com/) provides open-source, cross-platform resources for audio DSP – alongside a growing developer community.

The chapter 5 project implemented a simple MIDI drum trigger system based on a single piezo sensor input. In practice, this illustrates the beginning of significant possibilities for the Arduino as part of a MIDI control system. The MIDI protocol is capable of much more than Note On and Note Off messages (though this was its primary design), and considering the many different ways in which MIDI control is used in practice opens up the Arduino to numerous possibilities. MIDI is robust, versatile and cheap to implement – it has been used extensively in many live audio systems for sound, lighting and synchronization control. It is definitely worth investigating how the chapter 5 project could be extended both in its own right (to incorporate multiple sensor inputs), but also in how the core system of sensor input and MIDI input could be adapted and applied to many other system applications.

In chapter 9, the Arduino was used as a controller that takes digital (switch) or analogue (piezo, potentiometer) sensor inputs and then uses selection instructions to determine what outputs to produce. This approach (though valid) does not consider the huge range of possibilities of digital systems, where binary sensor information can be evaluated using combinations of logic gates. Some of this logic was introduced briefly with the Boolean operators AND/OR/NOT (&&/||/!) used in selection instructions, but these operators also describe the core function of dedicated digital components designed to implement digital logic. One practical use for logic gates is to replace more complex coding algorithms that analyse multiple sensor inputs (such as the push-button state counter in chapter 9) with dedicated digital components that performs the same analysis. Simply put, the chapter 9 loop() function code would have been significantly less complex if it executed processes based on a single data input defining the current state number – a value that could have been provided by a dedicated digital logic system that used gates to increment (and reset) a counter based on push-button input.

In some respects, it can be argued that the Arduino has not yet been fully embraced as a controller within audio projects – other than those examples that use the MIDI protocol (which is not audio in itself). This book has aimed to illustrate how easily digital control points can be added to an analogue audio circuit, and hopefully the use of digital potentiometers within an audio circuit has shown how other control circuits may be built in a similar way. Working from the chapter 9 project, the Arduino can be used with an analogue potentiometer to set the value of the variable that controls the level of diode distortion being added in an operational amplifier feedback loop. Similarly, amplifier gain and volume levels could be individually controlled by incrementing a push button, which opens up numerous possibilities for digital control of an analogue audio circuit.

10.1.3 Audio electronics

As noted, the main aim of this book was to introduce audio electronics, allowing the new learner to ground their interest in audio equipment within a practical context. Having said this, constraints of space (and scope) have led to significant omissions in the content – arguably the most notable of these being a more thorough discussion of inductance. In simple terms, inductors and capacitors respond in the opposite manner to the frequency of the input signal being applied, but capacitors can be used in many ways (e.g. DC blocking, power decoupling, rectification smoothing) and this is also true of the inductor. A dynamic loudspeaker (which describes most commercially available examples) is primarily an inductive component and thus will present a more complex load impedance to the signals required to drive it as an actuator. This loudspeaker impedance will also combine other capacitive and resistive elements, and so power amplification can become a very complex process.

Most electronics textbooks (and courses) will use a resistor/inductor/capacitor (RLC) circuit to teach AC signal theory, as such circuits help to illustrate the complex phase relationships between inductive and capacitive components. In addition, they better model real-world conditions for components like loudspeakers and other components such as signal and power cables, which may also contain parasitic capacitances and inductances depending on the conditions they are being used in – these mainly manifest themselves as noise added to the system. Although this book has avoided the more detailed analysis involved in an RLC circuit, it is recommended that this be studied to develop a more comprehensive understanding of the interplay between common audio circuit components.

The chapter 7 project was based around a minimal LM386 audio amplifier, which can be used as the basis of numerous other audio projects (there are many online examples of LM386 circuits). This is a good point to extend your practical learning from, but it does not cover the significant distinctions between circuits for preamplification, unity gain amplification for buffering (commonly used in audio processing) and dedicated power amplification systems that conform to several different classes of signal amplification (A/B/AB/C/D). All of these areas have very different design criteria, which goes some way to explaining the difficulties encountered when designing (and implementing) a professional multistage audio system. Even the distinction between microphone and line-level signal inputs (a feature that is now commonly provided in most audio recording equipment) requires a lot of design and planning to be performed effectively – notably in the avoidance of noise and/or crosstalk between the separate input stages. For this reason, this introductory text has simply noted these distinctions, but further study of each area will take significant time and effort.

Similarly, the chapter 8 project builds upon the minimal LM386 audio amplifier circuit to provide 2-band equalization, but this circuit is a first-order passive design intended to show how at the simplest level a filter is effectively a frequency-dependent potential divider. In practice, first-order filters are most commonly encountered in guitar tone control circuits and cheaper amplifiers that are primarily focussed on reducing component counts. Higher-order filters can produce much more musical results (given the steeper slope they achieve) but the design calculations are much more complex and in practice introduce significant attenuation of the signal due to the additional components involved – this is also why a bandpass filter was not implemented in the chapter 8 project. Higher-order filters typically require active (amplified) designs in order to be effective, where some form of amplification stage is built into the filter design (rather than simply amplifying the result as in the chapter 8 and 9 projects). In addition, controlling filter parameters such as bandwidth, centre frequency, Q and slope (usually provided in more expensive equipment) requires further design to determine how best to implement these variances within the filter stage. The Baxandall filter design is a very good example of how filtering can be extended beyond the basics discussed in this book – it is considered to be a very powerful design for implementing practical audio filtering and control.

The projects in this book have deliberately been designed for breadboard implementation, both to reduce costs and also allow you to learn as you build. Having said this, the final results of these projects are nowhere near the level of commercial audio equipment, and thus translating circuits onto either Veroboard or printed circuit board (PCB) layouts is a more advanced skill than developing the simpler row/column layouts used in this book. Working with real circuit designs can become very complex, and so more powerful tools are required. There are many PCB design tools available, including ORCAD (www.orcad.com/), which offers a free version of the application to registered students (much like the Autodesk product suite). The chapter 9 project split the breadboard between control (top columns) and signal (bottom columns) both for design clarity and also to reduce noise as much as possible – notably in providing a dedicated earth path between input and output signal connector blocks. This separation of power and signal paths can be significantly extended on Veroboard and PCB by connecting each of them to a separate side of the board – a useful principle to remember.

10.2 Final notes

In completing the material of this book, you have covered a significant amount of ground in audio electronics in a short space of time. The aim of this introductory text is to get you working with circuits quickly, without skipping the core theoretical concepts that underpin them. Audio electronics is a wonderfully complex area where many disciplines (e.g. acoustics, music, programming) overlap – this can be a very creative space to work in. Having said this, the perceived ‘niche’ aspect of audio can also lead to a misunderstanding of both its complexity and value – it is not uncommon to find linear solutions being proposed to musical problems!

Whatever direction your learning now takes, it is hoped that this book will provide you with some of the basic information and techniques that you will need to progress further – knowledge is always your most valuable resource. It is not possible to write a single text on all elements of audio, electronics or Arduino control, but this book has tried to bridge the gap between tutorials and textbooks. It is hoped that you will now continue to learn about audio electronics and Arduino control. If you persist, you may eventually develop your own ideas and solutions.

To quote the great Les Paul: ‘No one has come up with a set of rules for originality – there aren’t any’.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.24.60