VCC/Ground Pulldown For Sensor, How?

Hello All,

Need some basic help; I have an component that behaves differently depending on whether one of its pins is pulled to ground or given +5V. I'm toying with a digital pin on the arduino, the arduino common ground (that the device is grounded to as well) and the device pin. I can't for the life of me figure out how pull this off with just my arduino and a couple of resistors.

Any tips would be appreciated.

Hi, We need a bit more information.
What is this component that behaves differently and what pin is it?

I have a pin for a Maxbotix Rangefinder, that when pulled to ground will tell the rangefinder to stop sending signals. When given this pin is given ~5 VCC the Rangefinder starts again.

I want to control this pin with a digital pin from my arduino.

What is the best arrangment to allow the pin to easily pull to ground, but to also access the 5 VCC when the I write the digital pin on the arduino high?

Thanks.

Simply wire this up to an arduino pin, no resistors involved.

Set the pin as an output in the software and write to it HIGH or LOW to change it from +5V to ground.

Thanks Grump_Mike,

I hadn't been writing the pin as an output in the software. However this brings up another question; if I call all my digital pins outputs, and write them all as low, my RX pin (0) and my TX pin (1) are still high. Could this be because I am plugged into a computer?

Thanks again.

jabrooks:

Could this be because I am plugged into a computer?

Indirectly. The answer is in section 13.3.3 of the datasheet. The Arduino uses the USART to communicate with your computer when serial communication is initiated by the Serial.begin() function. When the USART is initiated the Rx and Tx pins are no longer configured as normal I/O pins and the pinMode() and digitalWrite() commands won't have any effect on those pins.

Don

Using pins 0 and 1 is tricky because it uses the pins normally used to communicate along the serial port. These lines are connected to the USB / Serial chip through resistors so it is possible to pull them high or low. However you will have to disable the serial mode that the software defaults to before they will respond to a simple digitalWrite(). It is best if these pins are left unused unless you are operating in a stand alone mode because things attached to them can hamper the downloading of of sketches.