Introduction

Ingun is a manufacturer of Test Probes, Fixtures, and various accessories for their fixtures. We use the MA2xxx series from Ingun for most of our designs and have been using the FB-ABF-V-I-MA2xxx Inductive Sensor to automatically detect when a test fixture has been closed.

IMG_20200326_182714.jpg

The sensor outputs a 12V signal when the fixture is closed, 0V when the fixture is open, and this signal needs to be converted to something that can be read by a computer running the test software.

In this tutorial we will :

  • Interface an Ingun Inductive Fixture Switch to a SparkFun Pro Micro development board
  • Write firmware (using Arduino) for the development board
  • Create a python module that can communicate with the device using a USB Serial Port
  • Design an enclosure using Fusion360
  • 3D print and assemble the Ingun Fixture Switch Reader

Resources

If you'd like to follow along or take a look at the design files for the project, they are available on GitHub here: https://github.com/FixturFab/fixture_switch_reader

Electrical Design

To interface this sensor with a computer, we will use a SparkFun Pro Micro (3.3V), this development board has an ATmega32u4 processor which makes it easy to implement a USB Serial port to communicate with.

To interface the inductive sensor to the Pro Micro, a voltage divider is used. The sensor outputs 0V when the fixture is open and 12V when the fixture is closed and this voltage needs to be divided down to 3.3V so that the IO on the Pro Micro isn't damaged.

Fixture Switch Reader Schematic

To help indicate if the device is powered and if the switch is closed two LEDs are used. The first LED is controlled by VCC from the Pro Micro. This pin outputs 3.3V when the Pro Micro is powered over USB. The second LED is controlled by Pin-7 on the Pro Micro to show when the fixture switch is closed or open.

To connect the Ingun switch, we used a .1" IDC connector that we already had on hand.

Perfboard Prototype

The circuit was prototyped on a piece of perfboard.

Top of perboard prototype

Bottom of perboard prototype

Perfboard prototype with SparkFun Pro Micro

After finishing soldering up the prototype, we moved onto developing some simple firmware for it.

Firmware

The SparkFun RedBoard is compatible with Arduino, which made it extremely fast to get this device up and running. The firmware uses a pretty straightforward processing loop.

Firmware main loop flowchart

The switch state is read and the status LED is updated to the new switch state. The serial command buffer is then checked, and if a command is available it is processed.

To get the switch state, `read_switch` is sent over a serial port, the device will then respond with a '0' if the fixture is open and '1' if the fixture is closed.

Arduino Sketch for the Fixture Switch Reader

After some slight debugging, we are ready to test all of the firmware features.

Fixture Open and LED Off

With the test fixture open, the LED is off.

Fixture Closed and LED On

With the test fixture closed, the LED is on. Let's test the serial port commands work as well.

Serial monitor screenshot

Serial port works!!

Now that all of the features that are required are working, we are ready to build a Python module to communicate with the device.

Software

Since we use Python for almost all of our software at FixturFab we will build a Python module for controlling the Fixture Switch Reader called FixtureSwitch.

To communicate with the device, the pySerial library is used. A class called FixtureSwitch is created, and within the init method we connect to the serial port.

The 2 commands that are supported by the device are then implemented within their functions in the Python class.

Python Module for Fixture Switch Reader

Enclosure Design

To prevent the device from shorting out within a test fixture, an enclosure will be created. To design this enclosure, Fusion360 was used.

The first step was to create a model of the device. This model doesn't need to look exactly like the perfboarded device but needs to have similar mechanical dimensions so that the enclosure can be designed around the device.

Model of prototype device

The case will be designed using 2 parts, a bottom half which the device will sit in, and then a top half that will sandwich the device in place. The 2 halves will screw together using M3 heat-set inserts and screws.

The bottom half of the case contains a cutout for all of the leads and solder joints to have clearance along with holes that the heat-set inserts will be inserted into.

Bottom of Fixture Switch Reader Enclosure

The top half of the case contains cutouts for the Ribbon Cable Connector, Power and Status LEDs, and the USB connector. It also has countersunk holes for M3 screws to be inserted into.

Top.JPG

The entire case is then put into an assembly to verify that there aren't any clearance issues before 3D printing the enclosure.

Complete enclosure assembly

Printing the Enclosure

To create the enclosure we will use an inexpensive FDM 3D printer. The STL's of the top and bottom case pieces are exported from Fusion360 and then imported to Cura.

Cura setup

The generated Gcode is then sent to the 3D printer and the parts are printed.

Device Assembly

Adding the Heat-Set Inserts

After removing the case pieces from the 3D printer and removing the support material the Heat-Set inserts need to be inserted into the bottom half.

Before inserting the heat set inserts

To insert the heat-set inserts, a soldering iron is used. They make special tips for this task, however, we typically just use whatever tip is currently on the iron and then pliers to make sure the inserts aren't pulled out when the iron is removed.

IMG_20200326_194915.jpg

Assembling the Case

The device assembly can now be completed using the top/bottom case parts, the perfboarded device, and 4 M3x10mm screws.

Case and perfboarded device

First, the perfboard is inserted into the top half of the case, this makes it easy to align the connectors and LEDs.

Front of the top case

Back of top case

Now the top of the case is attached to the bottom of the case using 4 M3x10mm screws.

Assembled Fixture Switch Device

Adding the Fixture Switch Reader to a fixture

To attach the reader to a fixture, a small strip of VHB will be used. A cable is also assembled by taking a 10 conductor ribbon cable and splicing it to both the Ingun switch (12V, Sig, GND) and the 12V power supply in the fixture (12V, GND).

The reader is then attached to the base in the lower left-hand corner of the fixture, allowing for the status LED to be easily visible.

Close up of the assembled switch reader

The switch is then attached to the Intel NUC which runs the test software, which can now read when the fixture has been closed.

Completed test fixture base

Lessons Learned

This was a pretty straightforward and quick project to complete, we did learn a couple of things along the way:

  • Having some 0.100" spaced terminal blocks on hand would be great
    • It would have been much easier to connect 12V and the Ingun fixture switch using terminal blocks instead of having to splice wires to a ribbon cable.
  • Arduino's are great for quick prototyping, we should always have these on hand
  • A larger current limiting resistor on the LEDs would be a good call
    • While the LEDs can take 8mA, they are way too bright