This is a Raspberry Pi Pico MicroPython module for the Honeywell FMA Microforce series force sensors using SPI interface
from machine import SPI, Pin
from microforce_spi import MicroForceSensor
import time
spi = SPI(0, 100000, sck=Pin(2), miso=Pin(4))
fma1 = MicroForceSensor(
#pico spi pins
spi, cs = 5,
#25N
force_range = 25,
#20% -> 80%, see sensor datasheet
transfer_func = 'C')
fma1.zero()
while 1:
status, force, temp = fma1.read()
print("Status: " + status + ", Force: " + str(force) + " N, Temp: " + str(temp) + " °C")
time.sleep(0.1)
By default, Pico SPI instance 0 is used, however this can be changed in the constructor along with the MISO, SCK, and CS pins.
To help with evaluation, I designed a simple breakout in KiCad that supports all variants of the FMA series. See the repo for design files and ordering info.
- Clone repo to a folder of your choice
- Copy the "microforce_spi.py" file to your Pico
- Copy one of the example scripts or create your own following the example usage shown above
- Enjoy! :)
MKE supports the open source hardware community by sharing hardware design files freely on GitHub!
Please support MKE by purchasing products on Tindie!
Designed by Mike Kushnerik (miekush)
Licensed under Creative Commons Attribution-ShareAlike CC BY-SA 4.0
All text above must be included in any redistribution!