Python/Raspberry Circuit Continuity/Resistance tester
Posted: Sat Apr 16, 2016 2:40 pm
Hi all, probably 10 year ago while shopping at maplins i spoke to an electrician who had with him a resistor tester that he had made, it was hard wired just using raw components(maybe a pic chip) and was amazing!, telling the resistance of any resistive device attached to its contacts.. i know a multimeter would tell the same but he had built that himself.
i always wanted to build one but could never figure out how, now ive used python a few times im thinking there must be a way to build a multimeter type device but am struggling to find any code examples to start with or build from.
after alot of research it seems id be able to use a mcp3008 analog to digital converter, id hope to run 3.3/5v through the resistive device then measure the volts at the opposite side to determine the drop in voltage, then id hope to work out the resistance based from the voltage drop but am not sure of the math for this.
I believe i would also need to know the current of the circuit (i presume this would change depending on whats connected) to be able to work out the resistance? could i use an additional device attached to raspberry to work out current(if the calculation would require current)?
would be great if anybody is able to shed some light on this or point me in the right direction.
id like to be able to use it to test the resistance of anything from a 0.25w resistor to a 3phase motor.
ive since found some code for a LDR that i will start with, i suppose in simpler terms im trying to work out a ohms reading based from this volts read returned from the mcp3008
i always wanted to build one but could never figure out how, now ive used python a few times im thinking there must be a way to build a multimeter type device but am struggling to find any code examples to start with or build from.
after alot of research it seems id be able to use a mcp3008 analog to digital converter, id hope to run 3.3/5v through the resistive device then measure the volts at the opposite side to determine the drop in voltage, then id hope to work out the resistance based from the voltage drop but am not sure of the math for this.
I believe i would also need to know the current of the circuit (i presume this would change depending on whats connected) to be able to work out the resistance? could i use an additional device attached to raspberry to work out current(if the calculation would require current)?
would be great if anybody is able to shed some light on this or point me in the right direction.
id like to be able to use it to test the resistance of anything from a 0.25w resistor to a 3phase motor.
ive since found some code for a LDR that i will start with, i suppose in simpler terms im trying to work out a ohms reading based from this volts read returned from the mcp3008
Code: Select all
def ReadChannel(channel):
adc = spi.xfer2([1,(8+channel)<<4,0])
data = ((adc[1]&3) << 8) + adc[2]
return data
def ConvertVolts(data,places):
volts = (data * 3.3) / float(1023)
volts = round(volts,places)
return volts