Low-cost resistance measurement with accuracy