Metal Detector to pixhawk

Hi there,
I have a metal detector on a drone with pixhawk. the metal detector produces a 5v signal when a metal is detected, I want to receive a signal in python on ground station using pymavlink.

what are the best ways to get around this problem.

as per my research:

  1. i can use the ADC port
  2. I can use an onbaord computer like raspberry and do all the processing on board instead of ground.

if option 1 is the optimum solution what is the best way to do it.
I do not have a raspberry, so i cannot opt from option 2.

You could use the Analog Fuel level function and a Battery Monitor:
Analog Fuel Level
Or a Lua script. Example:
Analog In Lua