Sharing a nifty trick with ULP coprocessor

PaulNi
Posts: 41
Joined: Tue Nov 07, 2017 3:50 pm

Sharing a nifty trick with ULP coprocessor

Postby PaulNi » Sun Nov 10, 2019 4:09 pm

Hello everyone,

Few years ago, I found out that the internal Hall sensor in esp32 can in fact be used as a limit switch, or coarse rotary position encoder. And the best about that is that it can be read by ULP coprocessor in deep sleep to wake the device up.

You just have to position the esp32 near a magnet on a moving piece that will be used as a switch. Most of the time, it's possible place it on an appliance lid, or any kind of cover the user have to lift/remove to start operating the device. You don't even need a real magnet for it, the material used in fridge magnets or the magnetic rubber used in fridge door gaskets works too, the later can even be overmolded.

In one of "smart furniture" project we had, we managed to place it in a drawer to trigger a security lock in it. Or in a device very similar to Amazon Dash, we had it operated by a sliding cover. That is very useful when you have to have the MCU running, and you can't use simple hardwired limit switch turning off the power.

You can also use it as a very coarse position encoder if you put the magnet on a rotating piece right above the chip, and have the magnet axis perpendicular to the chip. Very useful as a substitute for multiple position rotary switches in devices where the switch changes its operating mode, when the device itself appears "off" to the user. That was handy in some appliance projects. The only downside is that it introduces calibration into the manufacturing process.

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: Sharing a nifty trick with ULP coprocessor

Postby permal » Thu Nov 14, 2019 6:02 pm

I'd press the like-button if there were one :) thanks for sharing.

DerSpatz
Posts: 4
Joined: Thu Sep 13, 2018 8:03 pm

Re: Sharing a nifty trick with ULP coprocessor

Postby DerSpatz » Thu Nov 14, 2019 11:41 pm

Sounds interesting. How coarse is the rotary encoder, in bits?

PaulNi
Posts: 41
Joined: Tue Nov 07, 2017 3:50 pm

Re: Sharing a nifty trick with ULP coprocessor

Postby PaulNi » Sat Nov 16, 2019 11:53 am

DerSpatz wrote:
Thu Nov 14, 2019 11:41 pm
Sounds interesting. How coarse is the rotary encoder, in bits?
Not really suitable as an encode, but more like a position switch. I managed to get 4 positions reliably readable with a neodymium magnet

Who is online

Users browsing this forum: No registered users and 108 guests