How to set "Reference Voltage" to raise an Interrupt from External Sensor

Discussion related to "under the hood" OpenMV topics.
User avatar
Raj
Posts: 21
Joined: Wed Jun 05, 2019 2:14 am

How to set "Reference Voltage" to raise an Interrupt from External Sensor

Postby Raj » Sun Jun 16, 2019 7:56 am

Hi,

I want to connect an FSR sensor (Force Sensitive Resistor) to H7.
Generally, FSR connects 3.3V, GND (through as Resistor) and any Input PIN (which receives changing voltages from FSR based on the pressure put on the FSR surface).

Pins already in use on my H7:
Pins P4 & P5: Already in use for UART.
Pin P6: Already in use as ADC.
Pin P7: Already in use for signal output.

1.
Which pins (out of the remaining) can I use for obtaining input from the FSR, please?

2.
Voltage Input from FSR varies continuously. How can I set a reference voltage (eg. 1.25V) and obtain an Interrupt ONLY when the voltage from FSR lies above the reference voltage?

I tried to understand the notes written here: https://github.com/openmv/openmv/blob/m ... hal_comp.c
But, being a novice, failed to comprehend how to implement it.

Any help in this regard is highly solicited, please.

PS: Forgive me if such questions are not supposed to be asked on this forum.

Thanks,
Regards.
Govind
User avatar
kwagyeman
Posts: 3338
Joined: Sun May 24, 2015 2:10 pm

Re: How to set "Reference Voltage" to raise an Interrupt from External Sensor

Postby kwagyeman » Sun Jun 16, 2019 8:13 am

Hi, you have to use an external comparator circuit that tests if the voltage is higher than 1.25v. General purpose I/O pins can't be used to measure voltage levels.

You can use any pin that is free for the interrupt from the comparator.
Nyamekye,
User avatar
Raj
Posts: 21
Joined: Wed Jun 05, 2019 2:14 am

Re: How to set "Reference Voltage" to raise an Interrupt from External Sensor

Postby Raj » Sun Jun 16, 2019 5:19 pm

Thanks for the quick guidance.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests