Categories
Research

Audio circuits!

Surfing the internet many interesting things come up such as the Top 10 video games of the year or cute and funny cat videos. However that not what has caught my attention this past week. Funnily enough it has been the topic of audio electronics. Audio circuits to be more precise. I browsed the internet on audio circuits and I came across a few interesting websites that detailed a lot about how to build simple circuits with Arduino. In the following blog post I will detail some simple Arduino board circuits to help me understand audio electronics much better and hey!, if you find anything interesting feel free to try them yourself.

Arduino Uno REV3

RGB LED

RGB has been getting ever so popular with gaming products on the rise in terms of sales and production. I’ve always wondered how they work and I finally found the circuit that showed just that.
To begin the parts needed are:

  • (1) Arduino Uno
  • (1) USB A-to-B cable
  • (1) Breadboard
  • (1)RGB LED
  • (3 )300 ohm Resistor
  • (5) jumper wires
arduino uno projects for beginners
RGB LED circuit

Steps:
Connect the Arduino board to a computer using a USB cable. Download the file Circuit_09_RGBLED and open the project code in Arduino.
Select the board and serial port so that the code is able to run through the board. Ensure everything is running and once that is done, click the upload button to send the sketch to Arduino.
What should follow is that the LED will turn on and change different colours.

RGB fan for a computer. Nowadays it is very common to see an average gamer have something RGB related.

Push Button

Learning how to create a circuit with a push button is important if you want to learn to create anything as a majority of products have buttons with functions on it. This specific circuit that I am going to show has an LED light switch on after a press of a button. For me, learning how this circuit works is beneficial as it opens up the idea of adding buttons to my. project. These are the parts you are going to need:

  • Arduino uno
  • USB A to B cable
  • Breadboard – half size
  • 1 LED 5mm
  • 220 Ohm resistor
  • 10k ohm resistor
  • push button switch
  • 6 jumper wires

Connect the Arduino board to a computer using a USB cable. Download the file and code related to this project on Arduino.com and open the project code in Arduino.
Select the board and serial port so that the code is able to run through the board. Ensure everything is running and once that is done, click the upload button to send the sketch to Arduino.
What should follow is that the LED will turn on after a press of a button.

Working with an LED and a Push Button - Arduino Project Hub

Much More

I could spend more time detailing more circuits on how to make them however I’ll just leave it at these 2. When you learn 1 circuit it is possible to combine these circuits to complete ‘harder’ functions. For example a circuit with a button should look similar regardless if the function is to turn on a button that makes a noise or emits a light. Overall the world of electronics is daunting at first however if you take it step by step and circuit by circuit it all comes together.

Categories
Practical

A test run

I recently received my components on the 3rd of November. I immediately wanted to begin the project. However to be honest it is a daunting task as I have not been doing practical work on audio electronics in a whole year! So to ease this pressure I think a test run of some sort is was due. On November 5th I went to the electronics lab at DMU on campus to inspect and understand all my components.

Electronic Component Shortages Update -- 2022 and Beyond
Electrical components

Component list

My electronics kit I ordered
  • Arduino Board
  • Piezo speaker
  • 2N222 Transistor
  • 1K Resistor
  • 100uF Capacitor
  • 9v battery
  • Male to male jumper wires
  • 3 pin female header

There were a couple components that I was already familiar with before getting my hands on. This is because they were reviewed previously on another blog post. This included the:

  • 1k resistor
  • 100uF Capacitor
  • 2N222 Transistor

I began with the most vital component of any circuit, the circuit board itself. This one in particular is an Arduino board. Arduino (as discussed in a previous blogpost) is an open source platform used for building electronic projects. It consists of a physical programmable circuit board, which I have in my hand in the picture below, and a piece of software or IDE that runs on a computer. This piece of software can be used to upload and write computer code to perform functions such as play sound or light an LED. One particular aspect that makes Arduino very accessible to beginners is the use of USB. Furthermore it uses C++ program which is very popular and easier to learn.

Arduino Uno Rev3 — Arduino Official Store
Arduino Uno REV3 board

The piezo speaker is the component of the project that will produce the sound. It is a loudspeaker that used the piezoelectric effect for generating sound. In laymen terms the piezoelectric effect is when a material has the ability to generate an electric charge in response to applied mechanical stress.

How Piezoelectric Speakers Work - Technical Articles
Piezo speaker

The jumper wires that are going to be used are electric wires that connects remote electric circuits used for printed circuit boards such as Arduino. A jumper wire can short circuit a circuit and short cut to the electric circuit.

Male to Male jumper wires

The battery is 9v. It will act as a source of power for the circuit. It will enable the piezo speaker to function.

Duracell Plus Power 9V Battery - A S Supplies (Retford) Ltd.
9v Battery

What we have here for me is a 3 pin female header. A pin header is a type of electrical connecter. It is used to take current or signal transmissions.

