40 pin extension cable

Hello. My project I have left my lcd shield on the arduino in the project box. I want to mount the lcd on the wall and it looks like I am going to need at least 4 feet of a 40 pin cable. Does anyone know anyone that sources this or am I stuck buying the ribbon and connector. Also I am only seeing long spools of 40pin ribbon on ebay from hong kong and I really don't want to set my project back two weeks waiting for delivery. Does anyone know a store that sells both in the US?

Clamp-on IDC connectors & ribon cable.
http://www.king-cart.com/phoenixent/product=WIRE+%2526+CABLE+-+BULK/exact_match=exact
http://www.king-cart.com/phoenixent/product=RECEPTACLES-SOCKETS+IDC+.1SP+%2526+2MM+SP/exact_match=exact
to go on 2x20 male pins.
Other options also available.

Hi and welcome.

I can't answer your question.
But it seems you are assuming that it will still work after extending the connection from 0.0 cm to 121.9 cm .
That is quite an assumption.
So let me warn you that you might be in for a surprise.
You might want to test that before you commit to it.

CrossRoads:
www.phoenixent.com

Clamp-on IDC connectors & ribon cable.
Phoenix Enterprises product listing WIRE & CABLE - BULK
Phoenix Enterprises product listing RECEPTACLES-SOCKETS IDC .1SP & 2MM SP
to go on 2x20 male pins.
Other options also available.
http://www.phoenixent.com/

That looks good

MAS3:
Hi and welcome.

I can't answer your question.
But it seems you are assuming that it will still work after extending the connection from 0.0 cm to 121.9 cm .
That is quite an assumption.
So let me warn you that you might be in for a surprise.
You might want to test that before you commit to it.

Do you think I will have distance issues?

How fast are the signals you are switching?

Not fast at all, aquarium project. Mostly pumps and relays. Have some sensors though. Most of it will be below the tank thus extending the lcd up top for stats and input.

No, I meant to the LCD.
Parallel data I am guessing, signals driven with
digitalWrite(pinX, HIGH);
etc. type commands?

CrossRoads:
No, I meant to the LCD.
Parallel data I am guessing, signals driven with
digitalWrite(pinX, HIGH);
etc. type commands?

Sorry I am new to this..

That is correct, mostly digitalwrites

Code so far, only like 70% done. Needed to get everything in its home before I finish off. I don't have anything in the menu's there but they will be digitalwrites turning on relays/pumps stuff. Also a schedules setting for timing and another for setting variables co2state, etc.

This is a planted aquarium tank monitor/dosing controller project

plantedtank.ino (11.3 KB)

My remark was made in relation to the display.
You told about a display to be placed to the wall, and the need of a 40 wire cable, not much else.
Thus my conclusion that you need that 40 wire cable for that display.
Such cable in relation to a display excludes a 1602 like display (way too much wires than needed).
I've seen some tft screens that do use a similar cable, so that was what i thought of.
I've also seen multiple problems popping up because people used these displays with a bunch of single wires, which were shorter than the length you are planning to use.

In short: if this 40 wire cable isn't meant to be used for the display, then forget my first post here.

MAS3:
My remark was made in relation to the display.
You told about a display to be paced to the wall, and the need of a 40 wire cable, not much else.
Thus my conclusion that you need that 40 wire cable for that display.
Such cable in relation to a display excludes a 1602 like display (way too much wires than needed).
I've seen some tft screens that do use a similar cable, so that was what i thought of.
I've also seen multiple problems popping up because people used these displays with a bunch of single wires, which were shorter than the length you are planning to use.

In short: if this 40 wire cable isn't meant to be used for the display, then forget my first post here.

Got it, thanks man anyway

Consider using an i2c or spi terminal that reduces the number of wires to 4 (for i2c) or 6 (for spi). With 8 or fewer wires, you can use an 8P8C (RJ-45) connector and use shielded cat 5 or cat 6 cables for the data. You probably don't want to go more than a few feet with normal i2c/spi connections.

If you need longer runs, you probably want to put a microprocessor with the display and send serial data back/forth using RS485 to provide error checking on the 2 serial (RX/TX) lines.

Unfortunately, you have fallen into the oh-so-common "telepathy" trap here.

You know what you are proposing to do, so you have rattled off partial details of the particular concern that comes to mind at that moment, "How do I connect the box to the other bit", quite forgetting that we do not know the rest of it. And you have made what you presume to be fixed decisions without considering all the factors involved.

