Shop OBEX P1 Docs P2 Docs Learn Events
Receiving Input From a Raspberry Pi 2 (3.3v) — Parallax Forums

Receiving Input From a Raspberry Pi 2 (3.3v)

Hey guys! I'm new here, and new to working with electronics in general, so I apologize in advance if anything I ask sounds ignorant.

I'm trying to work out a basic method of controlling a Boe-Bot with my Pi. I am planning on using the GPIO pins to send voltage to the input pins on the BASIC stamp, but I don't know how to do this without damaging the stamp.

I know that the Pi puts out 3.3v from the pins when they're set to high, and 0v when set to low. My plan was to use 4 different pins and depending on which of them are set to high (which will be detected by the input pins on the stamp) the Boe-Bot will move forward, back, left, or right. My question is, how do I wire this, and do I need to worry about voltage or current (do I need a resistor)? Is it as simple as going straight from the GPIO pin on the Pi to the input pin on the Boe-Bot's board? Do I need to ground anything?

I feel like this is a simple idea, but I don't know how to do it correctly, and I don't want to damage anything.

Once again, sorry if I'm lacking a huge piece of the puzzle here. Let me know if you need more information. Thanks in advance for the help!

Comments

  • ElectrodudeElectrodude Posts: 1,621
    edited 2016-07-26 05:02
    A simple wire should suffice for connecting the 3.3v output of the Pi to the 5v input of the BS2.

    On the other hand, you'll probably want a voltage divider or something if you want to send signals back from the BS2 to the Pi.

    The BOE and the Pi should have their grounds tied together.


    You could use your 4 pins more efficiently. Two could be left wheel forward, back, or stop, and the other two could be right wheen forward, back, or stop - this would allow you to do forward, stationary, and reverse left and right turns, as well as basic forward, back, and stop. Or, you could only have the 4 motions you mentioned and only use 3 pins - an enable, a left wheel direction, and a right wheel direction.
  • LeonLeon Posts: 7,620
    Pi inputs are *very* easily damaged by any over-voltage.
  • Awesome guys thanks for the responses! I'm not going to be sending any data back to the Pi (yet).

    Just to get things straight in my head:
    I can run a wire from a GPIO pin on the pi to one of the inputs on the BOE (P0 for example). And then all I need to do is just run a wire from one of the Pi's ground pins to the ground (Vdd) on the BOE?

    Also, thanks for the idea on how to better used the 4 pins Electrodude! I will probably implement that once I have this up and running!
  • ElectrodudeElectrodude Posts: 1,621
    edited 2016-07-26 18:24
    Vdd is power. Vss is ground. Run a wire from the Pi's ground to the BOE's Vss. You might damage the BS2's input or the Pi's output (the Pi's output will probably lose here) if you connect the Pi's ground to the BOE's Vdd.
  • I totally got it backwards, thanks for catching that! And thanks again for the help!
  • kwinnkwinn Posts: 8,697
    Probably a good idea to put a 10K resistor between the Pi & BS2 I/O pins, otherwise a program bug on either of them could damage the I/O pins.
  • Thanks kwinn, will do!
Sign In or Register to comment.