PDA

View Full Version : Testing a circuit

Dr.No
07-30-2008, 09:49 AM
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.

Franklin
07-30-2008, 10:17 AM

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

Mike Green
07-30-2008, 10:20 AM
Of course the other possibility is that the external circuit is not in fact carrying +5V to the Stamp I/O pin via the 220 Ohm resistor. Have you measured the voltage at pin 1?

Dr.No
07-30-2008, 11:20 AM
Thanks a lot.

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.

Beau Schwabe
07-30-2008, 01:05 PM
Dr.No,

"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 (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Dr.No
07-30-2008, 07:53 PM
' {\$STAMP BS2}

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

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

Beau Schwabe
07-30-2008, 09:30 PM
Dr.No (http://forums.parallax.com/member.php?u=52756),

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 (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Dr.No
07-30-2008, 10:13 PM
Oh, it's working fine now... I just was curious about the dimly lit blinking LED.

Thanks.

Dr.No
08-01-2008, 07:03 AM
This post if from What's Really Going On Here - Voltage Drop - the anomolies of voltage and current. Duplicate post
__________________________________________________ ________________________
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?

Mike Green
08-01-2008, 07:14 AM
There are many ways to decrease the voltage at a particular point in a circuit. Which to choose depends on the circuit its embedded in and how that voltage is to be used. Some ways might work terribly or not at all in a particular circuit, yet work perfectly well in some other circuit. Some ways might damage the parts around them in certain contexts.

Dr.No
08-02-2008, 04:10 AM
Stamp is able to pick up less than 0.5 volt [tested] on input pin with 5.0 base volt.
Stamp won't pick up 1.3 base volt.

Mike Green
08-02-2008, 05:07 AM
I can't tell from your diagram just what's in the area marked "diodes". I assume it's 4 series connected silicon switching diodes with the anodes towards the battery and the cathodes towards the Stamp.

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.

Dr.No
08-02-2008, 07:12 AM
I do not have the tools to draw an accurate diagram. I use the paint program as best as I could.
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

Franklin
08-02-2008, 07:34 AM
A microcontroller is a device which, in the hands of a competent person can do everything within it's design parameters relying on said competent person to decide if those parameters fit their needs.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

PJ Allen
08-02-2008, 07:47 AM
http://i270.photobucket.com/albums/jj118/new_clear_days/circuits/dividers.jpg

allanlane5
08-02-2008, 08:19 AM
The BS2 has an input impedance of about 10 MegOhms. So you're only going to get:

(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.

Dr.No
08-02-2008, 09:04 AM
Ok, I'll try the 10K.

Thanks.