#95 Speed Contest! ESP8266, ESP32 and the Uno 328P

  Рет қаралды 25,271

Ralph S Bacon

Ralph S Bacon

6 жыл бұрын

Having used the ESP8266 recently I was impressed by its speed. When it's bigger brother, the ESP32-WROVER development board, arrived it seemed an ideal moment to check them all out, speed-wise, against each other even though it did seem like a foregone conclusion.
Using the ESP32 was a bit of an eye-opener, and I made it much more difficult for myself by using the excellent Eclipse IDE, but in native C++ mode, not in Arduino mode. so all the Arduino language commands I was used to were not available to me. No wonder it took me nearly a week just to get the on-board LED to blink!
Anyway I finally managed to get something running and the video shows all, with more tales of my experiences with the ESP32.
Here are some great links (some of these documents I've also uploaded to my GitHub repository in case they disappear).
github.com/RalphBacon/ESP32
1. The ESP32-WROOM datasheet (this is the chip that Espressif use)
espressif.com/sites/default/fi...
2. Getting started with the ESP32
esp-idf.readthedocs.io/en/lat...
3. ESP-IDF programming setup (for Windows + others) guide
esp-idf.readthedocs.io/en/lat...
4. The ESP-WROVER-KIt Getting started guide (this is the development board I use in the demo)
esp-idf.readthedocs.io/en/lat...
5. Build and flash with the Eclipse IDE
esp-idf.readthedocs.io/en/lat...
6. The Github repository for the ESP-IDF
github.com/espressif/esp-idf
7. The espressif Arduino-ESP32 library
github.com/espressif/arduino-...
8. Neil Kolban's ESP-32 snippets
github.com/nkolban/esp32-snip...
9. Espressif's ESP32 Forum
www.esp32.com/index.php
10. Neil Kolban's PDF ebooks on the ESP8266 and ESP32
neilkolban.com/tech/esp8266/
leanpub.com/ESP8266_ESP32
-- If you find them useful please donate! --
11. My Arduino sketch is in the repository
github.com/RalphBacon/ESP32
If you like this video please give it a thumbs up, share it and if you're not already subscribed please do so :)
My channel is here:
------------------------------------------------------------------
/ ralphbacon
------------------------------------------------------------------
How can I remember this? Memory tip: "See" Ralph Bacon, geddit?
[You can also use this link: / ralphbacon ]

Пікірлер: 73
@pcbreflux
@pcbreflux 6 жыл бұрын
Hi, why not using the arduino libraries for the esp32 (github.com/espressif/arduino-esp32) ? Installing should take only some minutes and you can compare the same source code on all devices.
@mrroobarb
@mrroobarb 6 жыл бұрын
My thoughts exactly.
@RalphBacon
@RalphBacon 6 жыл бұрын
Which is exactly the conclusion I came to but far too late, after grappling with the 'native' libraries for a week. It's my next step to install the Arduino compatible ones (already downloaded). Maybe another video...
@lezbriddon
@lezbriddon 6 жыл бұрын
please a part2, interesting to see speeds on a level playing field of same ide, as in the real world its a more likely scenario.
@RalphBacon
@RalphBacon 6 жыл бұрын
Indeed, les, a part two is already being planned. Having sorted out the SPI bus speed issue and having modified the simple counter code slightly so that less was sent down the SPI wire, it will be a much more level playing field. And guess which one wins by a landslide? Phone a friend? 50/50?
@avejst
@avejst 6 жыл бұрын
Thanks for sharing. Nice to see the esp32 head to head to the esp8266😀👍
@RalphBacon
@RalphBacon 6 жыл бұрын
But I feel there's more to it, Asger, so I'm still looking into using the ESP32 with standard Arduino-compatible libraries and see how that much change things. Then it may look very different in results terms... we shall see!
@cresenciobermejo7266
@cresenciobermejo7266 6 жыл бұрын
Hi Ralph I really like how you explain things in your videos and I would also like if you have a tutorial on using ESP8266 01 and ESP8266 12e using an Arduino UNO board while uploading codes. I find it hard to find detailed explanations for these 2 wifi modules in the internet.
@RalphBacon
@RalphBacon 6 жыл бұрын
I have recently acquired some ESP8266 modules, Cresencio, so there will be a video in the near future, stay tuned. Thanks for the suggestion!
@andrecastro6568
@andrecastro6568 6 жыл бұрын
Hi Ralph, nice job, but it was not clear for me whether you have used the OS_SDK or the NONOS_SDK. Indded, even the ESP82 having two cores, the change of context among internal cores would require a lot of processing, which could perhaps explain the difference in performance. Do you think so aswell ?
@RalphBacon
@RalphBacon 6 жыл бұрын
Hi Andre, good question. The Arduino-ESP32 comes with the RTOS SDK (module) although in this simple demo I'm not using any of its features; for example I'm not spawning tasks to be run, I'm just running them in real time, as it were. However, my understanding of the ESP32 grows daily so maybe there is another way I should be running this demo. That said, I've now implemented the Arduino-ESP32 library, and have upped the default SPI speed from 100kHz to 20Mhz and have "hacked" one of the RTOS modules (esp32-hal.h) so that it does not worry about either core accessing SPI simultaneously (not recommended, although Espressif showed the hack!) and it now runs about 4 to 5 times faster than the ESP8266. This is still not a fair test though. In the Arduino and ESP8266 code I just bit-banged the SPI bus (I used a sketch from a previous video where I did not want to distract viewers with libraries of any kind). However, on the ESP32 this only worked for a very short while before it gave up (I'm assuming the clock signals got a bit stretched or out of sync) so I reverted to hardware SPI. And it now runs just fine (it would run marginally slower if I remove the concurrent SPI access - but this exercise was purely about speed not what you might implement in the Real World). All said and done, and whilst this was an "interesting" demo that I'll have to finalise in another one soon, this channel is about Arduinos and their close cousins. The ESP32 is definitely a cousin-once-removed and requires a different way of programming - not something for Arduinite beginners! What a long answer! Just goes to show that there is so much to consider when dealing with the ESP32. I hope this hasn't put you off investigating it though, perhaps with the smaller (and much cheaper) ESP32 dev module which I will also show in that update video?
@zodak9999b
@zodak9999b 6 жыл бұрын
I'm guessing you started with Kolban's spi_transmit.c file from his snippets collection, is that right? Did you change the SPI clock frequency when you did that, because he's using 10kHz for a default. I normally run SPI in the MHz range, if my devices can handle it.
@RalphBacon
@RalphBacon 6 жыл бұрын
I did use his snippets - if the SPI bus is running so slowly (you did mean kHz not MHz?) that would definitely be like wading through treacle on a cold day. I'd expect the SPI bus to run at around 10MHz on this device or something close to that. I will investigate further...
@RalphBacon
@RalphBacon 6 жыл бұрын
Also posted in pcbreflux reply in this video comments: So I've upped the SPI bus to 10Mhz (just by adding two zeroes to that parameter, doh!) and already the output is several times faster (4-5 times) than the Arduino Mega 328P but still not as fast as the ESP8266. Upping it to 20Mhz made no significant difference. But it's a start.
@zodak9999b
@zodak9999b 6 жыл бұрын
I think I misread it and it was actually 100khz, not 10... but still, that's quite slow for SPI. I'm glad you saw better results after adding those zeroes. :)
@RalphBacon
@RalphBacon 6 жыл бұрын
Yes, it was 100KHz by default but that is very slow. I'd expect 10Mhz! Anyway, I've now also cracked it by using the Arduino-ESP32 libraries - now runs x times faster than an ESP8266 (for this sketch, anyway). All will be revealed in a future video!
@tiwar87
@tiwar87 5 жыл бұрын
Is better to program the ESP with the Native C or is better to use the Arduino IDE to program it?
@RalphBacon
@RalphBacon 5 жыл бұрын
The Arduino IDE will program your ESP32 or ESP8266 with compiled native C code - no reason not to use it! By selecting the correct board the correct compiler will be invoked - just as if you had done it manually for that particular chip. Cool, hey?
@kevinwilliams184
@kevinwilliams184 6 жыл бұрын
Hello, This sounds I/O related. I would recommend doing some math functions (in the main loop) and then update the display only occasionally to see of the number of loops that the calculations have completed. As a first thought have variables A and B start A at 1 million and B at zero. Multiply the values while decreasing A and increasing B by 1. When the loop is finished display the loop qty. I learned this as an example as one of my first programming sessions back in in 1978. Did it in basic side by side with one system displaying the multiplied values and the other simply stating "I am finished" at the end. The display processor REALLY slowed down the output. Enjoyed the video, I have just recently subscribed.
@RalphBacon
@RalphBacon 6 жыл бұрын
Thanks for that suggestion, also suggested in another form by Graham here too. I knew the display would slow things down but as it was all relative I didn't think it would matter. But if the SPI bus speed I'm using on the ESP32 is really slow (as suggested by others here) then that would definitely be a speed killer (and a totally unfair test). I shall try all these suggestions out tonight and over the weekend. Thanks for subscribing too, appreciated.
@kingearwig
@kingearwig 6 жыл бұрын
Why does the chart at 10:04 say that the esp8266 has built in Bluetooth?
@RalphBacon
@RalphBacon 6 жыл бұрын
That's wrong, obviously, Bill, thanks for highlighting this. I'll see if I can put something on the video to ensure viewers are not misled. Perhaps it was wishful thinking on my part? Thank goodness I didn't put a line up for "Predicts winning lottery numbers" too.
@RalphBacon
@RalphBacon 6 жыл бұрын
It appears KZbin have removed the facility to add annotations so I'm unable to put something on screen, other than as a subtitle which won't be visible unless users switch them on. I shall have to investigate this too on the forum to see what others are doing... (it never ends)
@eastern815
@eastern815 6 жыл бұрын
Thank you for sharing.
@RalphBacon
@RalphBacon 6 жыл бұрын
And thank you for posting here, it's always nice to get feedback from my Arduinite viewers.
@uweri_3851
@uweri_3851 6 жыл бұрын
Hello Ralph, I love your KZbin videos. For me as a noob it helps to understand how to use microcontroller. But what about ARM STM32 like STM32F103C8T6 controler. They seem to be much more powerfull as an Arduino. Further on they are cheaper and can be programmed over Arduino environment. Would be great if you give us an overview from your point of view.
@RalphBacon
@RalphBacon 6 жыл бұрын
Yes, I hear you Uwe but there are only so many hours in the days I can investigate - and video - all this great stuff. But you are not the first to request something on the STM32 and it is on my backlog. The next thing I'm covering is the Wemos D1 mini which is also quite powerful (and has built-in wifi, of course) and after that... who knows? Alles klar, gut von dir zu hoeren, vielen Dank fuer deinen Beitrag.
@uweri_3851
@uweri_3851 6 жыл бұрын
Thank you for your feedback signal. Wemos D1 Mini is also one of my favorites. I'm looking forward to your next video clips
@neilbarnett3046
@neilbarnett3046 3 жыл бұрын
Is it worth taking this out, now, Ralph? IIRC, you made a subsequent video that showed the ESP32 as being much faster than the others, as expected. My guess is that the display or controlling the display was a bottleneck. And did you ever find out why the counter was slow?
@RalphBacon
@RalphBacon 3 жыл бұрын
The counter was slow because the default SPI clock was set to something ridiculously low (100kHz). Once that was upped to 1MHz or so it just romped home. Question: why have SPI set to 100kHz as a default setting? Safe, certainly, but so many users will wonder what is going on!
@colinpamplin9976
@colinpamplin9976 6 жыл бұрын
I notice pcbreflux has just posted an ESP32 Arduino Speed Comparison video. Thought you may be interested
@RalphBacon
@RalphBacon 6 жыл бұрын
Ah well, they do say Imitation is the Best Form of Flattery, albeit a bit brazen in this case! He could have left it a month or so! But he was helpful in sorting out my ESP32 SPI bus speed issue so I guess we all help each other one way or another. It's not a competition (I tell myself) for views and subscriptions. Meanwhile, back on Planet Earth...
@willofirony
@willofirony 6 жыл бұрын
Excellent video (mainly because Benny paid a visit - is he not that impressed with ESP-32?). The speed results on the ESP-32 were very interesting; but a device running under the management of a RTOS is generally going to compare rather badly with a device in which your sketch is the ONLY code that is running on the chip, However, should one compare the performance of the three devices running an application that justified the use of a chip like the ESP-32, one might find the results rather different. Dual core might prove to be disappointing in many cases. It is likely that the RTOS has designated the 2nd core (or the core that your sketch is not running on) for those tasks that the 8266 and ATMega 328 currently use interrupts for. Such as Serial, Display processing, Wifi and bluetooth. What would be interesting would be if the ESP-32 firmware could be programmed WITHOUT the RTOS. I suspect the ESP-32 would dim all your lights when it booted up; such would be the raw power.
@RalphBacon
@RalphBacon 6 жыл бұрын
"I suspect the ESP-32 would dim all your lights when it booted up..." - and that is exactly what I (and Benny, it must be said) were expecting. so whether it's the RTOS (not really an operating system at all) slowing things down or the SPI bus running at 1/10th at its proper speed remains to be investigated. I certainly intend to get Benny more interested in the ESP32 so we have code written much more quickly than I could ever do (and as I have unfortunately proved these last two weeks or so). As for the dual core aspect of this chip I will dig down and find out whether it used for other peripherals or whether I can issue a task on both cores to run simultaneously (not pseudo-simultaneously, time-sliced). Thanks for posting Michael, Benny reads your posts too.
@willofirony
@willofirony 6 жыл бұрын
BTW, I feel your pain from your experience with Eclipse. I tried wrestling with it over 3 decades ago. I gave up after two weeks. At that time, the anti-Microsoft lobby were desperately looking for an alternative to Visual Studio. Many forums had posts claiming that Eclipse was a far superior IDE but I am convinced it was wishful thinking. Even after getting the beast to compile, its "intellisense" was very hit or miss.
@RalphBacon
@RalphBacon 6 жыл бұрын
You may have noticed, Michael, that I like the Eclipse when used with the Arduino add-in. It's very much like Visual Studio (well, I believe that VS now uses a customised version of this, it certainly looks *very* similar). But using it natively when I'm not familiar with all the ins and outs of where to put the libraries was a bit of a challenge (as well as not spotting the example program was in "C" not C++). That aside, look at my comments below from tonight where Benny's managed to get it 4x faster than an Arduino just by following the suggestions here that the SPI bus was set too low! Now I feel stoopid.
@jeffmcclain
@jeffmcclain 4 жыл бұрын
I doubt showing how fast a counter can increment is a very good demonstration of 8-bit vs. dual 32-bit processing power, etc...figuratively good job, but...yeah.
@RalphBacon
@RalphBacon 4 жыл бұрын
Yeah, well, Jeff, I wanted to show something _visually_ to my viewers and this was what I came up with! As it happens, it was most useful inasmuch that the ESP32 was *very slow* and others alerted me to the SPI (I2C?) clock speed which was set to 10 (100?) kHz. Once I had changed that (tricky, deep in the bowels of the code) it just romped home a clear winner. I don't remember all the details (?) but it was fun, all the same! That ESP32's speed has got to be seen to be believed.
@aaron41
@aaron41 6 жыл бұрын
Not really a fair comparison.. The esp32 is running an operating system under the code where the other two are executing raw instructions. The architecture between the 8266 and the 32 is very similar so raw code execution should scale fairly linearly with clock and number of cores.
@RalphBacon
@RalphBacon 6 жыл бұрын
Well, possibly that and running the ESP32's SPI bus at some stupidly slow speed (100Khz) really nobbled that poor ESP32. Once I'd fixed that (see further comments under this video on what I did, thanks to other contributors here) the ESP just laughed and ran away at quite some speed from even the ESP8266 (as you might expect). I should revisit this but at the moment I'm still concentrating on reflashing the ESP8266s contained in Sonoff devices for my Workshop automation project - and the ESP32 hasn't made it into that arena just yet. But take it from me the ESP32 is f-a-s-t. Thanks for your post, Aaron, good to hear from you.
@John_Smith__
@John_Smith__ 6 жыл бұрын
I have been on the esp32 specs page and they mention 240MHz clock frequency and also 16MB flash/Rom ...
@RalphBacon
@RalphBacon 6 жыл бұрын
Indeed, John, and the ESP32 WROOM spec sheet states "There are two CPU cores that can be individually controlled, and the clock frequency is adjustable from 80 MHz to 240 MHz" although I haven't experimented with that feature yet. That's techno-speak for "I don't know how to adjust this frequency". They don't make it easy for me do they? Anyway, they also say, "ESP-WROOM-32 integrates 4 MB of external SPI flash" (can have up to 4 of these, ie 16Mb max) and my ESP32 experimenter's board (ESP-WROVER) "features both 4 MB external SPI flash and 4 MB external PSRAM" although exactly how I use either/both is not something I've learned in the 30 minutes I've used the board to-date, much to my embarrassment! I suspect it may take me a bit longer to get to grips with board along with all the other videos I'm lining up. Thanks for posting this John, good to hear from you.
@John_Smith__
@John_Smith__ 6 жыл бұрын
Oh trust me I also have more questions then answers regarding the ESP32 platform. It is still a very "young" platform. But it looks promising as long as they support the Open Source environment around it, that is ..more source code, more libraries and functionality easily available for everyone.
@mattjmwmatt
@mattjmwmatt 6 жыл бұрын
no stm 32 love?
@RalphBacon
@RalphBacon 6 жыл бұрын
Oh indeed, I have love for all things electronic but so far I have limited my enthusiasm to the Arduino family, the ESP8266 and now the ESP32 (which I think might actually take the place of the Arduino in a year or so, it's a great chip). But you never know, when I find the time... Nice to hear from you Matheus.
@wishusknight3009
@wishusknight3009 3 жыл бұрын
That esp32 should be about 10 times the 8266 again. Or at least a couple of times faster anyhow.
@RalphBacon
@RalphBacon 3 жыл бұрын
Yes it is. In this video the SPI bus (I think) was set to a very slow speed. Once that was corrected it was like greased lightning.
@wishusknight3009
@wishusknight3009 3 жыл бұрын
@@RalphBacon The ipc gain was nothing short a quantum leap! thankyou for replying!
@Electromaniaworld
@Electromaniaworld 6 жыл бұрын
all three are completely different from hardware point of view. arduino is only 8 bit and esps are 32 bit those are obviously going to be much faster. secondly esp32 is dual core, if used smartly can run much faster.
@RalphBacon
@RalphBacon 6 жыл бұрын
"If used smartly" is indeed the crux of the matter, Electromania. I don't think we're quite there yet with ESP32 support but 2018 may see that turn round, just like it did with the ESP8266. Incidentally, I got the ESP32 to run many times faster than the ESP8266 when I figured out (was told, actually) that I had the bus speed set to default (ridiculously slow).
@cmuller1441
@cmuller1441 6 жыл бұрын
It looks like you are just comparing spi speeds. Depending on implementation, library... this is not meaningful?
@RalphBacon
@RalphBacon 6 жыл бұрын
Well, that was not the intention. The aim was simply to send data down the SPI bus to indicate what was happening internally (ie adding up that number). What happened was that the ESP32 was indeed severely throttled by the SPI bus speed (100Khz, I mean who would set that as a default?) but it's all fixed now and with a small change to the code to only send out relatively little data on the SPI bus the next video on this topic will set the record straight. Keep tuned and a good observation!
@grahamwise5719
@grahamwise5719 6 жыл бұрын
Use arduino IDE and hardware SPI not software SPI this hardware SPI is only on the ESP32 not the ESP8266. See the G6EJD channel Tech note 45, kzbin.info/www/bejne/gXfNioSDdrp3oNk The arduino 8266 library is now 2.04rc01by the way. Paste in Arduino Ide preferences... github.com/esp8266/Arduino/releases/download/2.4.0-rc1/package_esp8266com_index.json Adding the ESP32 is a bit harder than just a JSON link on the Aduino IDE preferences but the Wiki instruction do work. github.com/espressif/arduino-esp32 and select the OS you are using. Please when you have it going an update video would be very appreciated. Graham
@RalphBacon
@RalphBacon 6 жыл бұрын
Thanks for the links Graham, and yes, my intention is to do a further video once I have it all running as well as my ESP8266 on my Arduino IDE. That's all after my lie down in a darkened room, of course.
@artbecker5618
@artbecker5618 6 жыл бұрын
Thank you again, Ralph. My suggestion is to do your links differently. Many of the links you posted are actually in this format, like for example #2: kzbin.info?event=video_description&v=GQUHymJ_YPw&redir_token=XYne-mF0GRaodmfje6lZX86-qQ18MTUwNjcxMDE1NkAxNTA2NjIzNzU2&q=https%3A%2F%2Fesp-idf.readthedocs.io%2Fen%2Flatest%2Fget-started%2Findex.html%23get-started-get-esp-idf It would be more useful if they were the actual link and not redirected from KZbin: esp-idf.readthedocs.io/en/latest/get-started/index.html#get-started-get-esp-idf I save the videos, as well as keeping a separate text file for the associated information. Copying to a text file the link location of the links you posted does not work when later clicking on them. KZbin always truncates long links, so it's not just a simple matter of cutting and pasting the comments. 2. Getting started with the ESP32 esp-idf.readthedocs.io/en/latest/get-started/index.html#get-started-get-esp-idf 3. ESP-IDF programming setup (for Windows + others) guide esp-idf.readthedocs.io/en/latest/get-started/windows-setup.html 4. The ESP-WROVER-KIt Getting started guide (this is the development board I use in the demo) esp-idf.readthedocs.io/en/latest/get-started/get-started-wrover-kit.html#rgb-led 5. Build and flash with the Eclipse IDE esp-idf.readthedocs.io/en/latest/get-started/eclipse-setup.html 6. The Github repository for the ESP-IDF github.com/espressif/esp-idf 7. The espressif Arduino-ESP32 library github.com/espressif/arduino-esp32 8. Neil Kolban's ESP-32 snippets github.com/nkolban/esp32-snippets
@RalphBacon
@RalphBacon 6 жыл бұрын
This is very naughty of KZbin to do this. I've just replaced my #2 item in the list with your version and it has converted back to a KZbin redirect when I save the video description. I wonder if there is a trick to getting 'standard' URLs to be saved? I shall investigate. After being screwed over by Dropbox removing the Public folder where I had placed dozens of video links (and which are now inaccessible), I'm being done unto again by KZbin, it would seem. Thanks for bringing this to my attention Art, I shall look on the KZbin forum to see if others have this issue. Grrr.
@artbecker5618
@artbecker5618 6 жыл бұрын
Yet another new "feature" that makes things "better." The way around it is to post the links in a pinned comment, rather than the previously useful video information area.
@RalphBacon
@RalphBacon 6 жыл бұрын
I've had a brainwave! The other way is to just go to my GitHub repository (link in the video description, yes, redirected but it's just one) and look at the ReadMe.MD file - it's [almost] the same as the video description but all the links are 100% as I typed them in! Maybe in future I won't try and repeat the information in the video description, I shall ponder a while. But thanks for that suggestion I might do that too!
@pcbreflux
@pcbreflux 6 жыл бұрын
See github.com/nkolban/esp32-snippets/blob/master/cpp_utils/SPI.cpp in SPI::init ... dev_config.clock_speed_hz = 100000; ... maybe try 10 MHz instead of 100 kHz
@RalphBacon
@RalphBacon 6 жыл бұрын
Ah, you're the second person to suggest the SPI bus speed is 'wrong', thanks for this, I shall definitely check this out. Yes, that was the file I was using too, so I'm keen to try it out this evening...
@RalphBacon
@RalphBacon 6 жыл бұрын
So I've upped the SPI bus to 10Mhz (just by adding two zeroes to that parameter, doh!) and already the output is several times faster (4-5 times) than the Arduino Mega 328P but still not as fast as the ESP8266. Upping it to 20Mhz made no significant difference. But it's a start. Now I'll get it working with the Arduino IDE so I can at least use the same source code. thanks again for pointing this out, seems a strange default value to use, usually SPI bus is 1/4 of main clock speed; on this board I believe it can go as high as 80MHz.
@pcbreflux
@pcbreflux 6 жыл бұрын
If you have the time: today I upload my own speed comparison kzbin.info/www/bejne/sKDJlZtnoq6UbMk (ESP32 #57: ESP32 Arduino Speed Comparison) inspired by your video.
@RalphBacon
@RalphBacon 6 жыл бұрын
I haven't had time to look at your video (yet) but I will do over the weekend. I hope you had better results than me (although after that SPI bus change it does run much faster). Now it's complaining about my SPI library from the Arduino-esp32. The joys of programming!
@RalphBacon
@RalphBacon 6 жыл бұрын
Prima und erste Klasse! Dein Video, meine ich. I thought it very interesting how you ran the different processors side-by-side doing various mathematical functions - and of course, the ESP32 thrashed the competition. I'm surprised the MEGA was not quicker (compared to a standard Arduino). My recent experiments with my ESP32-WROVER kit also prove that it is many times quicker than even the quick ESP8266. Anyway, gut gemacht und bis demnaechst.
@gpTeacher
@gpTeacher 4 жыл бұрын
Hi Ralph. I hope you and your family are having a great holiday season and that your health continues to improve. I have a conundrum with the ESP8266 Wemos D1R1. I'm trying to activate a relay via an NPN MOSFET and it works fine if I power up the Wemos WITHOUT the ground for the MOSFET/Relay connected and then connect the ground AFTER bootup. However, if the ground is connected at time of powerUp of the Wemos, the relay instantly energizes and the Wemos won't boot. If you go to: hausofpayne.weebly.com/wemosRelay and check out my circuit diagram and sketch, you'll see the details. I used an UNO graphic, but it's a Wemos D1 R1 I'm using in the project. Yes, I know I should be using an opto-isolated relay, but I'm actually using the relay contact as the hammer for a small chime. There will be NO Load voltage on the NC or NO sides of the 3V relay. No connections at all other than coil. No rush on this Ralph. If you've got some insights that I can incorporate into my circuit/sketch, they're always welcome. Thanks as always Ralph. Gord
@RalphBacon
@RalphBacon 4 жыл бұрын
Hi Gord and Happy New Year! Boy, you like making things difficult for me don't you? Fritzing layouts are the spawn of the devil when it comes to figuring out the circuit diagram. Looking at your diagram the MOSFET has its GATE connected to the D8 pin of the ESP8266. It also connects to a 10K resistor to GND to keep it off until driven on. The Source of the MOSFET goes to GND. The DRAIN of the MOSFET goes to one side of the relay, The other side of the relay goes to +5v. IMPORTANT! There should be a 1N4001 or similar diode across the relay with the cathode connected to +5v to protect the MOSFET or it will die due to all the back EMF voltages. If you disconnect D8 from your ESP8266 and connect it to +5v does it all work correctly? IMPORTANT! Note that if D8 is pulled/held HIGH at boot time then the boot will fail. Try using a different pin eg D1, D2, D5, D6, D7 all of which have no effect on booting up. Let me know! PS This also might help: randomnerdtutorials.com/esp8266-pinout-reference-gpios/
@gpTeacher
@gpTeacher 4 жыл бұрын
thank you very much for your clarification Ralph. I appreciate your expertise! Best wishes, Gord
@gpTeacher
@gpTeacher 4 жыл бұрын
@@RalphBacon Thanks for your help Ralph. Sure enough, D8 is HIGH during upload and boot. I moved the relay to D10 and all's great! I tested each pin with the basic Blink sketch and here are my Voltage results. I used a digital multimeter so results are just what I saw on the display. Voltage at Upload/ Post Upload / Boot to Upload Running Basic Blink sketch with built in LED only Dx V on Upload V After Upload V Boot to V Run 0 3.x 3.x 1.x up to 3 1 3.x 3.x 1.x up to 3 2 3.x 0 1.x down to 0 3 0 0 0 4 0 0 0 5 0 0 1.x down to 0 6 3.x 0 1.x down to 0 7 3.x 0 1.x down to 0 8 3.x 3.x 1.x up to 3.x 9 3.x floats 1.x to floating 10 0 0 0 11 3.x 0 0.x down to 0 12 3.x 0 1.x down to 0 13 3.x 0 1.x down to 0 Thanks again! You are the Professor of PLC Pultritude! Best wishes, Gord
@RalphBacon
@RalphBacon 4 жыл бұрын
Glad I could help! Don't forget that protection diode across the relay!
@gpTeacher
@gpTeacher 4 жыл бұрын
@@RalphBacon absolutely! Always!
#94 TM1637 LED Controller (Part 2) using NTP Server
30:06
Ralph S Bacon
Рет қаралды 8 М.
#150 SMD KiCAD Arduino PCB Project (Spoiler: 😭=FAIL)
30:03
Ralph S Bacon
Рет қаралды 9 М.
Женская драка в Кызылорде
00:53
AIRAN
Рет қаралды 478 М.
Smart Sigma Kid #funny #sigma #comedy
00:26
CRAZY GREAPA
Рет қаралды 21 МЛН
Inside Out 2: Who is the strongest? Joy vs Envy vs Anger #shorts #animation
00:22
Finger Heart - Fancy Refill (Inside Out Animation)
00:30
FASH
Рет қаралды 21 МЛН
#117 Bare Bones 💀 Arduino (make your own)
27:34
Ralph S Bacon
Рет қаралды 13 М.
#139 No Real Time Clock (RTC) Required (Wemos ESP8266 Mini)
31:38
Ralph S Bacon
Рет қаралды 22 М.
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
#170 ToneAC Library with 328P DIP Nano PCB Plug-in
30:08
Ralph S Bacon
Рет қаралды 6 М.
ESPNOW mix with #ESP32 and #ESP8266
25:37
Programming Electronics Academy
Рет қаралды 36 М.
YOU can Learn the ESP32 in 15 Minutes:  Hello World!
22:52
Dave's Garage
Рет қаралды 299 М.
#149 ESP32 Deep Sleep, RTC Memory, "Secret" LoLin Pins
13:28
Andreas Spiess
Рет қаралды 147 М.
#141 ESP32 + SSD1306 OLED Single Module (Arduino Compatible)
36:45
Ralph S Bacon
Рет қаралды 17 М.
Сколько реально стоит ПК Величайшего?
0:37
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 6 МЛН
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 4 МЛН
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 4,9 МЛН