Around the Adafruit Playground III: Distance Sensor and Display Expansion Board

by OlivierHaeberle in Circuits > Arduino

45 Views, 0 Favorites, 0 Comments

Around the Adafruit Playground III: Distance Sensor and Display Expansion Board

HC-SR04Board.jpg

We have seen in a here how to make a "motherboard" for the Adafruit Playground Classic (APC) card (also works for Express and Bluefruit).

In a second instructable is given the description of a simple prototyping board, to expand the capabilities of the APC by adding new sensors, wirelesss communication etc... to a 170 pin breadboard.

Here, another expansion board is described, adding an ultrasonic distance sensor, a 4-digit display, and two potentiometers to simulate analog sensors.


Supplies

Equipment to make printed circuits

3D Printer

1 right-angle D-SUB male DB15 connector

SR04 ultrasonic distance sensor (3.3 V version), as this one for example (there are many clones under the HC-SR04 name, check it is a 3.3V or dual 3.3-5V version)

Adafruit I2C 4-digit alphanumeric display for example a green one (but will work with any colour, and also with 7-segment displays, such as)

2x 5k Ohm potentiometers, for example those. (10k Ohm will also work)

3 mm diameter, 6 mm or 10mm long screws,

Choice of Connector Type

As a Female DB15 connector has been used for the "motherboard", the choice is obvious for exension boards: a Male DB15 right-angle connector.

One just has to replicate the layout of the Female connector from the motherboard, see pdf file.

Note: as the Male and Female connectors face each others, the pin numbering is left/right symmetric. Do not forget to take this into account when designing an extension board.

Design Printed Circuit for the Extension Board

Adafruit14segmentBackPack.jpg
AdafruitHC-SR04.jpg
ProtoUS1.jpg
ProtoUS2.jpg

For this board, the idea is to expand the capabilities of the Adafruit Playground, in order to have provide complementary sensors and displays.

First, a 14-segments display is to be added. To connect it to the APC, we need (Figure 1, from Adafruit website):

  1. SDA and SCL for data communication
  2. Ground and 5V alimentation
  3. This Adafruit I2C 4-digit alphanumeric display is powered in 5V, but can work on 3.3V or 5V I2C level. As the APC works in 3.3V, we connect the Ui2C pin to 3.3V so as to fix I2C logic level compatible with the APC


The HC-SR04 sensor (Figure 2, from Adafruit website) will be used to mesure distances.

One must connect the ground, and it must be powered in 3.3V to deliver 3.3V signals for the APC.

Then, a choice is to be made to connect the signals, here, APC pin #10 willl deliver the Trig signal to start the HC-SR04, and pin #9 will receive the Echo signal, which is a pulse, which width is directly linked to the distance via the speed of sound (with a factor 2 because it's an echo, the signal goes from sensor to object, is reflected, then goes back to sensor).


To simulate two analog sensors, pins #6 (A7) and #12 (A11) will be connected to two 5 kOhms potentiometers delivering variable tension on their output or so-called “collector” Pin 2, when their Pin 1 are connected to Vin (3.3V) and Pin 3 are connected to ground.


With this information, one can make a quick wired-prototype (Pictures 3 and 4). Here, a 7-segment display has been used, but wiring is the same as for the 14-segment display. When the conception has been validated, one can then design a nice printed circuit. Unfortunately, Instructables does not allow KiCad project uploading. The pdf file of the mask if provided below. I will later provide a link to download the whole KiCad project.

When the circuit has been etched or engraved, cut and drilled, or manufactured by a third party, one can install it in its case, to check it fits well.

The Case

CaseGrey.jpg

Here it is easy, we can use the same case than for the mini-breadboard expansion card, here simply printed in grey instead of blue.

There is no peculiar specification, PLA works well. The step files for 3D printing the case is given below.

Three screws allow for attaching the board in the box. You may redrill the hole in the support if screwing is too tigh, or alternately, use 2.5 mm screws.

Soldering and Mounting the Board

HC-SR04Board_Soldered.jpg
HC-SR04Board.jpg

First, solder the DB15 connector. Beware when inserting the connector, tolerances are tight, and it's easy to bend/break a pin. Be precise when soldering, as pin layout is quite dense (Image 1).

Then, solder the 14-segment alphanumeric display, the potentiometers and the ultrasonic distance sensor.

Test and re-test to check that all connections with DB15 are OK, and that no shortcut did appear.

Insert he board into the case (Image 2), and add screws.

Connect and Program

APCandUSboard.jpg

Connect the board to the motherboard, connect the Playground to your PC, and you can start programming.

You may notice, on the above image, a white mounting bracket for the HC-SR04, which is not present in the previous images. That one has been added because we realized that there is a risk of breaking the pin soldering, as the sensor protudes a lot from the printed circuit. A mod has been made from this HC-SR04 mouting bracket. The stl file is given below. Adding it was very helpful, as these boards are not always very carefully handled ;-)

Enjoy

Test_USBoard

The movie shows a simple sonar displaying the distance on the display, while the tensions from both potentiometers are displayed as bargraph onto the Neopixel leds of the main board.


Many thanks to my colleagues Joël Lambert for the original case modifications, Jordan Veron for printed circuit design, prototyping and testing, and Célia Olivier for the HC-SR04 mouting bracket mod !!!