Teardown: Super NES (PAL) Controller SNSP-005

Some days ago, I took apart my SNES gamepad to connect it to an Arduino. And I was astonished by the fact how simple the electronics inside are. OK, I have to mention that those controllers were manufactured since 1990…

SNES Controller

THE SNES GAMEPAD

Basically, the gamepad consists only of 12 buttons, 2 resistors, 1 capacitor and 1 IC.

The Gamepad

This Gamepad is a model SNSP-005, made in Japan. On the front side there are the Buttons A, B, X, Y, Start, Select as well as the digital D-Pad (Up, Down, Left, Right). There are also 2 shoulder buttons, which distinguishes the SNES controller from its older brother, the NES controller, which only has 8 buttons (A, B, Start, Select, Up, Down, Left, Right).

On the back there are the model number, the Nintendo logo and 5 screws (phillips heads), which have to be unscrewed to open up the controller’s case.

Teardown: The design

When all screws are removed, the back part of the controller’s case can easily be lifted off. Inside is the main PCB (in total, there are 3, but more about this later). It’s a single-sided PCB, the only part on the back of it is the internal connector for the connecting wire, which is held in place by 3 plastic posts to provide strain-relief.

SNES Controller geöffnet

This is the look inside the gamepad’s case having the back removed

The PCB itself isn’t screwed in place, it’s just held by the case. The PCB’s front side reveals its technology: From one of the connector’s pins, there are conductor paths leading to all 12 buttons, all over the PCB. Those buttons consist of 2 pads of conducting material (graphite?) on the PCB. When a button is pushed, a rubber membrane pushes another conducting pad down to connect the 2 pads on the PCB, closing the circuit.

Read More »

Posted in Electronics & Hardware | 16 Responses

SNESpaduino – Super Nintendo Gamepad for Arduino

The SNESpaduino library enables You to hook up Your old SNES (Super Nintendo Entertainment System) Gamepad as an input device to you Arduino.

SNES gamepad connected to an Arduino

The SNES gamepad can easily be connected to an Arduino – You’ll need nothing more but 5 wires.

Basically, the library does these 3 tasks:

  • Easy interfacing – You just need to connect 3 Pins (Latch, Clock, Data)
  • Read the buttons’ states – A function reads from the controller, which buttons are currently pressed
  • Help You parse the data – Using simple constants, processing the returned data is peanuts for You.

Not only that the library is incredible easy to use, You can also easily get to know the structure of an Arduino library, how these things are developed and what’s happening in the background. All the code is documented, the Commits on GitHub are also full of useful details. If you’re interested, dive in – it’s easy!

Download and Install

You can get the library in several ways:

To ensure you have the super-duper latest code, grab it from GitHub. Just use the git clone command from above on your OS of choice. However, if you don’t have the git program installed, feel free to download the repository as a ZIP. But note: When downloading the repo as a zip, you have to rename the extracted folder SNESpaduino-master (remove the -master)!

If you’re new to libraries, the official Arduino Library reference explains how you can install one. When You have successfully imported the library into the IDE, go over to connect your gamepad.

Connect the SNES Gamepad to an Arduino

The SNES Gamepad has 5 contacts: +5V, GND, Latch, Clock, Data. Here is the pin configuration of the connector (from left to right, starting with the group of 4 contacts). Also take a look at the picture, where pin-numbers as well as color coding is noted:

Read More »

Posted in Arduino | 18 Responses

Use Your Raspberry Pi as WiFi Bridge or AP

Use Your Raspberry Pi as an WiFi AccessPoint or Bridge, with just 10 minutes of work. Here is exactly how it works:

Usage: Bridge or AccessPoint?

Raspberry Pi and WLAN-Card

The Raspberry Pi combined with a wireless card functions as a wifi bridge or accesspoint

The main task is to run a WLAN station, so that clients (notebooks, smartphones…) can connect to it and use the existing cable network.
To achieve this, We have to do 2 things:

  • Run a WLAN Station
  • Redirect the wireless traffic to the existing network (via iptables or a bridge)

Generally, a simple Bridge is sufficient and what regular users are looking for: Wireless Clients are in the same IP range as the existing network.
The AccessPoint (from now on called AP) is used for large networks, the clients are in a different IP range than the existing network’s clients.

Firstly, we’re going to set up a bridge. After this, I will also explain how to set up an AP. You’ll know which steps you should follow by its headings. They say whether the instructions are for a bridge, AP or both of them.

Prerequisites

  1. Raspberry Pi Modell B
  2. Ethernet Cable (to connect to an existing network)
  3. WLAN-Stick (USB)
  4. Power Supply (e.g. your mobile phone’s)
  5. SD-Card

IMPORTANT: This tutorial is written and tested against the stock Raspbian image. In other distributions, the nl80211 driver may be missing!

Read More »

Posted in Raspberry Pi | 74 Responses

Transistor: Simple Switch with Raspberry Pi GPIO

Today, I’ll show you a small tutorial on how you can use a Raspberry Pi, a transistor and some wire to replace a PC’s on/off button. This way, it could be possible to start devices over a network, although they aren’t wake-on-lan capable.

In general, this method can be used everywhere a circuit is to be closed. For voltages above 5V however, You should use a relais to do the job.
Also, my Twitter-Followers can calm down: No, this wasn’t a doomsday device ;)

For the time being, I don’t have much component parts to play with, so I can only do articles on rather simple circuits. Nevertheless, I find it quite astonishing what You can do with a RasPi, some wire, a transistor and some spare time.

Needed material

In my experimental circuit, I used the following components:

Mainboard, PSU, Fan, On/Off button from a PC-Case, IDE-Cable, BC327-16 bipolar transistor, Soldering Iron, Solder, insulating tape and – of course – the Raspberry Pi.

Certainly, You can use any device and take it apart to use a transistor and the RasPi as a simple on/off switch. As I have plenty of old PC hardware lying around here, I decided to use the Transistor as an on/off switch for an old mainboard.

But before we start to solder, we should have a look at the principles of a transistor:

Read More »

Posted in Raspberry Pi | 26 Responses

Raspberry Pi: Blinking LED in 5 Simple Steps

Today, we’re going to build the cheapest Raspberry Pi project possible.
It just involves 1 LED, but for many (including myself), it can be very fascinating to make the LED blink. This project is ideal as a first project, as it is very easy to plan and do. Everything you need is an LED. If your LED can’t handle 3.3 Volts, you’ll also need a resistor, but they are as cheap as 10ct. I think, even pupils in elementary schools will be able to successfully execute this project.

Project 0

Ok, before we begin, let’s have a preview of what we want to do:

Use the GPIO to make your LED glow.
After a short look on the GPIO pinout, we can clearly see: Pin P1-04 = +5V, P1-06 = 0V (GND)
Fortunately, I have a spare LED here that can handle (almost) 5V. So I can connect this LED directly to the dedicated current source and ground, what makes the LED glow:

Important: Chose the correct resistor for your LED! R=U/I – If you have a 3V LED and want to connect it to 5V, you need to drain 2V. Let’s say your LED consumes 30mA, so you will need a 2V/0.03A = 66Ohm resistor. Basically, just do this if you already know what you are doing.

Read More »

Posted in Raspberry Pi | 2 Responses