SPI distance

Discussion in 'Embedded Systems and Microcontrollers' started by Shagas, Sep 16, 2013.

  1. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    Hello


    I am making a project which is going to have to be functional on a small musical stage so there will be audio and power cables lying around . There will also be a strobe light.

    I am going to need to communicate one Pillar on the left side of the stage with the right Pillar on the right side of the stage with SPI. The distance will be about 3-4 meters .
    The communication will be sent from the master to the slave only with no feedback.

    Would 3-4 meters be ok for SPI?
    Would it be better if I used a slower clock for the SPI?
    Would it improve noise shielding if I used RCA or even shielded Mono jack audio cables to transmitt the SPI signal?
     
  2. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,132
    267
    SPI would work if you sent it via differential line driver/receiver over twisted pairs, properly terminated.

    Single-ended TTL will be a nasty unreliable mess.
     
  3. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    So how would I do that? If I used an inverter to generate the mirror of the signal and then sent the signal and the mirror with a shielded cable and on the transmitter side used a differential op amp configuration would that be okay?
     
  4. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    I've decided to scrap the SPI transmittion and use an electret mic on each pillar for independent functionality simply due to lack of time for testing and building this because my deadline is on Friday .

    Having said that , i'm still interested in how I could go around this problem for the future when I'm going to have to deal with it so if anyone has any feedback i'll be glad to listen.
     
  5. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    Actually the tables have turned again , I'll probably need to use the SPI for communication :)
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,178
    1,799
    Google RS-485 transceivers. Use twisted pair cables and 120 terminating resistors.
     
  7. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    There is a slight change of plan .
    What I'm actually going to do is keep the SPI transmittion on one PCB .
    The spi will transmitt to 4 shift registers out of which 2 of the registers (16 outputs) will go to bases of transistors controlling Leds which will be 3-4 meters away from the Pcb.
    The shift register to transistor base will be done by a 16 wire bus . That should be resistant to noise right?

    In case I decided to use the RS-485 could you give me a quick overview? ,
    So I just connect say 3 of these MAX485CPA to a single 5volt supply and just input each spi wire into each and have 3 of them as recievers? Or is there any additional circuitry that I will have to build?
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,178
    1,799
    You can use transceivers as transmitters or receivers or both. That way you only have to learn one part instead of separate parts. You have the essential idea.
     
  9. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    Thanks for the info Papabravo .

    What I'd usually do is learn what you guys advised ( in this case the rs-484 ) and apply it but in this case I'm really constrained by component inavailability and time so as much as I don't like to do this , I have to cut some corners.

    What do you think about my last suggestion?
    "if I keep everything on one PCB and just send a bus of 16 wires out of the shift register into the bases of the transistors 4 meters away will I still get a noisy signal?
    Also let me redefine noise . For me in this case noise would be anything higher than say....300mV since the minuscule flicker of the leds will not even be seen.
    The refresh rate will be about 100hz
     
  10. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,132
    267
    Keep in mind that the chip OUTPUTS can also pick up glitches- especially when there are flip-flops involved- (shift registers) I would buffer the outputs of the shift registers with some line drivers. The base of the transistors should have a resistor to GND, so it takes about 2V at the input to turn them on.
     
    Last edited: Sep 16, 2013
  11. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Why are you putting transistors 4 meters away with the LEDs?

    Just drive the LEDs directly on each channel. More current = less sensitivity to noise.

    At most you just need a heavier return wire.
     
  12. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    Thanks for the info Sensacell .

    ErnieM:

    The second pillar is going to be on the other side of the stage and I'm going to have rows of 6 leds so I need a transistor to power each row
     
  13. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    I get that. My point is as long as you are sending each it's own turn on signal just send them all their power on current. Control them all from one side of the stage. The remote box is just LEDs and wires. Local box does all control.

    Can't get simper then that.
     
  14. Shagas

    Thread Starter Active Member

    May 13, 2013
    802
    74
    Thanks for your input , Ernie . I'll consider it.
     
Loading...