WIRING

APC Australia - - How To » Rasp­berry Pi Master­class -

The older USB 1.0 and 2.0 ca­bles have fewer wires than the newer 3.0: here’s a quick guide

THE BUILD

You should be now have a rea­son­ably good idea of the con­troller that we’ll be work­ing with. ‘The Duke’ has dual joy­sticks, six but­tons, a D-Pad and two trig­gers, and it’s com­pat­i­ble with most retro games sys­tems.

FIT­TING

If you’re us­ing a dif­fer­ent con­troller, dou­ble check that the Pi is likely to fit in­side be­fore you crack it open. As you’ll see here, the Pi nes­tles neatly be­tween the trig­gers of this con­troller — the orig­i­nal Xbox con­troller is one of the largest.

UN­SCREW­ING

The con­troller is held to­gether by half a dozen cross-head screws. Be care­ful when open­ing the case as the but­tons and rub­ber con­tacts are loose within the con­troller — they will spill ev­ery­where!

OPEN­ING

With the shell re­moved, you should be able to undo the screws hold­ing the main cir­cuit board in place. Gen­tly un­clip the con­nec­tors pow­er­ing the vi­bra­tion mo­tors in or­der to com­pletely re­move the board. You might find it eas­ier to use pli­ers for this — just be very gen­tle as you pull!

GEN­TLY DOES IT

You can see for your­self just how well the Pi fits here; it can be squeezed un­der the mem­ory card slot. If you want to hold it firmly in place, use some BluTak as a tem­po­rary so­lu­tion. Also, if you’re us­ing an older con­troller, it’s worth giv­ing it a bit of a clean. Re­move the rub­ber con­tacts and gen­tly swab un­der them us­ing the iso­propyl al­co­hol swabs.

CUT TO FIT

De­pend­ing on the model of con­troller, you may find that the Pi blocks one of the in­ter­nal plas­tic struts. The plas­tic is soft enough that a craft knife will eas­ily cut it down to size, though. Start with small strokes, shav­ing off a tiny bit at a time un­til you have enough room. Make sure the plas­tic dust is cleaned out be­fore you re­assem­ble the con­troller. If you have a can of com­pressed air, you can use it to eas­ily blow away the shav­ings.

CON­NECT­ING IT UP

If you’re us­ing a con­troller that has a reg­u­lar USB port on it, you can just plug it into the Pi via a USB OTG con­verter. If you’re us­ing the orig­i­nal Xbox Con­troller, it’s slightly tricky. Mi­crosoft, in its in­fi­nite wis­dom, has de­cided that the orig­i­nal Xbox should use USB, but with an in­com­pat­i­ble plug de­sign. This means, in or­der to con­nect the con­troller to the Pi, we need to do some wire strip­ping. Fun! The wiring in­side the Xbox con­troller’s cable uses bog-stan­dard USB wiring colours, so once you’ve chopped the plugs off the con­troller and the OTG cable, it’s pretty straight­for­ward to con­nect them to­gether.

Strip the wires by a cou­ple of cen­time­tres and then con­nect them to­gether. You should have Red, Green, White, and Black. The Xbox cable also has a Yel­low wire which you can ig­nore. It is worth not­ing at this point that you need to be sure that you have a USB data trans­fer cable and not just a plain old power cable — the for­mer will look like the photo on the right, but power ca­bles will be miss­ing the two data wires.

With the wires stripped, we tem­po­rar­ily used reg­u­lar sticky-tape to make the con­nec­tions be­tween the OTG cable and the con­troller — for a more per­ma­nent in­stal­la­tion, you can use elec­tri­cal tape or sim­ply sol­der the wires to­gether.

IN­SU­LA­TION

One thing to note: you’ll need to in­su­late the bot­tom of the Pi against all the con­tacts on the con­troller. For this quick hack, we’ve used some of the card­board pack­ag­ing — but any non­con­duc­tive ma­te­rial will do.

From there, it’s as sim­ple as screw­ing the case back to­gether. Make sure that the con­troller’s but­tons and joy­sticks don’t slip out of align­ment. Keep track of which coloured but­tons go where and you should be fine.

WIRING UP

The Pi will need three wires con­nected to it in or­der to work. The con­troller cable needs to be con­nected to the USB OTG port. An HDMI cable goes from your TV to the mini HDMI port on the Pi. Fi­nally, a 2A mi­cro USB power sup­ply needs to be plugged into the Pi’s power socket. We’ve used a stan­dard mo­bile phone charger, but you can use a USB bat­tery pack if you want to re­duce the num­ber of wires trail­ing around your room.

A WORD ABOUT POWER

You might be won­der­ing whether it’s pos­si­ble to get the HDMI cable to sup­ply power from the TV to the con­troller. Sadly, the HDMI spec­i­fi­ca­tion doesn’t per­mit power to flow in that di­rec­tion. If your TV has a USB socket on it, you could use that to sup­ply the Pi with power — just make sure the socket it­self is pow­er­ful enough. The Pi needs at least 1 Amp, and ide­ally 2 Amps. Many TVs will only out­put 500mA which isn’t enough to run the Pi.

LET’S PLAY!

OK, it’s look­ing good — you’re nearly ready to play. The next step is to get some em­u­la­tion soft­ware on this thing.

“If your TV has a USB socket, you could use that to sup­ply the Pi with power – just make sure it’s pow­er­ful enough.”

Green The cir­cuit can get the dif­fer­ence be­tween the two data sig­nals rather than be­tween a sin­gle wire and ground. It’s a more ef­fec­tive trans­mis­sion Black This is the other wire as­so­ci­ated with the power — the ground wire, which is the coun­ter­part to the 5V wire Yel­low USB mini/mi­cro ca­bles will also have an ad­di­tional wire that isn’t re­quired for our par­tic­u­lar project Red The red wire is one of two han­dling power. This one is a 5V power line that pro­vides volt­age to the cir­cuit White This wire is one of two used for dif­fer­en­tial data sig­nals. This white wire is the pos­i­tive com­po­nent and the green wire is the neg­a­tive one

Be care­ful that you don’t lose any small parts when open­ing up the con­troller

You can sol­der the OTG cable and con­troller to­gether, but sticky-tape will also do the trick

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.