I need to build a current switch that will be connected to an Arduino (or Raspberry Pi) digital input. I need it to set to HIGH (3.3 V) if the current is above some threshold, and LOW otherwise. The threshold ideally should be around 1 mA, but 10 mA is also OK. The maximal current is about 2A.
I understand that I can use a Hall effect sensor such as ACS712, then some ADC (or use Arduino's built-in ADC), and add some capacitor to keep the state between AC pulses (or do it programmatically). However, even the 5 A version of ACS712 has 185 mV/A sensitivity, that is even 10 mA current will result in 1.85 mV ACS712 output. I'm afraid this will be below the noise level.
Are there any better approaches to this?