Welcome to the Parallax Discussion Forums, sign-up to participate.

I/O pin(s) and Pull up resistors

Posts: 404
Hello All,

I've always stuck by the book and used the 10 k / 220 ohms combo. Works Great. But my current project (Sensor with 2 relays built in) is having me layout/think about my PCB differently. So far in my mind it is not working.

Short of testing and maybe blowing out some I/O pins to figure it out. How would/does and I/O pin respond without the 10 K resistor bypassed and only the 220 ohms resistor receiving the 5 VDC to I/O pin? I know it there for protection, but a constant 5 VDD may be to much....don't know. I've gone through the section in "Whats a MC" and other locations but can't find anything directly related. MY original concept still may not work but this will be a learning curve getting me their.

1) Can a Parallax BS2 family handle VDD on a I/O pin with ONLY a 220 ohm resistor in place?

• Posts: 8,251
Short answer is yes. The 220 ohm series resistor is there to protect the pin from program errors. If the pin was connected directly to +5V or GND and made an output it may be damaged if it was low and connected to +5 or high and connected to GND.
In science there is no authority. There is only experiment.
Life is unpredictable. Eat dessert first.
• Posts: 2,176
edited 2017-05-15 - 20:51:58
hmlittle59 wrote: »
1) Can a Parallax BS2 family handle VDD on a I/O pin with ONLY a 220 ohm resistor in place?

My take on this is that the BS2 is a 5V microcontroller, and the pins in theory can handle five volts, the 220 ohm resistor is for current limiting, and the 10k is to keep the pin floating between states.
• Posts: 2,176
Here is some important info to know about the BS2.
• Posts: 22,363
MikeDYur wrote:
... and the 10k is to keep the pin floating between states.
The 10k pull-up is to keep the pin from floating between states. IOW, when the pin is not being driven internally or externally, the resistor will hold it at 5V. As long as the pin is being driven one way or another, you can omit the pull-up.

-Phil
Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
• Posts: 2,176
The 10k pull-up is to keep the pin from floating between states. IOW, when the pin is not being driven internally or externally, the resistor will hold it at 5V. As long as the pin is being driven one way or another, you can omit the pull-up.

-Phil

Yes my fault, you want the pin to be one state or the other, not oscillating between the two.
• Posts: 404
Thanks to All for the clarification.

I guess that I will have to use a Current Comparator after all. Gonna have to make two more chips fit.

Thanks again
• Posts: 19,469
A current comparator? Gotta see that.

If you share more details about what you're trying to do, someone will probably have a workable solution for you.

Yes, I speak in rhyme, all the time.
"When you make a thing, a thing that is new, it is so complicated making it that it is bound to be ugly. But those that make it after you, they don’t have to worry about making it. And they can make it pretty, and so everybody can like it when others make it after you."

- Pablo Picasso
• Posts: 8,251
erco wrote: »
A current comparator? Gotta see that.

If you share more details about what you're trying to do, someone will probably have a workable solution for you.

Yes, I speak in rhyme, all the time.

You are the man. The rhyming robotocist and poetic propellerist.
In science there is no authority. There is only experiment.
Life is unpredictable. Eat dessert first.
• Posts: 2,677
Q: what rhymes on Propeller?
A: no, it doesn't.

Enjoy!

Mike
I am just another Code Monkey.
A determined coder can write COBOL programs in any language. -- Author unknown.
Press any key to continue, any other key to quit

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
• Posts: 404
edited 2017-05-30 - 04:24:07
Update:
Have to pick up new parts from Fry's tomorrow (NTE 941 and 938), suppose to be in stock. Ordered LM358 from Parallax along with other parts today also.

One (1) question for now. Does best the LM741 best operate from a Single or Dual supply voltage? Could not to get it working like I wanted today. Using the BS2 BOE for my test bed.

Thanks
• Posts: 404
Update:
Forgot to attach Schematic. Not ALL values are current, kept changing them when things did not go as planned, but the layout is still the same.

Basically trying to detect when the 10k resistor is bypassed by the K1 relay. K2 will remove the 5 V source and both I/O pins will be Zero (0). It's the voltage change across the 4.7 k resistor into the OpAmp that I want to detect.

Thanks again
• Posts: 22,363
edited 2017-05-30 - 04:33:44
The LM741 is such an old design and requires at least a +/-10V power supply. If you really want to operate from a single 5V supply, the LM358 would be a better option. Better still, check out one of the newer CMOS op amps with rail-to-rail inputs and outputs.

In short the LM741 belongs in a museum, not in a new design.

-Phil
Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
• Posts: 404
Thanks Phil

On my way to Frys to see what they have. Parts are on order from Parallax and Mouser.
Wasted a day of my life trying to get the LM741 to work like I wanted

Thanks again
• Posts: 404
Update:

Thanks Phil for the info and insight on new better parts. I did get 3 different types from Fry's this morning (NTE 889M, 938M, and 922M). The 889M is up and running with a .5v loss differential, hope that's normal. Haven't found on the data sheet if thats normal or not. Will test the other parts here soon. Had to make one layout change and 3 resistor values to ensure all voltage variations are detected, so far they are working.
Test program detect all 3 variations on the 2 I/O pins also.

Thanks again