HARWIN M20-7822046
Female pin header

Simple practice

Once I got to understand each and every part through getting hands on experience I wanted to test myself with building a very basic circuit that implements simple code. I found a similar circuit on Arduino’s website that uses a simpler version of the code that I will run. Here is the link to the website. https://www.arduino.cc/en/Tutorial/BuiltInExamples/toneMelody
Tinkercad was used before physically starting it, to ensure that the code would run properly.
This circuit plays a melody using code through a piezo speaker connected to the arduino uno board.

TinkerCAD


The setup was followed on the website through TinkerCAD and I typed all the code into the script. I then setup the schematic (as seen above). I ran the code and it played a very scuffed melody through the piezo speaker. After the test was a success, with the code being runnable, I began with following the schematics and building this simple circuit.

Tone Schematic
Schematic to simple circuit

Once the jumper wires were connected from the arduino board to the breadboard it was time to ensure that the circuit was working. I opened up Arduino in my laptop so I could input the code. It was very easy as I just; copied the code into the Arduino and let it run. Once the code ran, I uploaded it into the board and it played a melody through the piezo speaker.

Arduino board connected to a piezo speaker using a breadboard

An Overall Success

The test run was a success as I got to understand all the components of my project. Furthermore I built a very basic circuit which has a similar function to mine in order to get some hands on practice before I begin the project. I am more prepared and excited to begin!

Categories
Research

Loudness and its relation to electronics

An interesting thought

How Harmful is Loud Music on Your Hearing? - Collin County ENT
Suppose to be a representation of me listening to music.

Last night I sat chilling in my room with the music playing aloud. I was enjoying my music and increased the volume. The battery on the speaker was blinking red indicating that it was going to run out unless I charge it. It noticeably got quieter and I thought to myself “hmmm does the amount of power or voltage determine how loud the speaker can get?” That thought then led me to think about my project and specifically the piezo speaker. I immediately went on to my laptop to conduct some research. In this blog post I will share my findings and my thoughts on how it may help me on my project.

Basics first

Before jumping into how loudness is related to power, lets stick to the basics first. What is loudness, power and how is sound actually produced in a speaker is important to understand as it will give us an understanding to how power or voltage may be linked to it.

Power and Voltage

Power in this case is referred as watts. Watts are the units of measure we Voltage is the pressure from an electrical circuit’s power source that pushes charged electrons (current) through a conducting loop, enabling them to do work such as illuminating a light.

File:Ohm's law triangle (VIR).jpg - Wikimedia Commons
https://commons.wikimedia.org/wiki/File:Ohm%27s_law_triangle_(VIR).jpg VIR triangle for determining the voltage, resistance or current of a circuit.

Loudness

Put simply, loudness is the level or intensity of sound. It is measured in decibels or dB. It uses a logarithmic scale meaning it is the inverse function to exponentiation. In laymen terms when it comes to adding loudness level you must use a mathematical equation in order to get the right answer. Decibels cannot be added together .

Loudspeaker

A loudspeaker produces sound through converting electrical signals into sound waves in the following way. A current within in the coil create a magnetic field which interacts with the permanent magnet generating a force, which then pushes the cone outwards. The current in the cone is meant to flow in the opposite direction. The direction of the magnetic field reverses and the force of the cone then pulls it back in. The repeatedly alternating current direction makes the cone vibrate in and out and these vibrations cause pressure variations in the air. Hence sound is produced. It is important to know that to make loudspeaker cone vibrate correctly, the electric current must vary in the same way as the desired sound.

Moving coil loudspeaker, diagram - Stock Image - C050/8197 - Science Photo  Library
Loudspeaker diagram

Now that we know how sound is produced in a loudspeaker we can come up with the conclusion that loudness is related to power and voltage. (When I was at this stage of research I became more intrigued because I had realized that this newfound knowledge was going to affect the project in some way). It was then the time to find out how loudness is related to power and voltage. Here is what I found.

Loudness and its relation to voltage and power

This chart below represents the relationship between all the terms we had previously discussed.

dB ChangeVoltagePowerLoudness
31.4X2X1.23X
62.04.01.52
103.16102
20101004
4010010,00016
https://www.gcaudio.com/tips-tricks/the-relationship-of-voltage-loudness-power-and-decibels/

Here we can see on the chart that there is no consistent increase between any of the different units. From what we can conclude here is that to get a doubling of loudness, an increase of 10dB is necessary. Furthermore, to reproduce that volume through the loudspeakers in the first place, would require ten times more power from the amplifier.

Conclusion

Emoji symbols
Happy man (me)

Overall I am very happy with my findings as it answered many of my previous questions I had in mind before beginning the project. The main takeaway from this for me is now I understand why my piezo speaker may not produce a lot of sound in comparison to a normal PA system. I may also improve my second version with the thought that I can improve the speakers in mind.