Forget WiFi! This Wireless Method is WAY Better?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Wireless communication is awesome! I mean with it you can for example   wirelessly control the speed of your electric  skateboard or you can control the position and   speed of your drone or you can open and close  your blinds from everywhere in the world.  Generally speaking, we use wireless communication  for tons of things nowadays and I also used   it dozens of times in previous projects. The most common method I used was probably   the WiFi connection using a router as  a gateway which you know works fine for   most things; but the response time and more  importantly the range is pretty limited.  That is why I sometimes tried out other wireless  techniques like generic RF modules, LoRa modules,   nRF24 modules and so on which all required extra  hardware and came with their own pros and cons.  Recently though, I realized that with the  ESP microcontrollers, which were the heart   of all my WiFi projects, you can also use the  ESP-NOW wireless communication protocol that is   supposedly easy to use, fast, comes with a great  range and let's you transfer quite a bit of data.  So in this video I want to put this (for me)  new method to the test, compare it to all my   previously utilized techniques and ultimately  push it to the limit by building a crude   walkie talkie with it. Let's get started!  This video is sponsored by Elektor whose bi  monthly magazine actually introduced me to ESP-NOW   and I will be using their Walkie Talkie prototype  as a reference for my own. I have been reading   Elektor for a long time now and tried out some  of their cool projects in the past. And if you   want to read their awesome electronics magazine  as well then you are in luck because by using   the coupon code “greatscott0550” you get a 50%  discount for their one year gold aka print or   green aka digital subscription. And if you are  not in the mood to read, then you can also browse   through their store to maybe find an awesome DIY  electronics kit; like the DIY LiPo supercharger   that we developed together and that is currently  on sale. Check out the links in the description.  Now first off, let me tell you that a  simple WiFi connection is not a bad thing.  With it you can send little or big data from one  device to another while even grabbing data from   the internet which generally speaking is awesome. But then again, your devices can not directly   talk to one another since we need  a gateway aka a router in between.  And I think everyone knows that the range of  most routers is not the greatest which therefore   limits the range of our wireless system. And last but not least, establishing a   WiFi connection and transferring data takes a  bit of time which all in all makes this method   not ideal for small projects consisting of for  example 2 boards that very quickly want to send   data to one another over a bigger distance. The perfect real life example here would be a   garage door opener or more generally any  kind of remote that controls something.  Now of course the ESP32 boards also come  with Bluetooth which solves the gateway   problem as well as the slow response time. But then again the range with a maximum of   15m is not ideal for many applications. At this point you could of course throw   extra hardware at this problem and like mentioned  before use other methods and or frequency bands.  But to keep it cheap and simple we could also  try ESP-NOW which needs no extra hardware   and uses the same frequency band as WiFi. But this time the devices can directly talk   to one another in both directions and you can even  let multiple devices communicate with one another.  All we need to address the correct one is its  MAC-address which is super simple to get our   hands on by simply uploading this code here,  opening the serial monitor and there we go.  So for my first test setup, I got an  LED with resistor on the receiver side   and a push button at the transmitter side. Next I had a look at the ESP-NOW example   codes included with the Arduino IDE which are  available once you install the ESP32 boards.  And I got to say that for me as a non  programmer, this was not really easy to grasp.  But thankfully I found a great tutorial  from random nerd tutorials and thus   quickly wrote myself a transmitter code  where we need to insert the MAC address   of the receiver as well as a receiver code. And after uploading all of it, you can see that   by pushing the button on the transmitter side, the  LED at the receiver side lit up and we got some   data over the serial monitor which means success. And best off, the time it takes to light up the   LED is super short and the range was also way  better than WiFi while doing tests in my house;   but before getting to a proper range  test, I firstly prepared a comparison   setup with some generic 433MHz RF modules. Now programming for these is as simple as   it can get and my range test idea is that  the receiver LED keeps blinking properly as   long as the transmitter is in range, but stays on  almost constantly when the connection gets lost.  I programmed pretty much the same example for  ESP-NOW with the only difference here that   the receiver LED stops blinking completely  as soon the transmitter gets out of range.  So time to place both transmitters  at a fixed position and start   walking away with the receivers. And after around 40m the generic   RF module connection started to struggle  while the ESP-NOW connection did manage to   constantly receive data up to 110m which I by  the way checked with recorded GPS coordinates.  So yeah at first sight ESP-NOW seems to  work pretty well, even though I think   programming for it is not super simple. But then again if I directly compare it   to all other wireless communication  methods I tried out over the years,   links to all videos are in the description, then  I got to say that it ranks pretty high up because   you simply need no extra hardware for it. So let's push it to the limit by creating   a one way walkie talkie and I think this  is pretty demanding because you obviously   need to constantly send over quite a  bit of data that contains your voice.  Now according to the information  given by the manufacturer, ESP-NOW   can do 1Mbps of data which should be plenty. But on the negative side one packet can only   be 250 bytes, if one packet is lost then  the ESP32 simply does not care about it   and the ADC and DAC of the ESP32, which  are required to turn our analogue voice   into a digital signal and vice versa, are not the  quickest and partly come with a low resolution. What I am trying to say is that the  audio quality might not be the best,   but we will see what is possible. So I firstly grabbed myself this   electret microphone amplifier circuit  that I built in a previous video.  By supplying 3.3V power to it and having  a look at its output with an oscilloscope,   you can see that the circuit successfully  amplifies my picked up voice by the microphone.  And since the max voltage never exceeds 3.3V,  it is suitable for the analogue to digital   converter of the ESP32 to which I connected the  power and audio line as well as a push button.  Now for the receiver side I grabbed myself  this premade PAM8302 amplifier board along   with a speaker whose power lines I also  directly connected to the ESP and the audio   input to the digital to analogue converter  which will reconstruct our analogue signal.  And that was basically all the hardware we need. With that complete, it was time for programming   and oh boy I was not sure how to pull this off. But thankfully like mentioned before,   Elektor already created a similar project  and thus I was able to adapt their code   quite closely for my own use. And after uploading both the   master and slave code, it seems like the  connection got established correctly and   the walkie talkie basically works, awesome. But you probably already noticed that there are   some interference noises and the reason for that  is the WiFi function of the ESP board and the fact   that we share the power lines with the microphone  circuit as well as the amplifier circuit.  To solve this problem we could integrate  an LC filter; but to keep it simple for   testing I powered all circuits with  their separate power supplies and as   you can hear that definitely helped. Now of course the audio quality is   not high definition, but I think you  can understand what I am saying here.  And I was even able to move 10m away from the  receiver without losing a significant amount of   audio quality, which I would say is not bad. So yeah, all in all I think the ESP-NOW   wireless protocol is pretty awesome and I  would have definitely used it in previous   projects if I knew about it earlier. But you know; better late than never.  And with that being said I hope you enjoyed  this video and maybe learned something new.  If so consider supporting this show  on Patreon and check out the Elektor   offers in the description. Don't forget to like, share,   subscribe and hit the notification bell. Stay creative and I will see you next time.
Info
Channel: GreatScott!
Views: 493,969
Rating: undefined out of 5
Keywords: esp, esp32, esp8266, wifi, esp now, now, esp-now, bt, bluetooth, wireless, connection, data, transfer, tutorial, guide, beginner, beginners, diy, do, it, yourself, communication, arduino, internet, router, gateway, nrf24, lora, rf, 433, MHz, 868, GHz, 2.4, ble, range, speed, rate, voice, speech, walkie, talkie, elektor, greatscott, greatscott!, power, code, sketch, program, electronics, blink, led, long, make, project, how, to, compare, comparison, pro, con, advantage, dis, simple
Id: sLW_r0OVyok
Channel Id: undefined
Length: 12min 14sec (734 seconds)
Published: Sun May 05 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.