Component that can read the state of a wire? - Page 1
Forum section: electronics / projects

author: Stonent
author_rank: Super Contributor
timestamp: April 20, 2013, 11:30:57 am
content: I'm curious if there's a component that would work similar to this.I'm just making up pin numbers just to make it easier to follow.Pins:1. Gnd2. VCC3. Probe4. Pin goes high if probe reads +V, low if anything else.5. Pin goes high if probe reads Gnd, low if anything else.6. Pin goes high if probe reads -V, low if anything else.7. Pin goes high if probe reads nothing at all or N/C.Is there anything similar to that out there?If so, is there an all-in-one component that can take multiple probes?

author: Psi
author_rank: Super Contributor
timestamp: April 20, 2013, 11:54:10 am
content: I've not seen any chips that do that.For it to detect negative voltage it would need a negative supply rail.It cant detect nothing or not connected because there is no such voltage to signify it.There will always be a voltage on the pin even when floating.In order to detect something connected you would need some sort of weak pullup/pulldown and whatever you did it would be the same as one of the other 3 conditions, +V -V or GND

author: SeanB
author_rank: Super Contributor
timestamp: April 20, 2013, 12:24:31 pm
content: Window comparators, along with a high value resistor to a voltage not one of the set levels to detect open circuit. Can be done with a quad comparator and a few resistors, along with some logic at the output, but will not be a single device unless you are willing to integrate it all into an analogue ASIC.

author: Rerouter
author_rank: Super Contributor
timestamp: April 20, 2013, 12:37:35 pm
content: Edit: you can do all but the open circuit discreetly,http://bit.ly/10pmhuNnow its no magic single component, its a few discrete's but it leaves you a 0.5v window, + or - and should trigger very close to ground,i assumed a 5V supply here, for gnd and - a different voltage would require different zeners,the problem with low if otherwise may be a little tricky,Edit2:got it, using an xor chip... (5 = [gnd xor -] xor +, 7 = gnd xor +)

author: Stonent
author_rank: Super Contributor
timestamp: April 20, 2013, 02:33:29 pm
content: I got the idea from a code my car gets about 1 or 2 times a month. That a particular sensor throws a code that means high or open circuit.It was part of a circuit that actuates flow control in the intake manifold at high rpm.But also thought of applications on this for testing cables in a live system.

author: hlavac
author_rank: Frequent Contributor
timestamp: April 23, 2013, 07:41:07 pm
content: Are these DC voltages?If I were doing this I would probably use tiny microcontroller like attiny or pic10f/12f, connect a small cap between ground and a gpio pin of it and a 56kish resistor from pin to the probe.Then I would play tricks with software charging the cap to vcc and gnd (by making the pin output and high/low for some time), then look if the cap is getting charged/discharged to the opposite level thru the resistor and how long it took.You can calculate the voltage on the other end.Gnd is just a voltage that is -vcc from vcc.Open circuit is detected when cap is not moving at both initial charge levels.There you go, 3 components, small enough to put into a pen like probe

author: dr_p
author_rank: Frequent Contributor
timestamp: April 23, 2013, 09:28:54 pm
content: I made something similar, but without the negative probing.A micro has pin 1 as input (with series R for some protection). Pin 2 is feeding through a resistor, back to pin 1. It's effectively pulling up/down the pin 1. If Pin 1 follows both pulls, it's not connected to anything. If it always reads high or low, no matter how it's pulled, than it really is high or low.On top of that I added an amber light that lights for some 50ms on every transition. It's useful because a 999ms high and 1ms low would otherwise look like permanently high.Code:/* AMA-013 = logic probe ** ** Processor = 12F509 ** ** Compiler= CCSC */#include <12f509.h>#define LED_HIGH PIN_B2#define LED_LOW PIN_B0#define LED_PULSE PIN_B1#define PROBE PIN_B4#define PULL PIN_B5#fuses NOMCLR, NOPROTECT, NOWDT, INTRC#use delay (clock=4000000)volatile unsigned int1 pulse_sent=0;unsigned int8 last_state=2;void main(){setup_timer_0(RTCC_INTERNAL | RTCC_DIV_256);while(TRUE){output_high(PULL); //pull UPif(input(PROBE)) //did it go UP?{output_low(PULL); //pull DOWNif(~input(PROBE)) //did it go DOWN?{output_low(LED_LOW); //then it means it's HIGH IMPEDANCEoutput_low(LED_HIGH);if(pulse_sent==1 && get_timer0()==255) //LED_PULSE was ON enough{output_low(LED_PULSE);pulse_sent=0;}last_state=2; //remember last state was HIGH IMPEDANCE}else{output_low(LED_LOW); //then it means it's HIGHoutput_high(LED_HIGH);if((last_state<1 || last_state>1) && (pulse_sent==0)) //if last state was different and has not pulsed yet{set_timer0(0);output_high(LED_PULSE);pulse_sent=1;}if(pulse_sent==1 && get_timer0()==255){output_low(LED_PULSE);pulse_sent=0;}last_state=1; //remember last state was HIGH}}else{output_high(LED_LOW); //then it means it's LOWoutput_low(LED_HIGH);if((last_state>0) && (pulse_sent==0)) //if last state was different and has not pulsed yet{set_timer0(0);output_high(LED_PULSE);pulse_sent=1;}if(pulse_sent==1 && get_timer0()==255){output_low(LED_PULSE);pulse_sent=0;}last_state=0; //remember last state was LOW}}}

author: NiHaoMike
author_rank: Super Contributor
timestamp: April 24, 2013, 02:06:48 am
content: Quote from: Psi on April 20, 2013, 11:54:10 amThere are ways to detect negative voltage without a negative supply.

author: Ghydda
author_rank: Regular Contributor
timestamp: May 02, 2013, 10:56:59 am
content: Quote from: NiHaoMike on April 24, 2013, 02:06:48 amIndeed