Interested in ESP32 Audio: th-cam.com/play/PL5vDt5AALlRfGVUv2x7riDMIOX34udtKD.html Looking for all my ESP32 projects: th-cam.com/play/PL5vDt5AALlRdN2KyL30l8j7kLCxhDUrNw.html
I appreciate your ESP32 project demonstrations and explanations here on YT. 20 years ago this type of prototype development required $$$ and a team. Today is available to anyone willing to spend the time.
Awesome project! I took the hardware modified it a bit to build a public address system. This is only possible because of this project. Thank you for sharing your projects! Make some more. You're awesome!
Love this idea! Really cool! A common thing on Wifi is seeing packets repeated. Using RTP header on top of UDP could be a way of detecting out-of-order/missing/repeated packets.
That’s a great idea. I did play with the idea of adding a simple packet number to detect repeated/out of order packets. You could get quite fancy and reorder packets as they arrive - assuming you have a large enough receive buffer.
Started thinking about building one of these myself and had some more ideas: - simplest audio speech codec would be A-law (G.711) which gives 2:1 compression - use multicast to avoid spamming all devices on the network (although multicast can be a bit funny on Wifi) - you could have a channel selector (7-segment display?) that mapped to different multicast addresses - a door-bell type device that broadcasts a pre-recorded sound when a button is pressed - have a channel connected to a bridge to Alexa, so you can ask questions! - love the idea of a desktop Power over Ethernet powered base station (with gooseneck mic!) - implement Push to Talk SIP - might end up compatible with other types of devices - might even work in a web browser with WebRTC?
@@njh Sounds very interesting - definitely, some kind of audio companding/compression would be good to fit the audio into 8 bits more effectively. And some simple compression to reduce bandwidth would be really nice. Multicast should be done - I had some issues with it working on my desktop Mac - it seemed to work between the ESP32s, but my computer refused to see any packets. As you say, there are some funny things around WiFi and multicast that may mean it's not feasible. Love the idea of a channel selector. I think it would look really cool! Getting it to work with WebRTC would be very interesting.
@@atomic14 Are you doing setsockopt(... IP_ADD_MEMBERSHIP ...) to send an IGMP packet and tell the kernel to receive multicast packets? Some Switches/Routers/APs look for IGMP packets in order to filter out unwanted multicast.
@@njh I tried several different examples, one in python and one in C and couldn't get them to work. The code looked pretty much the same as the Arduino code which did work. It also looked like the Mac thought it was a member of the group. So it feels like it's something to do with the router not forwarding the packets on. It might be due to my mac having both an IPV6 and IPV4 address. But that doesn't seem to stop the broadcast packets. Needs a bit more investigation.
Have you considered using an audio Codec / compression to achieve higher quality / smaller packet sizes? I think SBC is what bluetooth uses. Not sure how easy it would be to implement.
I did look at an old GSM codec and got it running on the ESP32 - but it was a little bit slow - it took about 15ms to process 20ms of audio which only left about 5ms to do anything else. I'm taking a look at SBC now though as it's a lot more modern and I'm wondering if it might be a bit more lightweight. It would make a big difference - especially with the ESP-NOW transport where we have very small packets.
This is a very cool project. I was thinking about building a simple intercom in the house and this just fits perfectly. Broadcast just makes it easy, I don't have to worry about much at all. I remember seeing lot of ESP32 development board for mic and speaker output, those could be readily available hardware for this project.
Fantastic. This could be awesome for me with a directional antenna. This brings an idea to mind, two esp's transmitting their GPS location so that each of the esp's points to the other esp.
Love that you implemented ESP-NOW! I’m very impatient for it to become more accessible and easier to use, added to ESP-Home too 🙏🏼. Ideas: - voice detection to automatically open the mic maybe using an audio level sensor - home intercom system would be cool using a 110/220->3.3V step down at/in a light switch and/or front door communication - my mind is wandering into how could this be used with an Alexa?? - I mean… a toy or for real: an audio spying device - pest detection using a high sensitivity - okay, I’m probably going this far because of the ESP-NOW ability… great project!
A slave (ESP-NOW terminology) device that serves as a hub for ESP devices all over the house would be amazing. A lot less power needed for that comm method, zero need for a router/WiFi AP, potentially more secure, longer distances than RF.
@@JasonWho I had a few issues getting WiFi working at the same time as ESP-NOW - but I know it's definitely possible as other people have done it. Might be down to using the wrong channel as I know the channel has to match the WiFi channel for them to both work at the same time. ESP-MESH is another thing to look at - but I've been struggling to understand the documentation! I need to look more into the noise issues as well - the ESP32 doesn't seem to play very nicely with audio. There's a lot of noise going on!
Thanks - yes, I think there's a lot of interesting DSP that could be applied to the audio signal. Need to do some more investigation of what's possible.
@@atomic14 It's highly dependent on antenna types. I never tested it on field, but in buildings (pcb antenna on R / external antenna on S) it's about the same as your normal wifi signal.
I remember the ESP 8266 first releasing and being heralded as a 'wireless serial cable' essentially, so I picked up a pair to try and make a wireless audio cable. The built-in ADCs were so absolutely garbage that a quick 30 dollar project soon breached triple-digit prices and I realized why there wasn't anything on the market for lossless, latency-free short-range audio transmission that didn't already cost hundreds of dollars... with the ESP 32 series being significantly improved, I can't wait to see another generation or two from now and the possibilities with those :)
Extremely ambitious, although 3W audio amplification is a bit extreme. Very good video, well documented and you have every reason to be proud. As I'm being trolled, I apologise for disabling notifications
Great series glad you got it all working ok, I really enjoyed seeing how you overcame the Wifi noise issues etc. Many thanks for posting all the design files and code. Have you tried using more than 2 Walkie-Talkies at the same time as yet ?
Not yet - but in theory it should work without any problems as both the transports are using broadcast so don’t really care how many other clients there are listening.
Hello sir. Can u make demo or explaination for echo cancellation, or maybe about self-interference cancellation? I wanna learn more about full duplex system on esp device.
That really turned out great! Are you sleeping the ESP32 at all when on but not in use? I wonder how long ESP Now takes to wake, calibrate radios and begin transmission. Obviously if it's sleeping it cant received, but I know my kids would 100% forget to switch to off ;)
For sleep to be effective you'd probably want to turn off the speaker/amp as well, but it seems to be supplied via VBAT also on the PCB, rather than via the TinyPico ? ( A TinyPico S2 with 2nd LDO might help turning off the rest of the components during deep sleep :-) PS I hope you also include 2nd LDO + 16MB flash when you get to make TinyPico S3 - pretty please ;-)
@@sharpbends Ha! No 2nd LDO or 16MB of flash ever on a TnyPICO "footprint" board, sorry, no room. I'll have a ProS3 though that should make you happy :)
Thanks! At the moment it’s really not very power efficient. Both the microphone and the speaker are running continuously and I’m just not sending any packets unless the button is pushed. That is mostly just laziness on my part - I was having some issues with stopping and starting the I2S drivers and realised that debugging it was a bit of a rabbit hole. With ESP-Now startup should be pretty quick as there’s no need to connect to WIFi and get an IP-Address. With WIFi I’ve seen a few people speed this up by using static IP addresses. You could also spin up the audio sampling and buffer the data while everything else is waking up - definitely doable when you have PSRAM.
I have done it and it works great even without noise: the down sides 1. it deliver voice a little late. 2. it works only for few seconds and than no voice transmitted again, maybe i need to use powerfull power supply since i'm using the Tel charger only.
I'm not sure I think you'd definitely need to compress the audio very heavily to fit it in the available bandwidth. I'd need to do some research on what is possible.
I love this project! I'd like to build a set with my son. What will we need other than the TinyPico, Microphone, Amp, and speakers? We're fairly new to this sort of thing (don't even have a soldering iron yet).
I was wondering where did you get the double width breadboard in your video at 2 mins 10 secs? I bought two breadboards, put them together and it was too wide for my ESP32. Great inspirational video. Thanks.
I was planning to do this myself. But you've literally done it exactly the same way as I planned. No point reinventing the wheel. So I'll take a good look through your code. What distance have you managed while using ESP-NOW outdoors without obstructions?
Thank you for sharing! I was trying to find a way to connect my PC and Radio for some wireless FT8 and this seems like a great start. Look forward to checking out your other videos.
When attempting to run the code on the ESP32 board, the audio message seems to be broadcasting the data using UDP (confirmed using Wireshark) however, the audio is playing out of the board that sent the broadcast...ie using the mic from board 1, the audio captured is played out of the speaker from board 1, whereas we want the audio captured from the mic from board to be played out of the speaker on board 2...do you have any suggestions to fix this issue?
That's a really good question - I've not tested it yet. I've seen all sorts of claims 220m - 480m! Not sure if I believe the 480m. I know that you can bump up the transmit power to get better range so could be interesting. I think a lot will depend on how open the space is and how well oriented you have the antennas with each other.
Yes, you can get away with 8KHz - that will give you low-quality speech. You can go all the way down to 4KHz sampling rate and still be understandable - but it won't sound very nice.
I think old phone tech was with 8k sampling at 8 bits, but I might be wrong. Whatever sampling rate you use, the max frequency you'll be able to digitize will be half of the sample rate. See: en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem
Try using a vocoder. The melpe 1200 will compress/decompress 8khz 16bit samples into a 1200bps stream. Each 540 samples of audio generate 11 bytes of data. You can find melpe 1200 source on git. I am testing compression with I2S audio and SD card at the moment, struggeling with audio levels. What C ide/compiler do you use on the PC? The melpe 2400 codec would fit way better, 180 samples into 8 bytes, but i cant find the source. Note the older melp2400 from 1996 is not arduino compilable, but the melpe1200 from 2001 is.
Definitely - you could add a small header to the packets to indicate the "channel number". Or with the UDP version you could use different ports for each channel.
This is really cool. I'm most interested in how you cleaned the power line. What LC filter did you use? I've gone through many videos to try to find this info but I can't seem to figure it out other than that you used one and some caps and the low dropout regulator ( I found that).
oh I understand now. the LC filter comprises of several components. the part I didn't know what it was and thought was called an LC filter, is actually an inductor.
If you're feeling adventurous then you can build one and use your desktop/laptop as the client (if you go the UDP route). Or even knock up a mobile app if you're feeling really adventurous!
@@atomic14 I think there is something wrong with the gerber files pcbway has for your walkie talkie boards (linked in this video description). I just received my order and they sent me 100 of your ICS43434v0.1 boards, not the walkie talkie boards…. It’s strange because when I look at the order the gerber files and the thumbnails on the pcbway site are for the walkie talkie boards.
Would it make sense to break out some sort of ANTENNA so that it reaches further, or that would make no difference? Overall I think this is the BEST ESP32 walkie-talkie I have seen on TH-cam. THANK YOU! Great video, great project!
Cool project thanks for sharing! Is there a reason why you have used 2 separate I2S channels for the MIC and the speaker? it makes more wires uses more pins
I must admit that I had not actually considered sharing the same I2S peripheral for both input and output at the same time, but this could make a lot of sense. The code I used for the audio output was my sample code for outputting WAV files which supports stereo so my mental model was that it wouldn't work. But of course in this case it is just mono on both the input and output so that should be fine. I think I need to do some investigating - I've not tried doing both input and output on the same I2S channel before. Do you know if there are any limitations in doing it - can you use different formats on the input and output side or do they need to match? I'm thinking about how PDM microphones would work with a PCM speaker. I guess if you are only either playing or recording this doesn’t really matter. Very interesting! BTW - your Bluetooth speaker looks great!
You published a lot about ESP32 and I2S, just wondering, did you ever find a way to set the attenuation for the adc ( internal) when using i2S. Can't find that function at all..well at least not when using I2s
This is a great project. I think I have enough hardware lying around for 1 1/2 walkie talkies! It would be great to use this hardware to build a mumble client so that can interoperate with Talkie Pi or any other mumble client. Looks like mumble uses the opus codec for low latency low bitrate VOIP so maybe that's a good option here too.
@@atomic14 yup and speex is probably best codec to that use. It is just absurd how well it compress speech. There is some comparasion www.speex.org/comparison/ I used it at one project where we had store millions phone call records. We got about 10 better compression than mp3 with same audio quality. with 4kbps you will probably get what that speaker can support. At least 6kbps is more than enough.
@@TH-wr1dv Nice! This will be a great update to the project - I'll do a video about integrating it in (assuming I can get it to work! I may be in touch if I get stuck...)
@@atomic14 Great. This project interest to me because I did want do esp32 walkie talkie at some point but as usual I did not had enough time (inspiration) to move from idea to execution. So this project at least fill my "is it possible" desire :D btw why you end up to use i2c mic and speaker instead of internal ADC and DAC? One thing what I think was also that is it possible to save battery by putting radio to 100-200ms sleep and then keep it wake assumed frame lenght time and then put it back to sleep if no frames received. So if there is no trasmission then it sleep most of time and only do fast wake up to listen is there someone transmitting. And only if someone will transmit it will keep listening continously. That can cause some small delay to open receive channel but most probably its not meaningfull. At least if at sender side there is 100ms buffer and it will flood small "heads up" packest beginging of transmission while filling transmit buffer. Then no words will go lost and receiver is guaranteed to be wake when real transmission start. Most probably that will prevent use of udp because I dont know will ap assoc stand over sleep. But at least esp-now probably works with that kind solution.
@@TH-wr1dv I prefer I2S mics to the built-in ADC as the built-in ADC is pretty noisy and I've found analogue microphones to be very susceptible to power supply noise. I've normally found I2S microphones to be much better at rejecting power supply noise but this time there was still noise coming through. The ESP32 ADC is not that great so I've tended to stick to I2S microphones. I quite like the fact that the audio is converted to digital very early on with the I2S mics as I'm not an analogue engineer. On the output side of things the DAC is ok, it's a bit noisy and not very linear, but does the job, and probably for this use case would be pretty reasonable. When I was testing I was actually using the DAC to drive headphones directly to avoid feedback problems. You would still need an amplifier break-out board to drive a speaker and once you need an extra board you might as well use one that takes I2S as an input - once again staying digital for as long as possible.
You're doing great sir! Your videos have very rear information. Could you make a video on how to implement this project with mobile and Walkie-Talkie. I mean that communication between mobile and one Walkie-Talkie over Wi-Fi through a webpage.
EEVBlog has a great video on this - I have used one previously with microphone input, but I didn't see much improvement over an LDO. But my office is not that quiet anyway so there's a lot of background noise. th-cam.com/video/wopmEyZKnYo/w-d-xo.html
Hi, have you tried it in very long distance? I have two ESP 8266 and using ESP now. I put the master statically inside my house then I tried walking outside carrying the slave esp8266 + laptop while looking at my serial monitor . When I reached 50meters it becomes unstable. Do you have any suggestion on how to add to the signal strength? An antenna? Please advise. Thanks.
I've not investigated it yet, but I'm planning on doing so soon. It looks like you can increase the transmit power which might help - github.com/espressif/esp-idf/issues/1414 I suspect that having the master inside the house will limit the range dramatically. All the experiments I have seen have been conducted outside with a direct line of sight.
@@atomic14 It kind of seems like this project is a little bit different. For this one you're turning the ESP32 into the Audio Gateway. You're not trying to pretend to be any device; best case you're just shuffling packets between the ESP32 sources and sinks. The devices themselves handle compression for you, hopefully.
Hi. Great project! Is there a way to build a bluetooth monophone with ESP32? A monophone to connect to like a cell phone using Zello, group talk, kodiak etc, a button for transmitting and a mic and speaker? maby a function button as well?
hello i really want to be able to make this projector but never pregame an esp32. Could you give me more information on how to put the code you uploaded?
t is possible to turn an ESP32 C6 into a WIFI DAC Adio - as a reference to play music from TH-cam and with the help of C6 to connect it to an amplifier.
AFAIK LoRa can barely send text messages, let alone digital audio. Not only for the super low bandwidth, but mostly for the 1% duty cycle. You may say "Hello" then wait 15 mins for another message...
Great project. I remember it was one of my friend's final project at university! Anyway, I wanted to ask if you can make this project using" NRF24L01+PA+LNA" and an arduino. I'm sure you can get better results with that and also get rid of the disadvantages that you mentioned.
I was looking to build something similar but I want the audio to be received by the browser of a phone, I was wondering if this is something that you have working?
@atomic14 , based on the BOM, I've managed to find most of the components on digikey, but I'm unable to identify the 2 smaller capacitors in C4 & C3. What values would you suggest there?
second question, the 3d printed project has speaker holes at ~32 mm distance apart, but the speakers in your reference have holes that are ~42 mm apart. Is there some other brand of speaker that will actually work with this project?
Hello! An excellent project, I thought about a similar project, but in a slightly different design. There is an open source program for communicating with a large number of correspondents called Mumble. It would be interesting to create a client to work with ESP. If ba then it would be possible to make a walkie-talkie, the server for which would be the Mumble server (you can use both provided by someone and your own running on your PC).
I'm trying to follow along with the calculations. You have 1436 bits per packet / 16kHz sample rate @ 8bit. By my calculation that makes for 11ms packets. This would require 90 packets per second. Did I miss something or do something wrong? I'm looking at doing something with higher fidelity, 92kHz @ 20bit res and while the bit rate at 2mbps should be possible over the UDP, I read it max at about 30mbps, but I also wanted to use ESP-NOW, which as you demonstrate is a much smaller packet size and therefore may not keep up.
UDP packets (in this case) are 1436 bytes per packet not bits. Easy to mix those up. In networking specs you'll find both bits and bytes quoted. Lowercase mbps is always megabits per second. Megabytes per second are usually written uppercase like MB/s.
Wouldn't it be possible to trigger the send when a sound is picked by the microphone? That way you could remove the button and make it easier to use? Ever since me and my girlfriend used Bluetooth intercom while skiing about 7-8 years ago I have wanted something that works the same but has better "pairing" and can transmit to more devices at the same time, and this looks like a solution. I know the mesh Sena devices, but they are far too expensive. These parts could be bought and placed on the kids helmets too. What kind of battery time do you get from this?
I so love this! Any way or suggestions on how to work over the internet? My buddy and I used to live in the same apartment complex and used over the air walkie talkies but now that we live in 2 different cities, it would be cool to bring that back!
Probably the easiest way to do that would be to run a server somewhere to act as a router for the audio data. There are ways of setting up point to point communication over the internet - www.twilio.com/docs/stun-turn/faq But it's a bit too complicated for me :)
I want to know that why did you went for an i2s based microphone and why did you not use the analogue inputs directly which will actually be much easier. Was there any specific reason?
Hi Aman, very good questions. I've found the I2S microphones to be slightly better when it comes to noise than the analogue microphones. The analogue microphones tend to have very sensitive pre-amps which seem to be quite prone to power supply noise - and that tends to happen quite a lot with the ESP32 when using WiFi. You're also reliant on the built-in ADCs of the ESP32 when using analogue microphones and these are also very noisy. The code is pretty flexible so you can use either an I2S mic or analogue mic. I've got quite a good supply of I2S microphones so I tend to end up using them by default and they are pretty easy to wire up - it's only 3 wires for the I2S interface.
@@atomic14 thank you so much for replying buddy. I hope that you keep on supporting makers like us by in lightning with your knowledge. Very soon I am planning to build ultra cheap high quality walkie torquay using in esp8266 which again works on the same ESP now protocol but instead of a expensive i2s mic , I will use a separate audio ADC and analogue mic with good quality. In that project i might need your help . So looking for your support . Thanks
@@atomic14 also I would like to know that if I want to send an audio over ESP now what should be my sample rate what should be my bitrate aur basically what should be my audio specifications which ESP now packet can carry at one single instant and is it blazingly fast or is it very very slow and not really suitable for audio what is the audio scenario with ESP now protocol
@@TechInventorAman Apparently the data rate is 1Mbps which is 125KBytes/s - apparently, it is possible to change this. hackaday.io/project/161896-linux-espnow/log/161046-implementation The main limitation from my point of view is the packet size of 250 bytes. This means that you need to be sending data packets quite often - this may or may not be a problem for your use case.
ESP-NOW can definitely be encrypted out of the box. For the UDP option, you could encrypt each packet. I found some example code here: gist.github.com/cnlohr/96128ef4126bcc878b1b5a7586c624ef
Is there a way to do this through Bluetooth? I am trying to learn how to set up a Bluetooth intercom system that I could connect and talk to friends similar to this. I know they make motorcycle intercom systems but I want to add some additional functionality to it.
Hi, I would like to use I2C MIC to capture the sound and forward it to the I2S DAC MAX98357A, I can not find any example how to do that. Can you help? Thx.
Hola buenas quisiera preguntar si se puede configurar a los que puertos udp tengo que enviar según que botón presione por ejemplo sw 1 al esp1 y sw2 al esp2 y en que parte estaría esa configuración
Good day @atomic14. The UDP broadcast is not working when i compile the code on my VS code. Even after commenting on that line of the code, it is still not working. It is as though it is been overwhelmed by the ESP-NOW protocol. Please i need your help.
For the power supply smoothing, I used a 10uF and a 10mH inductor. I didn't apply any science to the selection of these values, they are just the largest that I have available to hand.
Hi Chris, I’m uploaded your code to ESP32 DEV module code is working without error when I push button it show message but there was no sound. I hope to receive a response from you. Thank you
Interested in ESP32 Audio: th-cam.com/play/PL5vDt5AALlRfGVUv2x7riDMIOX34udtKD.html
Looking for all my ESP32 projects: th-cam.com/play/PL5vDt5AALlRdN2KyL30l8j7kLCxhDUrNw.html
update this project to ESP32-LyraT-Mini hardware , its using esp32S3 chipset , esp32wroom B module.
Could you please convert your code for Arduino IDE
I appreciate your ESP32 project demonstrations and explanations here on YT. 20 years ago this type of prototype development required $$$ and a team. Today is available to anyone willing to spend the time.
Thank you for the amazing work. I used this on ESP32-C3, had to change the GPIO pins and it worked like a charm.
would you share what you changed for the class? i have a few of these that i could use for this project!
Awesome project!
I took the hardware modified it a bit to build a public address system. This is only possible because of this project.
Thank you for sharing your projects! Make some more. You're awesome!
Cool, ok, now we need a repeater pair of them running full duplex for the local hilltop...
Who doesent like a cool little walkie-talkie project. Good work.
Love this idea! Really cool!
A common thing on Wifi is seeing packets repeated.
Using RTP header on top of UDP could be a way of detecting out-of-order/missing/repeated packets.
That’s a great idea. I did play with the idea of adding a simple packet number to detect repeated/out of order packets. You could get quite fancy and reorder packets as they arrive - assuming you have a large enough receive buffer.
Started thinking about building one of these myself and had some more ideas:
- simplest audio speech codec would be A-law (G.711) which gives 2:1 compression
- use multicast to avoid spamming all devices on the network (although multicast can be a bit funny on Wifi)
- you could have a channel selector (7-segment display?) that mapped to different multicast addresses
- a door-bell type device that broadcasts a pre-recorded sound when a button is pressed
- have a channel connected to a bridge to Alexa, so you can ask questions!
- love the idea of a desktop Power over Ethernet powered base station (with gooseneck mic!)
- implement Push to Talk SIP - might end up compatible with other types of devices
- might even work in a web browser with WebRTC?
@@njh Sounds very interesting - definitely, some kind of audio companding/compression would be good to fit the audio into 8 bits more effectively. And some simple compression to reduce bandwidth would be really nice.
Multicast should be done - I had some issues with it working on my desktop Mac - it seemed to work between the ESP32s, but my computer refused to see any packets. As you say, there are some funny things around WiFi and multicast that may mean it's not feasible.
Love the idea of a channel selector. I think it would look really cool!
Getting it to work with WebRTC would be very interesting.
@@atomic14 Are you doing setsockopt(... IP_ADD_MEMBERSHIP ...) to send an IGMP packet and tell the kernel to receive multicast packets? Some Switches/Routers/APs look for IGMP packets in order to filter out unwanted multicast.
@@njh I tried several different examples, one in python and one in C and couldn't get them to work. The code looked pretty much the same as the Arduino code which did work. It also looked like the Mac thought it was a member of the group. So it feels like it's something to do with the router not forwarding the packets on. It might be due to my mac having both an IPV6 and IPV4 address. But that doesn't seem to stop the broadcast packets. Needs a bit more investigation.
Have you considered using an audio Codec / compression to achieve higher quality / smaller packet sizes? I think SBC is what bluetooth uses. Not sure how easy it would be to implement.
I did look at an old GSM codec and got it running on the ESP32 - but it was a little bit slow - it took about 15ms to process 20ms of audio which only left about 5ms to do anything else. I'm taking a look at SBC now though as it's a lot more modern and I'm wondering if it might be a bit more lightweight. It would make a big difference - especially with the ESP-NOW transport where we have very small packets.
Impressive for a audio data packet - the sound quality is really good
This is a very cool project. I was thinking about building a simple intercom in the house and this just fits perfectly. Broadcast just makes it easy, I don't have to worry about much at all. I remember seeing lot of ESP32 development board for mic and speaker output, those could be readily available hardware for this project.
Yeah, there's a quite a few very nice boards. There's also quite a few with codec chips which would make compression possible.
Fantastic. This could be awesome for me with a directional antenna. This brings an idea to mind, two esp's transmitting their GPS location so that each of the esp's points to the other esp.
That's an interesting idea - self aligning antenna.
I really like this one, could also work as a short range child location beacon
Always makes me think of the movement trackers from Aliens :)
Love that you implemented ESP-NOW! I’m very impatient for it to become more accessible and easier to use, added to ESP-Home too 🙏🏼. Ideas:
- voice detection to automatically open the mic maybe using an audio level sensor
- home intercom system would be cool using a 110/220->3.3V step down at/in a light switch and/or front door communication
- my mind is wandering into how could this be used with an Alexa??
- I mean… a toy or for real: an audio spying device
- pest detection using a high sensitivity
- okay, I’m probably going this far because of the ESP-NOW ability… great project!
A slave (ESP-NOW terminology) device that serves as a hub for ESP devices all over the house would be amazing. A lot less power needed for that comm method, zero need for a router/WiFi AP, potentially more secure, longer distances than RF.
@@JasonWho I had a few issues getting WiFi working at the same time as ESP-NOW - but I know it's definitely possible as other people have done it. Might be down to using the wrong channel as I know the channel has to match the WiFi channel for them to both work at the same time. ESP-MESH is another thing to look at - but I've been struggling to understand the documentation! I need to look more into the noise issues as well - the ESP32 doesn't seem to play very nicely with audio. There's a lot of noise going on!
awesome work - and a special thanx 2 u 4 sharing everything!
Thanks! It was a fun project - I was very pleased that it actually worked :)
This is super cool! Did I see Manim doing the latency calculations? Great work!
You did indeed :) Still learning how to use it so that animation was pretty much straight from the examples. But it’s really powerful.
Very intuitive explications. Hm , i think you can apply a discrete FFT for audio high gain for the audio? Thanks for sharing.
Thanks - yes, I think there's a lot of interesting DSP that could be applied to the audio signal. Need to do some more investigation of what's possible.
Great project! Very cool that you utilized ESP-NOW!
Thanks - I do need to do a proper range test to see how far you can actually get it to go - I've seen all sorts of claims and want to test them.
@@atomic14 It's highly dependent on antenna types. I never tested it on field, but in buildings (pcb antenna on R / external antenna on S) it's about the same as your normal wifi signal.
I remember the ESP 8266 first releasing and being heralded as a 'wireless serial cable' essentially, so I picked up a pair to try and make a wireless audio cable. The built-in ADCs were so absolutely garbage that a quick 30 dollar project soon breached triple-digit prices and I realized why there wasn't anything on the market for lossless, latency-free short-range audio transmission that didn't already cost hundreds of dollars... with the ESP 32 series being significantly improved, I can't wait to see another generation or two from now and the possibilities with those :)
Great project! Do you think would be possible to add a camera in a way to build a wireless Video Doorbell?
Yes, it's on my list of things to do :)
Excellent !
What is the range when esp-now is used ?
Extremely ambitious, although 3W audio amplification is a bit extreme. Very good video, well documented and you have every reason to be proud.
As I'm being trolled, I apologise for disabling notifications
Great series glad you got it all working ok, I really enjoyed seeing how you overcame the Wifi noise issues etc. Many thanks for posting all the design files and code. Have you tried using more than 2 Walkie-Talkies at the same time as yet ?
Not yet - but in theory it should work without any problems as both the transports are using broadcast so don’t really care how many other clients there are listening.
Hello sir. Can u make demo or explaination for echo cancellation, or maybe about self-interference cancellation? I wanna learn more about full duplex system on esp device.
Love the explanations, great work! Enjoyed the video.
Thanks! It was good fun making it.
Fantastic project !...cheers.
Thanks!
That really turned out great! Are you sleeping the ESP32 at all when on but not in use? I wonder how long ESP Now takes to wake, calibrate radios and begin transmission. Obviously if it's sleeping it cant received, but I know my kids would 100% forget to switch to off ;)
For sleep to be effective you'd probably want to turn off the speaker/amp as well, but it seems to be supplied via VBAT also on the PCB, rather than via the TinyPico ? ( A TinyPico S2 with 2nd LDO might help turning off the rest of the components during deep sleep :-) PS I hope you also include 2nd LDO + 16MB flash when you get to make TinyPico S3 - pretty please ;-)
@@sharpbends Ha! No 2nd LDO or 16MB of flash ever on a TnyPICO "footprint" board, sorry, no room. I'll have a ProS3 though that should make you happy :)
@@UnexpectedMaker Excellent, can't wait !
Thanks! At the moment it’s really not very power efficient. Both the microphone and the speaker are running continuously and I’m just not sending any packets unless the button is pushed. That is mostly just laziness on my part - I was having some issues with stopping and starting the I2S drivers and realised that debugging it was a bit of a rabbit hole. With ESP-Now startup should be pretty quick as there’s no need to connect to WIFi and get an IP-Address. With WIFi I’ve seen a few people speed this up by using static IP addresses. You could also spin up the audio sampling and buffer the data while everything else is waking up - definitely doable when you have PSRAM.
I have done it and it works great even without noise: the down sides 1. it deliver voice a little late. 2. it works only for few seconds and than no voice transmitted again, maybe i need to use powerfull power supply since i'm using the Tel charger only.
Great job, thanks for sharing. Would LoRa point to point be an option as transport? Range would be good
I'm not sure I think you'd definitely need to compress the audio very heavily to fit it in the available bandwidth. I'd need to do some research on what is possible.
great project
Awesome project! Going to try soon.
Let me know how you get on - if you get any issues add an issue on GitHub and we can work through it.
@@atomic14 will sure do that.
I love this project! I'd like to build a set with my son. What will we need other than the TinyPico, Microphone, Amp, and speakers? We're fairly new to this sort of thing (don't even have a soldering iron yet).
I was wondering where did you get the double width breadboard in your video at 2 mins 10 secs? I bought two breadboards, put them together and it was too wide for my ESP32. Great inspirational video. Thanks.
Some breadboards let you remove the power strips, they just pop off and then you can join the breadboards together.
I was planning to do this myself. But you've literally done it exactly the same way as I planned.
No point reinventing the wheel. So I'll take a good look through your code.
What distance have you managed while using ESP-NOW outdoors without obstructions?
That's the next project - I'm going to do a good range test of ESP-NOW
@@atomic14 great. I'll wait for that. Thank you!
Thank you for sharing! I was trying to find a way to connect my PC and Radio for some wireless FT8 and this seems like a great start. Look forward to checking out your other videos.
Waiting for v2 ;)
In your test what worked the best in terms of range , and quality of audio data . UDP or ESP-NOW
Amazing Project!! I was thinking how make a project with espnow...
Great. I'm waiting on some ESPs for some wireless speakers. This should help
Great info! :) More please. Thanks.
Thanks! I've got some more in the pipeline :)
When attempting to run the code on the ESP32 board, the audio message seems to be broadcasting the data using UDP (confirmed using Wireshark) however, the audio is playing out of the board that sent the broadcast...ie using the mic from board 1, the audio captured is played out of the speaker from board 1, whereas we want the audio captured from the mic from board to be played out of the speaker on board 2...do you have any suggestions to fix this issue?
Nice Project! Whats the range of the walkie talkies, especially in esp-now mode?
That's a really good question - I've not tested it yet. I've seen all sorts of claims 220m - 480m! Not sure if I believe the 480m. I know that you can bump up the transmit power to get better range so could be interesting. I think a lot will depend on how open the space is and how well oriented you have the antennas with each other.
Nice project! What is the lowest sampling Hz where the voice is still intelligible? Does 8000 work, for instance?
Yes, you can get away with 8KHz - that will give you low-quality speech. You can go all the way down to 4KHz sampling rate and still be understandable - but it won't sound very nice.
I think old phone tech was with 8k sampling at 8 bits, but I might be wrong. Whatever sampling rate you use, the max frequency you'll be able to digitize will be half of the sample rate. See: en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem
Try using a vocoder. The melpe 1200 will compress/decompress 8khz 16bit samples into a 1200bps stream. Each 540 samples of audio generate 11 bytes of data. You can find melpe 1200 source on git.
I am testing compression with I2S audio and SD card at the moment, struggeling with audio levels. What C ide/compiler do you use on the PC?
The melpe 2400 codec would fit way better, 180 samples into 8 bytes, but i cant find the source.
Note the older melp2400 from 1996 is not arduino compilable, but the melpe1200 from 2001 is.
Great project and nice job!
Thanks! I had a lot of fun building it.
Is it possible to use ESP8266 instead? Nice Project!
Neat! Do you think it could be modified to support multiple 'channels'?
Definitely - you could add a small header to the packets to indicate the "channel number". Or with the UDP version you could use different ports for each channel.
This is really cool. I'm most interested in how you cleaned the power line. What LC filter did you use? I've gone through many videos to try to find this info but I can't seem to figure it out other than that you used one and some caps and the low dropout regulator ( I found that).
oh I understand now. the LC filter comprises of several components. the part I didn't know what it was and thought was called an LC filter, is actually an inductor.
Love this, well done with all the testing and research, now I want to make one/2 ? lol
If you're feeling adventurous then you can build one and use your desktop/laptop as the client (if you go the UDP route). Or even knock up a mobile app if you're feeling really adventurous!
I was about to order the PCB but wanted to confirm that the linked PCB is your new design with headers for additional GPIO.
LEt me get that added now!
@@atomic14 thank you!
@@tuckjam235 Should be updated now
@@atomic14 thanks again! Can’t wait for them to arrive!
@@atomic14 I think there is something wrong with the gerber files pcbway has for your walkie talkie boards (linked in this video description). I just received my order and they sent me 100 of your ICS43434v0.1 boards, not the walkie talkie boards…. It’s strange because when I look at the order the gerber files and the thumbnails on the pcbway site are for the walkie talkie boards.
Would it make sense to break out some sort of ANTENNA so that it reaches further, or that would make no difference? Overall I think this is the BEST ESP32 walkie-talkie I have seen on TH-cam. THANK YOU! Great video, great project!
Thanks! Yes, I think an external antenna would make a big difference.
Cool project thanks for sharing! Is there a reason why you have used 2 separate I2S channels for the MIC and the speaker? it makes more wires uses more pins
I must admit that I had not actually considered sharing the same I2S peripheral for both input and output at the same time, but this could make a lot of sense. The code I used for the audio output was my sample code for outputting WAV files which supports stereo so my mental model was that it wouldn't work. But of course in this case it is just mono on both the input and output so that should be fine. I think I need to do some investigating - I've not tried doing both input and output on the same I2S channel before. Do you know if there are any limitations in doing it - can you use different formats on the input and output side or do they need to match? I'm thinking about how PDM microphones would work with a PCM speaker. I guess if you are only either playing or recording this doesn’t really matter. Very interesting! BTW - your Bluetooth speaker looks great!
You published a lot about ESP32 and I2S, just wondering, did you ever find a way to set the attenuation for the adc ( internal) when using i2S. Can't find that function at all..well at least not when using I2s
Looks like it is possible - but involves some poking around with hardware registers - github.com/espressif/esp-idf/issues/5334#issuecomment-633057910
Great project! Thanks for sharing it.
My question is: what about Bluetooth Headphones? Is it posible to use these for audio-output?
Udo
i love it,, what if i use lora u think it will work?
To slow, but with very efficient voice compression it is possible.
Hi Chris,
l loved your projects on Arduino, on the walkie talkie project do we have any latency,
a) if we use the intranet will there be any latency
what kind of range are you getting with esp now ?
This is a great project. I think I have enough hardware lying around for 1 1/2 walkie talkies!
It would be great to use this hardware to build a mumble client so that can interoperate with Talkie Pi or any other mumble client. Looks like mumble uses the opus codec for low latency low bitrate VOIP so maybe that's a good option here too.
Someone did find a port of opus to esp32 - github.com/XasWorks/esp-libopus definitely worth having a look at.
about compression. I look that someone was already do speex codec for esp32. Maybe it is good starting point.
That looks very interesting! Should be pretty easy to integrate into the software.
@@atomic14 yup and speex is probably best codec to that use. It is just absurd how well it compress speech. There is some comparasion www.speex.org/comparison/ I used it at one project where we had store millions phone call records. We got about 10 better compression than mp3 with same audio quality. with 4kbps you will probably get what that speaker can support. At least 6kbps is more than enough.
@@TH-wr1dv Nice! This will be a great update to the project - I'll do a video about integrating it in (assuming I can get it to work! I may be in touch if I get stuck...)
@@atomic14 Great. This project interest to me because I did want do esp32 walkie talkie at some point but as usual I did not had enough time (inspiration) to move from idea to execution. So this project at least fill my "is it possible" desire :D btw why you end up to use i2c mic and speaker instead of internal ADC and DAC? One thing what I think was also that is it possible to save battery by putting radio to 100-200ms sleep and then keep it wake assumed frame lenght time and then put it back to sleep if no frames received. So if there is no trasmission then it sleep most of time and only do fast wake up to listen is there someone transmitting. And only if someone will transmit it will keep listening continously. That can cause some small delay to open receive channel but most probably its not meaningfull. At least if at sender side there is 100ms buffer and it will flood small "heads up" packest beginging of transmission while filling transmit buffer. Then no words will go lost and receiver is guaranteed to be wake when real transmission start. Most probably that will prevent use of udp because I dont know will ap assoc stand over sleep. But at least esp-now probably works with that kind solution.
@@TH-wr1dv I prefer I2S mics to the built-in ADC as the built-in ADC is pretty noisy and I've found analogue microphones to be very susceptible to power supply noise. I've normally found I2S microphones to be much better at rejecting power supply noise but this time there was still noise coming through. The ESP32 ADC is not that great so I've tended to stick to I2S microphones. I quite like the fact that the audio is converted to digital very early on with the I2S mics as I'm not an analogue engineer. On the output side of things the DAC is ok, it's a bit noisy and not very linear, but does the job, and probably for this use case would be pretty reasonable. When I was testing I was actually using the DAC to drive headphones directly to avoid feedback problems. You would still need an amplifier break-out board to drive a speaker and once you need an extra board you might as well use one that takes I2S as an input - once again staying digital for as long as possible.
I don't quite know which file should I upload to the ESP32. Is it the Application.cpp/h , config.cpp/h or main.cpp? Please help. Thanks!
You're doing great sir! Your videos have very rear information. Could you make a video on how to implement this project with mobile and Walkie-Talkie. I mean that communication between mobile and one Walkie-Talkie over Wi-Fi through a webpage.
You may get cleaner audio if you use a capacitive multiplier circuit instead of a LDO. LDO aren't that great for filtering out ripples
EEVBlog has a great video on this - I have used one previously with microphone input, but I didn't see much improvement over an LDO. But my office is not that quiet anyway so there's a lot of background noise. th-cam.com/video/wopmEyZKnYo/w-d-xo.html
is the code arduino ide friendly?
Hi, have you tried it in very long distance? I have two ESP 8266 and using ESP now. I put the master statically inside my house then I tried walking outside carrying the slave esp8266 + laptop while looking at my serial monitor . When I reached 50meters it becomes unstable. Do you have any suggestion on how to add to the signal strength? An antenna? Please advise. Thanks.
I've not investigated it yet, but I'm planning on doing so soon. It looks like you can increase the transmit power which might help - github.com/espressif/esp-idf/issues/1414 I suspect that having the master inside the house will limit the range dramatically. All the experiments I have seen have been conducted outside with a direct line of sight.
How much did this project cost?
Could you have also used bluetooth for the speaker/microphone? Kind of... would make the project simpler.
Bluetooth microphones are another can of worms :) th-cam.com/video/0jR-QNTfydA/w-d-xo.html
@@atomic14 It kind of seems like this project is a little bit different. For this one you're turning the ESP32 into the Audio Gateway. You're not trying to pretend to be any device; best case you're just shuffling packets between the ESP32 sources and sinks. The devices themselves handle compression for you, hopefully.
Hi. Great project! Is there a way to build a bluetooth monophone with ESP32? A monophone to connect to like a cell phone using Zello, group talk, kodiak etc, a button for transmitting and a mic and speaker? maby a function button as well?
Thanks for sharing ❤
hello i really want to be able to make this projector but never pregame an esp32. Could you give me more information on how to put the code you uploaded?
th-cam.com/video/xPlN_Tk3VLQ/w-d-xo.html
That is a great beginner's guide to how to program an ESP32. I'm a fan of the ESP32 Node MCU.
t is possible to turn an ESP32 C6 into a WIFI DAC Adio - as a reference to play music from TH-cam and with the help of C6 to connect it to an amplifier.
Do this with LORA. With a good codec you could probably get legible voice over 50 kbps
AFAIK LoRa can barely send text messages, let alone digital audio. Not only for the super low bandwidth, but mostly for the 1% duty cycle. You may say "Hello" then wait 15 mins for another message...
@@theagentsmithThere is a 50 kbps mode. Also the chirped mode goes up to 10 kbps.
Wouw Great! Would it also work with the esp8266 boards? What do you think?
How many units can be connected at once from ESP-NOW protocol
should be 20 afaik
wait - 20 is only a limit for the peer-adresses. if you broadcast there shouldn't be a limit.
All ESP-Boards have two DACs, why you don’t use this for Output the audio signal?
Great project. I remember it was one of my friend's final project at university!
Anyway, I wanted to ask if you can make this project using" NRF24L01+PA+LNA" and an arduino. I'm sure you can get better results with that and also get rid of the disadvantages that you mentioned.
I'm wondering if the walkie talkie can support multiple people talking at the same time?
Nice video.
how far can it go? i'm talking about max stable range. thank you
I'm wondering is the new esp32 is good enough to create a wireless microphone trough bt?
How hard would this be to get working over different wifi networks? Im assuming we could use WebRTC.
I was looking to build something similar but I want the audio to be received by the browser of a phone, I was wondering if this is something that you have working?
Hi, Does the transmit button needed ?? Can we do this communication bidirectional ??
Feedback. They'd be constantly picking up the audio being sent from the other radio and retransmitting it.
@atomic14 , based on the BOM, I've managed to find most of the components on digikey, but I'm unable to identify the 2 smaller capacitors in C4 & C3. What values would you suggest there?
second question, the 3d printed project has speaker holes at ~32 mm distance apart, but the speakers in your reference have holes that are ~42 mm apart. Is there some other brand of speaker that will actually work with this project?
lastly, would you still know the make of your spdt slide switch (on/off) and the momentary button? I couldn't make those out from the images. Thanks!
I think he shows 1uf in the schematic.
Hello! An excellent project, I thought about a similar project, but in a slightly different design. There is an open source program for communicating with a large number of correspondents called Mumble. It would be interesting to create a client to work with ESP. If ba then it would be possible to make a walkie-talkie, the server for which would be the Mumble server (you can use both provided by someone and your own running on your PC).
I'm trying to follow along with the calculations. You have 1436 bits per packet / 16kHz sample rate @ 8bit. By my calculation that makes for 11ms packets. This would require 90 packets per second. Did I miss something or do something wrong? I'm looking at doing something with higher fidelity, 92kHz @ 20bit res and while the bit rate at 2mbps should be possible over the UDP, I read it max at about 30mbps, but I also wanted to use ESP-NOW, which as you demonstrate is a much smaller packet size and therefore may not keep up.
UDP packets (in this case) are 1436 bytes per packet not bits. Easy to mix those up. In networking specs you'll find both bits and bytes quoted. Lowercase mbps is always megabits per second. Megabytes per second are usually written uppercase like MB/s.
Wouldn't it be possible to trigger the send when a sound is picked by the microphone?
That way you could remove the button and make it easier to use?
Ever since me and my girlfriend used Bluetooth intercom while skiing about 7-8 years ago I have wanted something that works the same but has better "pairing" and can transmit to more devices at the same time, and this looks like a solution.
I know the mesh Sena devices, but they are far too expensive.
These parts could be bought and placed on the kids helmets too.
What kind of battery time do you get from this?
I so love this! Any way or suggestions on how to work over the internet?
My buddy and I used to live in the same apartment complex and used over the air walkie talkies but now that we live in 2 different cities, it would be cool to bring that back!
Probably the easiest way to do that would be to run a server somewhere to act as a router for the audio data. There are ways of setting up point to point communication over the internet - www.twilio.com/docs/stun-turn/faq But it's a bit too complicated for me :)
@@atomic14 Thanks for the reply! I will check that out!
Sir please guide me can i use "ESP 32-30pin" module or "ESP 32 -WRROOM" -32 for this walkie talkie
I want to know that why did you went for an i2s based microphone and why did you not use the analogue inputs directly which will actually be much easier. Was there any specific reason?
Hi Aman, very good questions. I've found the I2S microphones to be slightly better when it comes to noise than the analogue microphones. The analogue microphones tend to have very sensitive pre-amps which seem to be quite prone to power supply noise - and that tends to happen quite a lot with the ESP32 when using WiFi. You're also reliant on the built-in ADCs of the ESP32 when using analogue microphones and these are also very noisy. The code is pretty flexible so you can use either an I2S mic or analogue mic. I've got quite a good supply of I2S microphones so I tend to end up using them by default and they are pretty easy to wire up - it's only 3 wires for the I2S interface.
@@atomic14 thank you so much for replying buddy. I hope that you keep on supporting makers like us by in lightning with your knowledge. Very soon I am planning to build ultra cheap high quality walkie torquay using in esp8266 which again works on the same ESP now protocol but instead of a expensive i2s mic , I will use a separate audio ADC and analogue mic with good quality. In that project i might need your help . So looking for your support . Thanks
@@atomic14 also I would like to know that if I want to send an audio over ESP now what should be my sample rate what should be my bitrate aur basically what should be my audio specifications which ESP now packet can carry at one single instant and is it blazingly fast or is it very very slow and not really suitable for audio what is the audio scenario with ESP now protocol
@@TechInventorAman Apparently the data rate is 1Mbps which is 125KBytes/s - apparently, it is possible to change this. hackaday.io/project/161896-linux-espnow/log/161046-implementation
The main limitation from my point of view is the packet size of 250 bytes. This means that you need to be sending data packets quite often - this may or may not be a problem for your use case.
And without a screen, how do you know in which broadcast you emit and/or receive?
Is it possible to encrypt with onboard encryption hardware?
ESP-NOW can definitely be encrypted out of the box. For the UDP option, you could encrypt each packet. I found some example code here: gist.github.com/cnlohr/96128ef4126bcc878b1b5a7586c624ef
Is there a way to do this through Bluetooth? I am trying to learn how to set up a Bluetooth intercom system that I could connect and talk to friends similar to this. I know they make motorcycle intercom systems but I want to add some additional functionality to it.
Have a search for esp32 A2DP. That might be what you are looking for.
Hi, I would like to use I2C MIC to capture the sound and forward it to the I2S DAC MAX98357A, I can not find any example how to do that. Can you help? Thx.
Hola buenas quisiera preguntar si se puede configurar a los que puertos udp tengo que enviar según que botón presione por ejemplo sw 1 al esp1 y sw2 al esp2 y en que parte estaría esa configuración
Good day @atomic14. The UDP broadcast is not working when i compile the code on my VS code. Even after commenting on that line of the code, it is still not working. It is as though it is been overwhelmed by the ESP-NOW protocol. Please i need your help.
What are the ratings of capacitor and inductor?
For the power supply smoothing, I used a 10uF and a 10mH inductor. I didn't apply any science to the selection of these values, they are just the largest that I have available to hand.
Thankyou so much for instant replies!
Hello ! If i use Nodemcu devkit v1 what should I change in the codes? Thanks!!!
Good job @atomic14. do you have Arduino IDE code for this project? Thanks.
Hi Chris, I’m uploaded your code to ESP32 DEV module code is working without error when I push button it show message but there was no sound. I hope to receive a response from you. Thank you
Do you have maybe a video where you stream I2S microphone to a server by TCP? Thanks.
go for ESP32-LyraT-Mini hardware
What maximum range did you get wh3n t3sting?
@atomic14 dear sir , the connection part to button is a little flu , can you please explain connections to talk button ? thanks