No video

ESP32 Pulse Counter

  Рет қаралды 22,356

John Lauer

John Lauer

Күн бұрын

This video shows off a new pulsecnt module for the ESP32 NodeMCU firmware. The pulsecnt library handles sophisticated and automatic pulse counting using the built-in hardware on ESP32. The pulsecnt library gives you a means to not rely on GPIO triggers to do your pulse counting and instead offload the work to independent hardware. You gain the ability to count pulses up to 80Mhz (speed of APB clock).
You can get a callback to Lua when different counting thresholds are reached, or when upper or lower counting limits are hit. You can count pulses on all GPIO ports. There is also a way to provide a control GPIO for ignoring or decrementing pulses when the control signal is high or low.
The Github repo for the pulsecnt library is at github.com/chi...
Example code for different types of pulse counter implementations is available as Gists on Github.
Example Pulse Counter for 1 channel with no control gpio
gist.github.co...
Example Pulse Counter for hall effect sensor plus 1 push button to control direction of count
gist.github.co...
Example Pulse Counter for 1 channel for polling pulse count (no callback)
gist.github.co...

Пікірлер: 18
@browaruspierogus2182
@browaruspierogus2182 5 жыл бұрын
Hardware pulse counter comes with esp-idf examples. Very easy to use
@JohnLauerGplus
@JohnLauerGplus 5 жыл бұрын
I found it was confusing how there was one unit, two channels, four gpio ports (2 pulse in, 2 control), and a high/low limit for each channel, but in the callback you could never know which channel's high/low limit triggered the callback, rather all you know is that a high/low limit was triggered. You can ultimately deduce that info so not a big deal, but took a bit to wrap my head around their approach.
@ivorypei3649
@ivorypei3649 5 жыл бұрын
Great video, John Lauer!
@dalvrzx
@dalvrzx 3 жыл бұрын
Hi! Thanks for the video. How many pulse counters can you use at the same time?
@JohnLauerGplus
@JohnLauerGplus 3 жыл бұрын
nodemcu.readthedocs.io/en/dev-esp32/modules/pulsecnt/ are the docs now published into the main esp32 repo. You'll see the docs for pulsecnt.create(unit, callbackOnEvents) and that unit can be 0 thru 7.
@dalvrzx
@dalvrzx 3 жыл бұрын
@@JohnLauerGplus great! thank you for such a quick reply!
@fransmulder9877
@fransmulder9877 4 жыл бұрын
Hi John, Yes it is confusing with 4GPIO pins for one channel. I couldn't finf which GPIO pins allocate to which Unit or alternatively how to allocate a Unit to a set of GPIO pins. Can you give a hint where to find this? Frans
@JohnLauerGplus
@JohnLauerGplus 4 жыл бұрын
This library is now in the NodeMCU ESP32 docs, so I suggest you go to that as I created tons of example code.
@CHEFDEPARIS
@CHEFDEPARIS 5 жыл бұрын
Hi, Greatings from Paris! How big do you think 3D printing is gonna be?
@jak_k
@jak_k 4 жыл бұрын
I really think you need to get rid of the handheld camera. Otherwise nice vid.
@JohnLauerGplus
@JohnLauerGplus 4 жыл бұрын
Yeah, it's hard to find the time to make these videos though, so I side on showing good content over spending a bunch of time on the setup like a camera holder, otherwise I'd just never publish niche stuff like this. There's not very many people looking to understand the ESP32 pulse counter hardware.
@jak_k
@jak_k 4 жыл бұрын
@@JohnLauerGplus Yeah I imagine editing would take 3-4 times longer than a video runs, but "if you build it they will come". anyway thanks for taking the trouble to share what you have learnt.
@jak_k
@jak_k 4 жыл бұрын
Which onscreen oscilloscope do you use? Thanks
@JohnLauerGplus
@JohnLauerGplus 4 жыл бұрын
It's the MSO-28 scope. It's super handy to not be tied to your main work desk to scope stuff up. Not as cheap as I think a USB scope should be, but I gotta believe there's cheaper stuff out there these days.
@aragornale
@aragornale 3 жыл бұрын
Where can I get de source code. Thank you
@JohnLauerGplus
@JohnLauerGplus 3 жыл бұрын
It's built into the NodeMCU ESP32 firmware now. Just make sure when you build the firmware you include the pulsecnt module.
@aragornale
@aragornale 3 жыл бұрын
@@JohnLauerGplus Thanks....i was talking abaout the source code. But i have watched in youtube smartphone, it doesnt show the links for github. Now i´m have seen in normal machine, and found the github source code in comments. Thanks again.
#328 ESP32 Secrets: Interrupts, and Deep-Sleep under the Hood
18:57
Andreas Spiess
Рет қаралды 175 М.
Prank vs Prank #shorts
00:28
Mr DegrEE
Рет қаралды 10 МЛН
Parenting hacks and gadgets against mosquitoes 🦟👶
00:21
Let's GLOW!
Рет қаралды 13 МЛН
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 20 МЛН
Kids' Guide to Fire Safety: Essential Lessons #shorts
00:34
Fabiosa Animated
Рет қаралды 17 МЛН
Touch Sensor on ESP32
9:32
John Lauer
Рет қаралды 7 М.
Revolutionize Your ESP32 Projects with Live GPIO Pin Monitoring!
8:08
The Last Outpost Workshop
Рет қаралды 166 М.
Tech Note 071 - ESP32 Digital to Analogue Converter
4:00
G6EJD - David
Рет қаралды 17 М.
Program Animated GIFs on your ESP32 OLED
9:41
John Lauer
Рет қаралды 16 М.
DIY Robot Part 2: Link 1 and 2
8:12
Pfuscher666
Рет қаралды 812
12 Useful & Interesting ESP32 Projects for Beginners!
9:41
ToP Projects Compilation
Рет қаралды 613 М.
ESP32 Wireless Joystick for ChiliPeppr
11:48
John Lauer
Рет қаралды 13 М.
Prank vs Prank #shorts
00:28
Mr DegrEE
Рет қаралды 10 МЛН