0

I only started learning Arduino recently. This is my first project.

So the idea for the project is that there will be an Arduino board(Ideally an Uno but I don't know if another board would be better) and when you hold a button down it will transmit what you are saying to a device on the wifi. I know I will have to get a WiFi module and like a microphone and button, so can you help me figure out just the gist of how the project will go and what parts I should get.

Thanks!

1
  • 1
    You should ditch the Uno here. The wifi module (which is likely an ESP) wil already be a way more powerful microcontroller than the Uno. So just move to a boatd with buildin wifi, like an ESP32 or similar. They also have an I2S interface, where you should be able to connect a good ADC to for audio sampling – chrisl Sep 9 '20 at 14:32
4

An Arduino can do this, but this is a very advanced problem on an Arduino. It sounds like perhaps you need something more plug-and-play. In that case, buy a Raspberry Pi 4 starter kit and a USB microphone, and start working on the problem from there. The Raspberry Pi 4 is a Linux computer, so everything you do will be writing scripts or programs (in any language: it's just a regular computer, so use Python, C, C++, Java, bash, whatever you want) to run on its Raspberry Pi OS (formerly called Raspbian) Linux operating system.

If you go this route, you'll want to ask your questions on the Raspberry Pi Stack Exchange as well.

Keep in mind the question you asked is too broad. You are generally expected to do your own background research and then ask more specific questions, demonstrating what you've already tried.

Getting an Arduino to send out microphone data is, like I said, a very advanced subject and project (think: professional level / expert hobby level) unless you can Google and find pre-made libraries and how-tos on the subject.

Essentially, for the Arduino Uno route you'd need to do some fancy high-rate ADC sampling with a modified ADC clock rate in a special ADC mode which takes repeated samples and then interrupts your code when a sample is ready, rather than just doing normal analogRead() since that is both blocking/polling-based which wastes clock cycles and creates sample jitter which causes audio distortion, and then you'd need to send this data via some Wifi shield (add-on board) or an ESP8266 or something, or via some other technology (wired or wireless) to a computer to pass it on to the internet. This may involve binary packetization/bit-packing, error checking, buffering, etc., all of which is its own special skill to acquire.

Some of my projects have taken me 3+ years to complete them, since I began complicated projects as a beginner. This is one of those multi-year type projects for a beginner for sure.

(Heck, if you give me two LEDs and two resistors and an Arduino Nano, with those items alone, I can send you on your way to work 8 hrs a day for 3 months straight on projects. It's easy to under-estimate the complexity of something until you're neck-deep in it.)

Update: if you want to go the Arduino route, here's some tips to get you on a search route more likely to get you to a solution faster. Again, no doubt an Arduino Uno can do this. It for sure can. But, a faster Arduino can do it easier and better. So:

  1. Google search for projects on Adafruit which may do this. Ex: Google search for "adafruit stream audio". Their tutorials are 2nd to none--the best in the world--and their products top-notch.
  2. Search for projects on Sparkfun which may do this. Ex: Google search for "sparkfun stream audio". They also are excellent and have world-class tutorials.
  3. Search for projects which do this with a Teensy, Zero, Due, or other high-speed 32-bit microcontroller, instead of an Uno. Audio processing is more difficult for a slower 8-bit Uno than for any of those 3 Arduino/Arduino-compatible devices.
  4. Also look on Instructables.com for tutorials and help.
  5. One more thought: Google search for "atmega328 stream audio to wifi" (an Uno uses the ATmega328 microcontroller, so that's a good search term to use)

Update: also take a look at this tutorial by GreatScott (who is also super awesome) (https://www.instructables.com/id/Make-Your-Own-Spy-Bug-Arduino-Voice-Recorder/), which uses this AVR-based (for ATmega328: Arduino Uno, Nano, Pro Mini, etc., or ATmega2560: Mega) advanced audio library for both recording and playing back audio. See:

  1. https://github.com/TMRh20/TMRpcm
    1. Recording Audio
    2. Audio streaming over NRF24L01+ radio link
4
  • Would it be easier if you just send an audio file. So if you click the button it'll just send an audio file. – Epicmania Sep 9 '20 at 14:57
  • Yes. That removes the entire complexity of sampling the audio with the ADC. – Gabriel Staples Sep 9 '20 at 15:20
  • You'll need to store the file on an SD card or in a non-volatile FRAM. – Gabriel Staples Sep 9 '20 at 15:20
  • 1
    So the idea is that if my mom is downstairs and I'm in my room playing games or something, she can click the button and it will say, "come downstairs" to me on my headphones or whatever audio I'm using. Is that possible – Epicmania Sep 9 '20 at 16:24
3

You can use a ESP32 with built-in WiFi and Bluetooth. Record a wave-File to a SD-card using this library, send it over Blutooth and play it on the PC with a little script.

5
  • 1
    That link you have to instructables.com/id/… relies on libraries built for the ATmega328 microcontroller (github.com/TMRh20/TMRpcm), and would likely require significant advanced modifications to run on an ESP32. But, you could always split the project and use 2 microcontrollers: one ATmega328 (Uno, Nano, or Pro Mini), and one ESP32. – Gabriel Staples Sep 10 '20 at 18:39
  • 1
    Sorry, didn't recognized. Here is a library for the ESP32. – Python Schlange Sep 10 '20 at 18:42
  • Nice! Please add that link to your answer too (while keeping in the Great Scott Instructables link too). Upvoted. – Gabriel Staples Sep 10 '20 at 18:49
  • I just can't figure out how to transfer the file. Some people say that the only solution is transfering it byte by byte, but that could be quiet hard and I didn't find any library for it. You could record some sample files (like in your example "come downstairs"), assign to numbers and send just the numbers the PC so he can find out which file to play. – Python Schlange Sep 11 '20 at 19:23
  • You can upload a wav to a webserver using the ESP32 and download it over Python. Or you upload a text file and read it over tts, which should be faster with a bad connection. – Python Schlange Sep 11 '20 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.