I have a Geiger counter COJOE GC-1602-NANO V1.3. I wanted to add WiFi functionality. I considered a few options and settled on a nano esp32 and bought one. I then realised that there was continuity in the pins (to a greater degree) the logic was 3.3 V… However, I determined that 4 of the 5 pins used worked fine. However the Interrupt pin D2 would have 5 V signal and likely kill the board. I then fell in a little rabbit hole of arduino pin notation v esp32 GPIO notification… I used the examples/esp32/FunctionalInterrupt sketch and made sure I was addressing the correct pin.. In this case I moved to D4 / GPIO7. I ran this in a breadboard and all was good. This, however, uses the internal pull-up resister. So I commented out the pull-up line and put a 200 ohm pull-down on the breadboard. This all worked. I have attached to the COJOE board a 100:200 ohm voltage divider over the D2 (5 V), D4 (3.3 V) and GND. The assumption being that the 200 ohm to GND will act as pull-down when the signal is not active. However, when I power it up and the thing starts clicking away I have nothing on the D4 pin. no counts. Any ideas?
The normal procedure is to post all your code using the CODE button in a reply. The other thing is to hand draw the wireing so we can see what is connected to what. Do this with your actual wires not the instruction sheet. Take a phot or more and post that as well. Now, a brief I expected his thing to happen, but instead this happened.
I didn’t post code initially as the code is tested and works. It is fundamentally the code example but just pointed at another pin. The question is really about why when it works with a 200 ohm pull-down with 3.3 V on a breadboard will that not translate to a 5 V logic with a voltage divider (100:200 ohm). To me that looks the same. I’ve bobbed the code below, as I say it’s from the ESP example code: (It doesn’t look copied in as I expected)
// ESP32 external interrupt test pin 7 falling edge
Your word salad does not convey enough information to give you an informed answer.
The best things you can do is post your code as requested by @sonofcy, an annotated schematic, and look up ohm's law.
A quick calculation shows at 3V3 at 200 Ohms you draw 16.5 mA, at 5V with 100 Ohm you draw 50 mA. These values high or over the current capability of the ports. Without a schematic this is just a SWAG.
Either use the CODE button or in the IDE as shown below.
I don't use voltage dividers, I use 2 way level changers.
You have picked the NANO ESP-32 which is a little tricky to work with.
Try using a 750K pulldown and change the attachInterrup to use whatever GPIO number you are connected to.
If that does not work you will have to modify the PCB.
You may also need level translators on the I2C bus to the LCD, but it may work without.
Thanks the I2C comms works ok with out modification. I did wonder if they would work what with the CAJOE device being 5 V logic but it works fine and I have managed to tweak the out of the box (of github) code. I didn’t mention that above, my description of what I am up to already being a “word salad”.
As to the interrupt signal I’m now exploring the man with the Swiss ’s accent’s video which I think has the answer. My CAJOE is a reworked version but common in many a way.
Thanks so much. I love listening to the man with a Swiss accent… He has chosen an early version to work with (wise). I stumbled upon the V3.1…
As you say he details my mistake… The interrupt is in his case compatible with the ESP32 logic. There is not need to shift it. As far as I can trace on my version this is common. I should have just blindly plugged it in… It would not have damaged it… There would have been the pin addressing quirk of the ESP32 nano but I would not have destroyed it.
I am sure I saw a comment, though I can’t find it now that the feed from the CAJOE to the D2 pin would fry the board (something to that effect). I took the liberty of pulling the D2 pin from the microcontroller header to prevent this… I guess I have to put that back in now lol to maintain a direct swap out of ‘nano’ and ‘esp32 nano’. I’ll just check if GPIO5 on the ESP is one of those that is fussy first.
I’m going to put the header pin back in and see if the ‘Andreas’ principle’ applies or the board fries.
A nice experiment. I like the clicks… Reminds me of the X-Ray checks I had to do on an XRD I ran and the neutron diffraction experiments at ILL. Them’s the days!
From the Nano ESP32 documentation: Please read: operating voltage
The microcontroller on the Arduino Nano ESP32 runs at 3.3 V, which means that you must never apply more than 3.3 V to its Digital and Analog pins. Care must be taken when connecting sensors and actuators to assure that this limit of 3.3 V is never exceeded. Connecting higher voltage signals, like the 5 V commonly used with the other Arduino boards, will damage the Nano ESP32.