Skip to content
Scott Bezek edited this page Apr 15, 2023 · 19 revisions

There have been a number of different electronics designs for this project over the years. The "Chainlink" system (described in the main project README) is the currently recommended design, which is scalable up to very large displays (100+ modules).

However, if you're just interested in testing a single module, this page also has instructions on using an Arduino Uno to validate your splitflap module without needing a custom PCB - jump to the Basic Prototyping section.

  • Basic Prototyping - this avoids the need to order custom PCBs and allows you to test up to 3 split-flap modules with an Arduino
  • Chainlink System - this is a scalable system that uses an ESP32 to control many modules with a chained set of driver PCBs. This is the current recommended design.
  • v0.5 "Classic Controller" Electronics (hall-effect sensor) - uses a hall-effect sensor rather than an IR reflectance sensor, and fits as a "shield" on an Arduino Uno. Not recommended for new builds.
  • v0.3 ("old") Electronics - here for archival purposes. Not recommended for new builds.

Basic Prototyping [Alternative electronics approach]

It isn't necessary to order the custom driver/sensor PCB to get a few splitflap modules working, though I would recommend it if you'd like to have any kind of semi-permanent display. The custom PCB enables more splitflap modules to be controlled by a single Arduino (up to 12 compared to just 3), makes wires much more manageable (everything is integrated into the PCB instead of having to wire up a separate motor driver per module), and makes it much easier to mount and adjust the home-position sensor.

With those caveats out of the way, here's how you can primitively test a splitflap module without building a PCB. You'll need:

  • Arduino Uno (or equivalent)
  • 12V 28BYJ-48 Motor with ULN2003A-based driver board (the driver board is commonly included with the motors. Note that the driver board is NOT necessary when using the custom PCB below; the custom PCB has integrated driver circuitry)
  • A hall-effect sensor you can attach to the inside wall and adjust to detect the spool's home position hole. The AH3391Q is recommended (some alternatives are listed here - note that hall sensors marketed as "low power" generally will not work in this application due to a low sampling rate). You can also omit this if you just want to test the modules in open-loop mode, but that means you'll need to manually calibrate the home position of every module every time you turn it on, and it won't be able to detect/correct any errors.

The wiring should be as follows (from basic_io_config.h):

  // Motor A: PB0-3 = pins 8-11
  // Motor B: PD4-7 = pins 4-7
  // Motor C: PC0-3 = pins A0-A3

  // Sensor A: PB4 = pin 12
  // Sensor B: PC4 = pin A4
  // Sensor C: PC5 = pin A5

The sensor pins are configured to enable the internal pull-ups, so they can be connected directly to the sensor's output pin (pin 3) without requiring an external pull-up resistor.

As an image, that looks like:

Wiring diagram

