Shop OBEX P1 Docs P2 Docs Learn Events
Using SX pins for the +5 and ground of a sensor — Parallax Forums

Using SX pins for the +5 and ground of a sensor

John KauffmanJohn Kauffman Posts: 653
edited 2008-05-07 18:21 in General Discussion
I'm using a Memsic accelerometer (Parallax part #28017) and an SX28. The project needs to be small, so I am building it around a couple of DIP sockets strapped to a 9 volt battery.

I recall from another project on a forum that if the current demands were not too high, the SX pins could be used as the Vdd and VSS for the sensor. Then SX can then turn on the sensor only when needed.

The SX datasheet says SX pins source/sink 45 mA. Memsic sensor datasheet says it uses less then 5 mA.

The question is how to actually wire and code it.
- Do I set the sensor pin +5 to RC.1 and sensor ground pin to RC.2 and then in code set RC.1 high and RC.2 low?
- Do I need at least one of the sensor pins to go directly to the power supply?
- An additinal sensor pin is supposed to always be low. Can I just wire that to RC.3 & set RC.3 low?

Thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-07 14:01
    1) Connect any sensor ground pins to Vss including sensor pins that are supposed to always be low.

    2) Connect the sensor +5V pin to any available SX I/O pin and set that pin to high when you want the sensor on
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-05-07 15:58
    3) Be sure, when the sensor is disabled via the SX not powering it, that all other SX pins connected to it are either low or tri-stated. This is particularly important if you were to depower the device by pulling the power pin low instead of tri-stating it. Failing this, you could cause a dead short through the sensor's protection diodes, which would likely destroy them and possibly the sensor as well. In any event, it would be safer to disable the sensor by tri-stating the power pin, rather than pulling it low.
  • MikeSMikeS Posts: 131
    edited 2008-05-07 17:17
    Phil,

    How do you put a SX pin in a "high impedance" state?



    Thnx,

    MikeS
  • BeanBean Posts: 8,129
    edited 2008-05-07 17:21
    Mike,
    You make it an INPUT.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com

    ·
  • MikeSMikeS Posts: 131
    edited 2008-05-07 18:21
    Bean,
    As Homer would say,...... "D'oh!" I knew that.
    MikeS
Sign In or Register to comment.