Thursday, 22 February 2018

PC-case notification screen: Part 2, mounts and wiring

In the last post, I configured a Raspberry Pi to receive stats from my desktop PC and display them on a small LCD from a car reversing camera kit.

The next stage is to turn this into a much neater setup to integrate it into my desktop PCs case.

Mounting
The Raspberry Pi quite a popular format, so there's plenty of cases on Thingiverse to choose from - no need to reinvent the wheel. I went with this tray design, as it was the easiest to adapt.

The front of my PC case has several mounting points for an array of fans, so all that was necessary was to create a way of joining the Pi Tray to them.
A simple 'X' shaped bracket in OpenSCAD is all that was needed. It would be easy enough to join this to the model for the Pi Tray, but I ended up printing them separately and gluing them together.




I used the same design as the basis of the mount for the display.
Out of the box it has it's own small stand to attach to a dashboard, with a screw pivot for tilting the display. My idea was to simply remove the stand part and use the same mounting point.





The Pi attached to it's completed mount

The mount for the screen. As you can see, it makes use of the existing stand mounts


Wiring

Note: The 12V line is typically the yellow line,
it just so happens on the connector I found was non-standard.

The LCD runs of 12 volts. This is nice and easy to deal with - Molex connector straight to the power supply. This was just a case of joining the connector for the display to the Molex.


The Pi requires 5 volts, and there's 2 options on how to provide this - Also on the Molex, or via USB. There's pros and cons to both methods.
  • Going the Molex route is more straightforward - it can use the same connector as the LCD, so wiring will be neater, but on the downside, when the desktop is powered off, the power to the Pi will be cut. This runs the risk of corruption of the SD card.
  • Going the USB route means more wiring and a separate power lead, but has the advantage that my desktops motherboard still powers USB devices when powered down, therefore the Pi can remain on.
I opted to go for the USB option. There's spare USB headers on the motherboard, so I needed to make an adapter to use those.


Starting with a short USB extension cable, I removed the socket and split out the wires.


Then using a header lead pulled from an old PCs front panel, remove the header connector. Then it's just a case of matching up the pins and joining them together.


The adapter without the 3D printed cover (top),
and the finished adapter (bottom).
Each motherboard adapter can support 2 ports, so I left the remaining wires outside (just heat-shrinked for safety), so they're available if I decide to add another internal port later.

The Pi is connected to this using a console cable. This is a USB cable with 4 output pins - 5V, ground, TX and RX, and connects directly to the GPIO of the Pi.

It's not recommended to use the 5V GPIO pin for power as it lacks some of the control circuitry that the usual power socket has, but has the power is coming from a regulated USB socket, it should be fine in this case.

The console cable also takes care of the level conversion of the 5v levels to Pi-safe 3.3v, and appears to the PC as a USB-serial adapter.

Finally, all that's left is to connect the display to the Raspberry Pi. Both the display and the Pi have Composite sockets, so I removed the socket from the display and replaced it with a plug.

SCAD code for the mount
As this is really quite a niche thing I'm not going to put the files on Thingiverse, but here's the OpenSCAD code in case it's useful to anyone.

// Just comment out the one you don't want
piMount();
screenMount();

// Couldn't be bothered to do the conversion...
function inches(x=1) = x*25.4;

module piMount() {
  difference() {
    cube([inches(4.5),inches(2.75),inches(0.125)], center=true);
    translate([inches(-2.0625),inches(-1.125),0]) { screwholes();}    
    translate([55,0,0]) {cylinder(inches(0.75),inches(0.8),inches(0.8), center=true);}    
    translate([-55,0,0]) {cylinder(inches(0.75),inches(0.8),inches(0.8), center=true);}
    translate([0,40,0]) {cylinder(inches(0.75),inches(1),inches(1), center=true);}
    translate([0,-40,0]) {cylinder(inches(0.75),inches(1),inches(1), center=true);}
  }
}

module screenMount() {
  difference() {
    cube([inches(4.5),inches(2.75),inches(0.5)], center=true);
    translate([inches(-2.0625),inches(-1.125),0]) { screwholes();}    
    
    cube([1.125*25.4,12.7,50], center=true);
    rotate([0,90,0]) {cylinder(5*25.4,0.125*25.4,0.125*25.4,true);}

    translate([55,0,0]) {cylinder(inches(0.75),inches(0.8),inches(0.8), center=true);}    
    translate([-55,0,0]) {cylinder(inches(0.75),inches(0.8),inches(0.8), center=true);}
    translate([0,40,0]) {cylinder(inches(0.75),inches(1),inches(1), center=true);}
    translate([0,-40,0]) {cylinder(inches(0.75),inches(1),inches(1), center=true);}
  }
}

module screwholes() {
  cylinder(inches(5),inches(0.125),inches(0.125),true);
  translate([inches(4.125),0,0]) {cylinder(inches(5),inches(0.125),inches(0.125),true);}
  translate([0,inches(2.25),0]) {cylinder(inches(5),inches(0.125),inches(0.125),true);}
  translate([inches(4.125),inches(2.25),0]) {cylinder(inches(5),inches(0.125),inches(0.125),true);}
}

The basic wrapper around the USB connector
difference() {
    cube([15,40,9], true);
    translate([0,7,0]) {cube([13,27,7], true);}
    cube([9,45,7], true);
    translate([0,0,5]) {cube([20,50,10], true);}
}

No comments:

Post a comment