Browse Groups

• ## Re: Analog ports and using switches

(6)
• NextPrevious
• The reason it doesn t go to zero is the resistance of the switch. The switch and the pull-up resistor form a voltage divider circuit. When the switch is
Message 1 of 6 , Dec 23 6:06 PM
View Source
The reason it doesn't go to zero is the resistance of the switch. The switch and the pull-up resistor form a voltage divider circuit. When the switch is closed the voltage of the signal is the voltage measured between the pull-up resistor and the switch.

When there is nothing driving the signal, such as a pull-up resistor, its voltage will float to an unspecified value. The exact voltage depends on minor details of the circuitry. There are small differences in how the analog ports are implemented on the two boards which results in the unspecified behavior being different.

The RidgeSoft Team

--- In intellibrain@yahoogroups.com, "njhsarobot" <njhsarobot@y...> wrote:
>
> Worked fine. Interesting 1023 is 1023 but 0 is 15. Any idea why?
>
> Why do the expansion ports need to a pullup resistor and the ones on
> the main board don't?
>
> Thanks,
> Howie
>
>
> --- In intellibrain@yahoogroups.com, "RidgeSoft" rs1@r... wrote:
> >
> >
> > Are you enabling the pull-up resistor?
> >
> > input.setPullUp(true);
> >
> > When you use a switch you need to use a pull-up to pull the pin to
> the high voltage when the switch is open. The switch should be
> connected between siganl and ground.
> >
> > The RidgeSoftTeam
> >
> >
> > --- In intellibrain@yahoogroups.com, "njhsarobot" njhsarobot@y...
> wrote:
> > >
> > > I attached a switch to Analog 7 and as I expected got a value of 0 or
> > > 1023. When I attached the switch to Analog 15 I got a value of 0 or
> > > between 200 and 300. Why is it not 1023 like on 7? Is it because it
> > > is being switched?
> > > Thanls
> > >
> >
>
• We are using a different configuration for on/off switches: the switch is between the signal and +5V, and there is a pull-down resistor between the signal and
Message 2 of 6 , Jan 6, 2006
View Source
We are using a different configuration for on/off switches: the switch
is between the signal and +5V, and there is a pull-down resistor
between the signal and the ground. Of course in this case we don't
enable the pull-up resistor by software. Are there any disadvantages
in using the pull-down configuration?

Thanks

Carlos
• Carlos, The way you have connected the switches is reasonable provided you are drawing the +5V from the IntelliBrain board. The microcontroller chip can be
Message 3 of 6 , Jan 7, 2006
View Source
Carlos,

The way you have connected the switches is reasonable provided you are drawing the +5V from the IntelliBrain board. The microcontroller chip can be damaged if a signal pin is driven by an external +5V source that is actually at a slightly higher voltage than the IntelliBrain's +5V power. If you are drawing power from the port's power pin there shouldn't be a problem.

One advantage of using the internal pull-up is you don't need the external resistor, you can simply connect the swtich to the signal and ground pins.

The RidgeSoft Team

--- In intellibrain@yahoogroups.com, "cacarreto" <ccarreto@i...> wrote:
>
> We are using a different configuration for on/off switches: the switch
> is between the signal and +5V, and there is a pull-down resistor
> between the signal and the ground. Of course in this case we don't
> enable the pull-up resistor by software. Are there any disadvantages
> in using the pull-down configuration?
>
> Thanks
>
> Carlos
>
Your message has been successfully submitted and would be delivered to recipients shortly.
• Changes have not been saved
Press OK to abandon changes or Cancel to continue editing
• Your browser is not supported
Kindly note that Groups does not support 7.0 or earlier versions of Internet Explorer. We recommend upgrading to the latest Internet Explorer, Google Chrome, or Firefox. If you are using IE 9 or later, make sure you turn off Compatibility View.