Rather than indulging in a head-banging exercise regarding how to make do with a possibly bad design decision, I suggest you sit back and carefully describe your proposed layout for a start, and invite suggestions for how it might most practically be implemented. As you seem to have described it, you propose to have a control box containing the Arduino, display and buttons - presumably a display shield like this - to be wall-mounted, cabled to an actual control box containing relays, sensors and other control devices, hidden behind or under an aquarium, and you have determined you will need forty connections from the Arduino (Mega?) to implement this.

And you are in a hurry.

Well, that may actually work out quite well because the relay control wires should not require rapid switching. Analog sensors likewise will not be much of a problem. Digital sensors however, could be.

A good design alternative to using a 40 wire ribbon, would be to put some "smarts" in the control box under the aquarium; one interesting option being another Arduino (if you are using multiple digital sensors). Alternatively, shift registers to control relays - particularly the TPIC6B595 which can directly drive relays or small solenoids - reduce the control wires to three for almost any number of outputs and similarly for digital on-off) inputs, reducing the number of wires in the cable to less then ten (and the required Arduino from a MEGA2560 to a Pro Mini). It is even possible to use I2C interface devices over a metre or so (2 control lines only for both input and output) by slowing the protocol.

If you are set on using a cable, I would suggest using an old IDE/ATA cable if you have some lying around. In my experience these are great for connecting parts of a project to other parts. We used them a lot in Electrical Engineering at school, and Ben Heck also recommends these cables (mostly because they are impossibly cheap, most people have a few of them already, and they do the job).

No further reply from the OP here.

bjonnfesk:
If you are set on using a cable, I would suggest using an old IDE/ATA cable if you have some lying around. In my experience these are great for connecting parts of a project to other parts. We used them a lot in Electrical Engineering at school, and Ben Heck also recommends these cables (mostly because they are impossibly cheap, most people have a few of them already, and they do the job).

Good point - except - that he wants one a metre or more long. :frowning:

Sorry I didn't respond, I stopped receiving notifications so I assumed the thread was dead... Went back to it today because of failed idc cable attempt.

To update, I received my spool of 40pin cable and some heads and was only successful for 24", much like the spec. So I am back to the drawing board for any ideas anyone has. I'll try to lay my project out in a little more detail.

The project is to control a high tech planted aquatic tank. With a high tech planted tank. You give them high lights, supplement them with co2 and that get yourself in a fertilizer dosing schedule. This needs to be automated. So essentially this thing is a co2 controller, (you can get the co2/airlevel based upon ph level), a temperature controller, an automatic doser, control air being put back and of course schedules for lights, moonlights, air stone and such. - Project will in the future have, weight sensors for ferts bottles/co2 tank and a water level indicator.

I have the hardware working, soldered it into a board, spent the past week making a touchscreen driven system that I can manipulate all the variables and scheduling /such.

Hardware I am using:
Mega 2650
Sainsmart 3.2" touchscreen
TFT LCD MEga sheild.
ds1307
atlast ph stamp
DS18B20 weather proof temp.
Sainsmart 8 channel relay
3 12v dosing pumps connected by 3 tip120 transistors
sd card - not hooked up yet but will store these massive amounts of variables for scheduling right now just in memory/ on power failure

Right now I have all the circuit soldered in. The 8 channel relay's are in another box. I have then have the circuit soldered into the tft shield and the lcd on top of that. I originally designed it so I could have the LCD above the tank so I can see stats and manipulate the menu. I can see I am need of a redesign and or solution to move the lcd away from the bottom of the tank.

If you still can't grap what this does, here is a quick video of my code for the menu's. I spent a bit of time on this so I would at least like to keep using the touchscreen... Its like 90% done and the only hardware I have connected for this video is one dosing pump. But you can get a grasp of what I am doing.

MichaelMeissner:
Consider using an i2c or spi terminal that reduces the number of wires to 4 (for i2c) or 6 (for spi). With 8 or fewer wires, you can use an 8P8C (RJ-45) connector and use shielded cat 5 or cat 6 cables for the data. You probably don't want to go more than a few feet with normal i2c/spi connections.

If you need longer runs, you probably want to put a microprocessor with the display and send serial data back/forth using RS485 to provide error checking on the 2 serial (RX/TX) lines.

Maybe my board will interest you, it's an arduino with PoE and RS485.

https://www.kickstarter.com/projects/1370454848/chainduino