• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Counting Reed Switch Sensor triggers

Q&A Forum › Category: ESP32 › Counting Reed Switch Sensor triggers
0 Vote Up Vote Down
alex soriano asked 3 years ago

I am working on a project involving a reed switch sensor attached to a motor.  I’d like to be able to count the rotation of the motor.  Can someone share a micropython script for ESP8266/ESP32 to do this? Thanks in advance. 

Question Tags: Reed Switch Sensor
4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Alex.
I don’t know exactly the setup of your project, but I guess the reed switch activates when the motor completes a turn?
Is that it?
If not, can you better explain your project so that I can help you better?
Regards,
sara

0 Vote Up Vote Down
alex soriano answered 3 years ago

Yes.  I’d like to be able to count the number of times the magnet on the motor triggers the reed switch sensor every time it passes it when it completes 1 rotation. It looks like there is an API but I do not see anything on micropython. http://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/pcnt.html#pcnt-api-configuration

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
I found this: https://micropython-tve.readthedocs.io/en/counter/library/machine.Counter.html

https://github.com/tve/mpy-lib/tree/master/esp32-counter

See if you can implement.
Regards,
Sara

0 Vote Up Vote Down
alex soriano answered 3 years ago

Thanks for the advice. 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.