Testing a circuit
Dr.No
Posts: 60
I'm using a BS2 to test when a an external circuit is running or not.
The circuit carries 5VDC (+)and is hooked up to the IN1 (pin1) via a 220 resistor
To complete the connection the (-) circuit is grounded to the Vss (Homework board).
Everything works except I'm not picking up any 1s on the IN1 except 0s.
If anyone can give an help, I would greatly appreciate it.
Thanks.
The circuit carries 5VDC (+)and is hooked up to the IN1 (pin1) via a 220 resistor
To complete the connection the (-) circuit is grounded to the Vss (Homework board).
Everything works except I'm not picking up any 1s on the IN1 except 0s.
If anyone can give an help, I would greatly appreciate it.
Thanks.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I had the pin on output!
Which I quickly corrected.
I noticed however (I have a indicator led that lights up when
circuit is on) that the led keeps blinking (low) periodically even
when output pin is set to low. Perhaps LOW means
a very low current?
Anyone knows what's the lowest detectable VOLT for an
input pin?
Thanks again so much.
"LOW" sets the pin to LOW; it does not mean low current.... Depending on what your program looks like and how it terminates can cause a pin set as an output to periodically "blink".
Please post the code that you have so far so that we can positively determine and confirm this behavior.
The voltage threshold is around 1.4 Volts... anything above 1.4 Volts registers as a logic HIGH ("1"), anything below 1.4 Volts registers as a logic LOW ("0").
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Start:
DEBUG "Initializing..."
OUTL =%00000000 'set 7-0 to low
DIRL =%11111111 'set said to output
PAUSE 5000
DEBUG "Running"
INPUT 1
CIRCUITOFF:
LOW 11
PAUSE 500
'During stage1, LED blinks.
stage1: 'Pin 11 is connected to LED
LOW 11 'added to turn off led (LED now only blinks dimly)
IF IN1=1 THEN CIRCUITON
GOTO stage1
CIRCUITON:
HIGH 11 'turn on LED, circuit is running
stage2:
IF IN1=0 THEN CIRCUITOFF
GOTO stage2
Sounds like you need a pull-up or pull-down resistor on your input pin....
Based on this sentence you gave earlier...
"Everything works except I'm not picking up any 1s on the IN1 except 0s."
...It sounds like you need a pull-up resistor on your input
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Thanks.
__________________________________________________________________________
The diodes was my first bet for the voltage drop. I was able to reduce the 5volts to less than 0.5volts
and the stamp was still able to detect it. So, the stamp has a way of picking up
that's it's really 5volts because it can't pickup 1.3volts. My guess it's in the current (ma).
Using 1.3volts without diodes, the stamp did not pick it up.
Someone told me about the 74LS IC family of chip. I haven't found a good link yet and then there's the coil but
all this will probably equate to the same thing as the diodes.
Can anyone please tell me what does a schematic have to do with finding a component that can drop volts?
Stamp won't pick up 1.3 base volt.
If you look at the datasheets for the diodes, you'll probably find that the forward voltage (Vf) drop across the diode depends on the current. At very low currents (like here) it will tend towards 0.6V per diode. 4 x 0.6V = 2.4V. If your supply truly is 5V, that will leave 2.6V at the Stamp pin which the Stamp will see as logic one/high.
This was only a simple diagram for show. I actually used over 25 diodes because no matter how
low the volts was, the stamp was STILL able to pick it up. I used a multimeter from radio shack
because I couldn't believe the stamp was still picking it up. The volt meter reading was 5V at the
battery and < 0.5 volts after the diodes.
25 x 0.6 =15
Moreover, I happen to reverse a single diode to stop the current from flowing at the pin and the stamp
still lit up the LED.
Pin O---/\/\/\/\
|>|
|<|---|<|---|<|---|<|
(+) Battery
The idea was simply to drop the volts low enough so that it can't be detected by the stamp
according to the advertised low point of < 1.4 volts.
The basis for this is from experiments in the What's a microcontroller book
chapter 2 & 3 Lights On Light Off & Digital Input
What's a microcontroller anyway if you cannot use it?
Post Edited (Dr.No) : 8/2/2008 12:26:08 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
(Let's see -- V == I * R, V/R == I, 5 / 10e6 == 0.5 micro-amps)
Yeah, I don't think you can assume a diode has a 0.6 volt drop at 1/2 micro-amp.
What you DO need is a 10K resistor to ground. We call this a "pull-down" resistor. This gives the input pin a 'soft' ground, which should prevent the input pin from reading any RF signal when very little current is running.
Thanks.