Is it really speed related after all??
well, I had equated it to speed because when I run the power drill quickly the thing reboots during reboots… but if I back off the speed with the drill and run medium speed, it will count for a while between reboots and if I run it slowly it seemed like I could run it for a long time without a reboot.
Running it by hand the results are very similar but I’m not spinning it nearly the speed of the power drill. If I run it slowly with my hand, I can get it to count up quite far before it reboots. If I try to crank it quickly, it will only count up a little before it reboots. It still seems to be related to the speed but without knowing the root cause I have a hard time making FIRM determinations.
Really weird. Ok, it’s not Esphome related and I expect neither count related. If you want to be sure just make empty arduino sketch to print only on reboot. Then play with your encoder to see if it reboots.
#include <Arduino.h>
const int pulsePin = 13;
void setup() {
Serial.begin(115200);
pinMode(pulsePin, INPUT);
delay(100);
Serial.println("Reboot");
}
void loop() {}
Otherwise it has to be your Esp-board, your power supply or interferences.
But you have already tried two Esp boards and two power supplies with two different cables, am I right? And scope doesn’t show any spikes anywhere…
You could put a 10k resistor between EN-pin and 3.3V.
Also, is Esp heating up?
ok, I used the code you supplied and tried it out – when I sped up the manual hand cranking, the thing lost it – started printing a bunch of gibberish (it was a lot longer but I cut out some of the middle) until I hit the reset button on top.
13:06:15.633 -> *⸮P⸮TUU⸮⸮⸮U⸮U⸮TE⸮⸮⸮\
13:06:15.633 -> QT⸮JU⸮WU⸮J⸮⸮⸮u⸮⸮\⸮(⸮T⸮J⸮R⸮J⸮u⸮uT⸮T⸮⸮U⸮⸮⸮-QBU⸮⸮j⸮⸮EJ⸮R⸮Zq⸮⸮R⸮Zq⸮uT⸮Zq⸮⸮⸮R⸮Zq⸮⸮WխQ(⸮⸮⸮խQ(Eե⸮I⸮JR⸮T⸮U⸮UZ⸮Eu⸮⸮⸮⸮(U⸮UV+⸮⸮Q⸮⸮T⸮\ETUQ⸮UV+U⸮UU⸮E*UU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQUQQB⸮⸮(QUQQQ⸮TUU⸮⸮JPQUQQB⸮⸮(QUQQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQUQ⸮⸮⸮(QUQ⸮TUU⸮⸮JPQUQQB⸮⸮(QUQQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQEQ⸮⸮⸮(QEQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQUQ⸮⸮⸮(QUQ⸮TUU⸮⸮JPQUQQB⸮⸮(QUQQQ⸮TUU⸮⸮JPQ⸮Q⸮⸮⸮(Q⸮Q⸮TUU⸮⸮JPQ*QQ⸮⸮⸮(Q*QQ⸮TUU⸮⸮JPQ⸮Q⸮⸮⸮(Q⸮Q⸮TUU⸮⸮JPQ⸮Q⸮⸮⸮(Q⸮Q⸮TUU⸮⸮JPQJQQ⸮⸮⸮(QJQQ⸮TUU⸮⸮JPQ⸮QQ⸮⸮⸮(Q⸮QQ⸮TUU⸮⸮JPQ⸮Q⸮⸮⸮(Q⸮Q⸮TUU⸮⸮JPQjQQ⸮⸮⸮(QjQQ⸮TUU⸮⸮JPQ⸮QQ⸮⸮⸮(Q⸮QQ⸮TUU⸮⸮JPQ⸮QQ⸮⸮⸮(Q⸮QQ⸮TUU⸮⸮JPQ*(Q⸮⸮⸮(Q*(Q⸮TUU⸮⸮JPQ*(Q⸮⸮⸮(Q*(Q⸮TUU⸮⸮JPQ*(Q⸮⸮⸮(Q*(Q⸮TUU⸮⸮JPQJ(Q⸮⸮⸮(QJ(Q⸮TUU⸮⸮JPQ⸮(Q⸮⸮⸮(Q⸮(Q⸮*⸮P⸮TUU⸮⸮⸮U⸮U⸮TE⸮⸮⸮\⸮Tj⸮JTWU⸮WU⸮J⸮⸮⸮u⸮⸮\⸮(⸮T⸮J⸮R⸮J⸮u⸮uT⸮T⸮⸮U⸮⸮⸮-QBU⸮⸮j⸮⸮EJ⸮R⸮Zq⸮⸮R⸮Zq⸮uT⸮Zq⸮⸮⸮R⸮Zq⸮⸮WխQ(⸮⸮⸮խQ(Eե⸮I⸮JR⸮T⸮U⸮UZ⸮Eu⸮⸮⸮⸮(U⸮UV+⸮⸮Q⸮⸮T⸮\ETUQ⸮UV+U⸮U⸮⸮E*UU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQUQQB⸮⸮(QUQQQ⸮TUU⸮⸮JPQUQQB⸮⸮(QUQQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQUQ⸮⸮⸮(QUQ⸮TUU⸮⸮JPQUQQB⸮⸮(QUQQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮QQQ⸮TUU⸮⸮JPQ⸮QQB⸮⸮(Q⸮QQQ⸮TUU⸮⸮JPQUQ⸮⸮⸮(QUQ⸮ets Jul 29 2019 12:21:46
13:06:26.555 ->
13:06:26.555 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
13:06:26.555 -> configsip: 0, SPIWP:0xee
13:06:26.555 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
13:06:26.601 -> mode:DOUT, clock div:1
13:06:26.601 -> load:0x3fff0030,len:1184
13:06:26.601 -> load:0x40078000,len:13260
13:06:26.601 -> load:0x40080400,len:3028
13:06:26.601 -> entry 0x400805e4
13:06:26.835 -> Reboot
I played with it a bit more and caused it to do the continuous gibberish dump one more time and manually reset it with the RST button, then tried cranking again and got it to also just reboot cleanly once.
I’ve tried with three separate ESP32 boards, I’ve tried with four styles of power (three different USB cables on two different computers as well as just a 120V wall outlet style to micro USB). I’ve also got two versions of the wiring harness that hook up to the sensor board – one with singleton Dupont connectors on each pin and one with a JST XH header.
I’m suspecting ESD, but I don’t know if it is ESD how to alleviate it, yet. A few basic Google searches revealed “TVS Diodes” to me but I’m not sure what voltage/part number I should use here and specifically where to put them – I’m guessing one between 3.3V and GND and the one between the GPIO and GND should work to suppress ESD spikes if that’s what I’m experiencing?
This is my current circuit.
Oh, I checked the ESP32 processor with my fingers and it doesn’t seem hot but it isn’t cold – like tepid room temp, maybe slightly above?
I’m not a breadboard lover. I personally would take it out as a first step.
If the main chip or voltage regulator(the black guy on the upper left) don’t get sensibly hot, there’s no problem with heat.
ESD was my first thought when I saw your setup. But you should see it on scope…
Did you try extra pullup for EN pin?
I’m with you 100%, I only showed that as an example of the circuit. I’m not actually using a breadboard.
I’m trying to figure out what you mean by the EN pin. Do you mean the signal (in yellow)? If so, what size resistor should I use?
I don’t know/remember what board you have. En pin is the first up-left pin on normal Esp32 board. It enables or disables(if low) the voltage regulator. It has pullup and capacitor onboard, but you could try additional pullup.
Got it, I measured the EN to 3.3V pin and it looks like the built-in pull-up is 12kΩ, I guess I’ll try it with another 12kΩ resistor to halve the pull-up resistance… you think 6kΩ might be adequate or should I go with something more aggressive?
6k is fine, it really doesn’t matter, wire it with jumpers just to try.