(Note: 12V power to the motor driver boards isn't shown, nor are the details of the sensors)

When using PlatformIO (recommended, with VSCode), use the uno-direct target to upload the program.

If you are using the Arduino IDE (not recommended), you'll need to manually configure the code to use "basic IO" mode by updating these values in config.h:

#define NUM_MODULES (3)
#define NEOPIXEL_DEBUGGING_ENABLED false
#define SPI_IO false

Archive

Classic Controller Electronics

These instructions are for the "Classic Constroller" electronics design from the v0.5 release.

There are two distinct electronics components: the home-position sensor board and the controller/driver board.

The controller board plugs into an Arduino like a shield, and has 4 motor outputs and 4 sensor inputs.

animation of controller being plugged into an Arduino

The hall-effect sensor on each module lines up with a magnet in the flap spool and detects each time the spool does a full rotation past the "home" position. The recommended approach to mounting the hall-effect sensor is to use a breakout board PCB, which holds the sensor securely and allows you to easily fine-tune its position for calibration. However, since ordering a second PCB design may be cost-prohibitive to a hobbyist making just a few modules, there are alternative instructions for using the hall-effect sensor without a PCB below.

Building a sensor board

The sensor board is a really basic breakout board for mounting a hall-effect magnetic sensor. These custom PCBs can be ordered on SeeedStudio in bulk (200 for ~$25), or if you don't need quite so many, can be purchased as a pack of 4 on Tindie for $4.

Watch the assembly tutorial youtube video:

Completed sensor board with AH3391Q sensor Completed sensor board with AH3391Q sensor Side view of installed sensor board Side view of installed sensor board

Sensor board alternative

If you'd like to mount the hall-effect sensor without a sensor PCB, you can do so by swapping the 5V and GND pins of the servo cable and then simply plugging the sensor into the cable's connector. (Improved description and photos coming soon)

Sensor plugged into cable Sensor installed

Building a controller board

Follow the instructions here

(Video coming soon!)


v0.3 (old) Electronics

These instructions are for the "old" electronics design from the v0.3 release.

There are two custom electronics components: the home-position sensor board and the controller/driver board.

But even though there are two separate circuits, they're both laid out on a single PCB design. This way you can order a bunch of identical boards (to save money) and build each into either a sensor or controller board depending which components you solder up. The PCB can act as either as a single controller board, or 2 sensor boards if you split it down the middle.

PCB split into 2 sensor boards

Each flap module needs 1 sensor board, and up to 4 flap modules can share a single controller board. This is what a single controller and sensor board look like when hooked together:

completed electronics boards

The IR reflectance sensor on the sensor board lines up with a hole in the flap spool and detects each time the spool does a full rotation past the "home" position. It's mounted to the module using 2 bolts with slots that let you manually fine-tune its alignment.

Building a sensor board

The main component of the sensor board is the surface mount GP2S60. It's pretty tiny, so you may want to brush up on your surface-mount soldering technique if you haven't done it in a while.

The GP2S60 is a 4-pin SMD component and polarity is important. You'll notice that there are circle and square markings on the back of it -- when the component is in place, each of those symbols should lie directly above the corresponding symbol on the PCB:

symbols on the GP2S60 match PCB silkscreen symbols

When you've aligned the sensor in the right orientation, use tweezers to hold it in place while soldering each of the 4 corners in turn, making sure not to bridge any of the pins:

GP2S60 soldered in place

Next is the current-limiting resistor. Note: since the sensor board must be able to sit flat against the enclosure wall, the through-hole components MUST be soldered unconventionally from the TOP rather than the bottom of the board (see photo). Leads should be trimmed before soldering to ensure they don't stick out the bottom.

soldering the resistor

Finally, we'll solder the right-angle pin headers. Just like with the resistor, it's important that the pins don't extend through the bottom of the board, so you need to trim them really short and solder them from the top side.

trimming connector leads soldering the connector

Building a controller board

The controller board plugs into an Arduino like a shield, and has 4 motor outputs and 4 sensor inputs.

animation of controller being plugged into an Arduino

Here's what everything on the controller board is for:

the components of the controller board

The controller board also has an expansion connector, which allows another controller board to be connected for 4 additional outputs/inputs, and another controller can be chained to that board for still another 4 more outputs/inputs, making a total of 12 modules controllable from a single Arduino.

When chaining controller boards, they're built in 3 slightly different variants - the "A" design plugs into the Arduino directly and can optionally have a "B" design connected via its expansion port. Likewise, the "B" design can optionally have a "C" design connected via the expansion port.

controller board variants

The main difference between the boards is which connectors are populated.

  • The "A" design is the only one with components soldered to the underside (the pin headers that plug into the Arduino) and it lacks the "Expansion in" connector of the B/C designs. It also has a motor power input connector.
  • The "B" design has both an "Expansion in" and "Expansion out" connector, but does not need a power input connector (motor power is provided via the expansion ribbon cable). You can optionally omit the larger 100uF filter capacitor on the 5V logic line, since it's likely redundant with the one on the "A" board
  • The "C" design is identical to the "B" design, but lacks the "Expansion out" connector since it's the end of the chain.