New Mechanics Tryout - Week 8 & Week 9

Assembling Connection Pins

In Week 8 & Week 9, my online packages for Arduino mechanics are finally here. I start by assembling the pin connections.



The assembling pins parts all refer to online resources I found. I only attach one push button in the current state to ensure it can work after moving on to multiple buttons.


Importing Libraries

I refer to multiple online resources codes which told me that I need to download two libraries from Arduino which are the TMRpcm library and the SPI library




TMRpcm library - used for audio playback in my project
SPI library - helps for hardware controller to know whether the button is detected or undetected in my project.

I then install these two libraries and imported them to my Arduino code.




Technical Codes Tryout

The first-time tryout with the code was not going well, I got an error that told me the TMRpcm library has no member named 'startrecording'.



I spent some time trying to solve these errors and finally its fix. I have to go with its own created code to uncomment out the codes that I needed which means visiting the downloaded library folder and enabling the line codes that have the function of 'startrecording' and 'endrecording'.



I then continue to work on the codes. The codes worked with no issues. However, the record and playback functions do not work at all. It can print out messages when I try to hold the button, push a one-time button, and no push button at all.



I found this but it does not help me to solve my current issues.





In the current stage, I find more references trying to make it workable and I got multiple failed results.



because I keep trying the codes, I sometimes will get the Arduino port busy which I need to replug again and reconnect with the code. Somehow, the code works with no issues and is able to print messages but still unable to record and playback.

More Tryout


Due to the code is not the problem, I solve the hardware Arduino connection. Try to find more references to support the right connection between them. In this video, I readjust the connection wire, and when I press to record, it gives me a very short sound clip.



Another video of readjusting connection wires and coming out with a very loud sound but being unable to control it.
After so many failed tryouts, I then decide to ask for technical consultation from lecturers.

Technical Consultation

After having a consultation with the lecturer, I got to know that I have to apply for an SD card so that I can record the sound clip and be able to playback. Because the Arduino Nano only has a small voltage of power, it cannot support much of the sound being playback.
Therefore, I have to repurchase items that I need.



Online Purchase Items


Items that I purchased


In the period of waiting for online purchased items, I try out another library to test out the sound volume of the speaker.

The testing video showcases me recording a sound clip on the computer and exporting it to a series of numbers that be able to playback through an Arduino speaker.




Arrived mechanism tryout

 



I try out the arrived mechanism with codes, and it was still unable to record and playback but the printing system was able to generate when I try to press, hold and release. I also spent a lot of time-solving this problem which make me pretty much struggle in the current state because I think my progress was so slow. I managed to find technical consultation from another lecturer.


Technical Consultation

 
After consulting with the lecturer, he told me that the button is hard to define when I press it once and when I hold the button. Therefore, I need to refine the codes to tell the button clearly what state the user is in by defining the time period for the button.

He also told me that the button was really important to clearly tell it unless the function cannot be implemented. These are the correct code that enable the button clearly define in the release, hold button, and press button state.

It utilizes the reset function to reset the button every time the button had pressed so it won't auto playback.

Single Button progress for hold, press, and release state

Tryout with a single button and it has succeeded to print out a different state.







Multiple Buttons print separately

Tryout with multiple buttons and it has success to print out a different number which means buttons can function separately.






Though

During these 2 weeks, I experience a lot of failed results that take me a lot of time. Even though I experienced so many failed results, I learned a lot through the process and gain more understanding of Arduino.


References List

Technical research

Arduino Stack Exchange. (2018). arduino uno - Using TMRpcm library, the audio does not play. [online] Available at: https://arduino.stackexchange.com/questions/17169/using-tmrpcm-library-the-audio-does-not-play [Accessed 10 Jan. 2023].

BalchMore, P. (n.d.). Speech Recognition With an Arduino Nano. [online] Instructables. Available at: https://www.instructables.com/Speech-Recognition-With-an-Arduino-Nano/ [Accessed 9 Jan. 2023].

chat.openai.com. (n.d.). ChatGPT. [online] Available at: https://chat.openai.com/chat.

ed (2021). Arduino Push Button - Complete Tutorial. [online] The Robotics Back-End. Available at: https://roboticsbackend.com/arduino-push-button-tutorial/ [Accessed 9 Jan. 2023].

GitHub. (n.d.). Home · TMRh20/TMRpcm Wiki. [online] Available at: https://github.com/TMRh20/TMRpcm/wiki [Accessed 10 Jan. 2023].

GreatScott! (2019). Make your own Spy Bug (Arduino Voice Recorder). [online] www.youtube.com. Available at: https://www.youtube.com/watch?v=7Hn4UFi9wvs [Accessed 3 Jan. 2023].

Gupta, S. (2021). Simple Arduino Voice Recorder for Spy Bug Voice Recording. [online] Circuit Digest. Available at: https://circuitdigest.com/microcontroller-projects/simple-arduino-voice-recorder-for-spy-bug-voice-recording [Accessed 3 Jan. 2023].

JawadMore, H.S.S. (n.d.). Playing Wave File Using Arduino. [online] Instructables. Available at: https://www.instructables.com/Playing-Wave-file-using-arduino/ [Accessed 10 Jan. 2023].

michaelmckeyMore (n.d.). Arduino Nano Voice Recorder With the MAX9814 Microphone. [online] Instructables. Available at: https://www.instructables.com/Arduino-Nano-Voice-Recorder-With-the-MAX9814-Micro/ [Accessed 9 Jan. 2023].

Middlecamp, D. (2015). Wi-Fi Walkie Talkies! [online] Particle Projects. Available at: https://particle.hackster.io/middleca/wi-fi-walkie-talkies-0a38f4 [Accessed 8 Jan. 2023].

www.arduino.cc. (n.d.). ArduinoSound - SDWaveFile - Arduino Reference. [online] Available at: https://www.arduino.cc/reference/en/libraries/arduinosound/sdwavefile/ [Accessed 10 Jan. 2023].


Comments

Popular posts from this blog

Final Submission - Week 18

Hand Up Do good Project Proposal - Week 7

Design Planning -Week 5