Close
0%
0%

Reusable Modular Components

A collection of reusable parts that implement various electronic circuit functions

Similar projects worth following
Electronic waste is a serious problem. Electronic devices are typically obsoleted in a few years. The assemblies combine many small components, made from a wide variety of materials, and thus are not well suited for recycling. To avoid creating electronic waste, reuse makes more sense, in particular when many of components should have a useful life of 50 years or more.

This project focusses on simple electronic components, the ones most commonly used. The parts will assemble without solder, and can be disassembled easily for reuse. I am aiming for consistency in how the parts mount, are interconnected, and are documented.

There are several part categories to address, including cabling, human-machine interface, connectors, signal conditioning, power, MCU breakouts, etc.

Many design decisions are arguable. So take it for what it is. If you have a better idea, toss it in, and maybe I will add it to the system on the next round.

The first couple of board batches have been primarily human-machine interface (HMI) and interconnect components.

The HMI component collection so far includes:

  - 5mm LED

  - 5mm bicolour LED

  - button

  - LED/button

  - pot

  - multi-position switch (4 positions)

  - toggle switch

  - rotary encoder

All of these components can be panel mounted. The boards convert the pin connections into a Grove or 2 pin JST PH connector. In some cases resistance is added eg for LEDs. The boards are extremely simple, and the layout time was minimal. The boards are small, so the cost is low when buying in volume.  

The composite HMI is wired with PH and Grove cables, which can optionally be consolidated into byte-wide breakouts. Then a 10-wire Dupont cable is used to carry signals back to the MCU. This connector works well for prototyping, but I want to find one (probably a JST PH) that will be better for use in the field.

I use #4-40 standoffs and screws for holding things together mechanically. M3 works just as well. I chose #4-40 over M3 because we have a local supplier that stocks these and they are cheap. 

While this concept may use more parts, it all comes apart and there is very little waste. The only part that cannot be easily reused on this first demo HMI is the acrylic panel.

There is a lot of detail, on various topics, that I think is best covered one subject at a time, in the log. 

  • I2C & SPI

    Tom Dowad05/12/2022 at 08:24 0 comments

    The other day I was thinking about how both Sparkfun and Adafruit had created systems of I2C parts, called QWIIC and STEMMA, which are more-or-less compatible in terms of interconnect. Within each of these two product lines, the various boards share a great deal of consistency in shape, size, and mounting.

    There is no need to recreate these parts for Weaver (my name for this system), as integration is taken care of by an adapter cable which they also sell.  Every possible kind of sensor is already available. Hooray for that.

    I see this meeting of minds between two leaders in maker product design as a milestone. We need more of that.

    This got me thinking about  SPI. SPI and I2C are the two busses commonly used internally in embedded systems. SPI has greater bandwidth than I2C, so is better for some applications. But its not appropriate for addressing multiple devices, at least not more than a few. 

    In a system like Weaver, there is no need to support both SPI and I2C for every class of device. One interface per part class is fine. It would be useful to have a policy for deciding which kinds of devices use I2C and which use SPI. My answer is to use SPI for larger data transfers and I2C for small transactions. This seems to be the obvious approach.

    It would not be good to share a bus between a sensor being sampled at a constant rate, and a block transfer device that every now and then consumed all the bus bandwidth for hundreds of milliseconds. That would screw up the sample rate on the sensor.

    What devices deal with large blocks of data? I think that is pretty much summarized as video/graphics, audio, and storage. Not surprisingly, in the embedded world, SPI is used for SD cards, serial memories, and graphic displays. For audio its I2S, which is a relative of SPI. 

    There are other devices for sure that interface with SPI, but they don't need to be supported in Weaver, because it seems most device classes that use SPI also have an I2C version.

    I had been planning on adding a 6-pin connector for SPI, but what would it be used for?

    For serial memories, lets just declare that all will be SPI. A solution for connecting these to the MCU is to put a memory chip on each MCU breakout. Then no cable is required. Just put the pads there, it can be stuffed or not depending on need, and there is no cost to do so. The chips have a standard pinout, shared between manufacturers, so use this stock pinout and the designer can decide on the specific part. 

    For graphic displays, these are already supported by the 10-pin byte-wide cable that has SPI on it. The first four pins have been speced as being SPI where possible.

    So that leaves SD. In the context of an electronic product, does SD make sense? My opinion is, not if it cannot be accessed by the end user. If a large amount of data is required internally then a large serial memory is a better choice. Its more reliable. Burying an SD card internal to a piece of equipment seems like an accident waiting to happen. Then again, someone is bound to want to do it.

    Some answers for SD are:

    1. put a micro-SD slot on the MCU breakout. I don’t like this so much, it doesn’t seem quite as easy as the serial memory, it takes more space, and I think less likely to be used. 

    2. put it on graphics boards, adding a second Slave Select pin to the 10-pin connector. Seems like a good idea but what about when you've got audio and no display? The I2S interface uses too many pins to allow for SPI on the same cable.

    3. use the byte-wide connector for a full-size (not micro) SD board, designed to mount so the end user can change the card. I like this idea. Mounting could be tricky, but I’ll worry about that another day.

    The SD spec actually has more pins than just your basic 4-pin SPI. And SD slots often have a card detect switch. It seems using the 10-pin connector for an SD board is a good idea. Six pins wouldn’t cut it anyway. 

    I haven't thought...

    Read more »

  • LCD Text Displays

    Tom Dowad05/10/2022 at 19:19 0 comments

    One loose end re displays. The Hitachi-controlled LCD. While these could be interfaced with I2C and a backpack, the display requires 5V and I prefer keeping I2C at 3.3V.

    I've just made an adapter cable to the byte-wide connector. There are enough pins to do it, with backlight control, though the contrast needs to be controlled with a pot on the yet-to-be-designed adapter board. Contrast can be controlled with PWM,  but honestly I prefer just to set it with a pot. Its easier.

    I like having these byte-wide connectors for debugging. I've made one for each display, and can swap displays in an instant. Also I made a tap board, for connecting my logic analyser. 

  • Restating the Purpose, Giving it a Name

    Tom Dowad05/10/2022 at 13:26 0 comments

    Down at your local recycling depot, they’ve got a truckload of electronic devices bound for who-knows-where. If they’ll let you have one of the dozen printers in the bin, you can take it apart and salvage a lot of useful parts. But the effort to use them is going to be more than the parts are worth, because there is no documentation and no open standards for how those parts mount and interface. 

    What I’m working on is a standard suitable for converting the electronics in such devices into collections of reusable modules. I’m trying to use off-the-shelf parts if I can, with adapter boards where needed. When the system works in this prototype form, then measures can be taken to make it workable for creating electronic products. 

    It's like trying to create the IBM PC, at the microcontroller level. The ubiquitous, expandable standard that most everyone supports. The Arduino would be the Apple II. But we need an IBM PC. 

    I spent some time wracking my brain regarding the name for this system, and for the soon-to-be-established Github repo. The name is "Weaver". That's what you become when wiring up one of these modular panels.

  • Graphic Displays

    Tom Dowad05/09/2022 at 06:14 0 comments

    Having some graphic displays in the part collection would be cool. There are cheap, small, 16-bit colour displays that can be bought on Aliexpress for as little as $4 CAD (that’s $3 USD), delivered. 

    What they are good for is debatable. I debated a lot with myself, even wrote some of it down. The bottom line is, the most interesting imaging and graphics applications require graphics hardware to work well. And our Arduino-programmable micros are by-and-large not up to the task. If you really want to make an embedded colour display application, get a Raspberry Pi. In that case, these cheap little displays probably won’t apply.

    After much reflection, I realized that the resolution and size of these displays was comparable to the UC1609 192x64 1-bit-per-pixel display, at a similar price and size, but twice as many pixels, and colour. Taking 16x the time to update, and 16x the RAM if you want to do any compositing. 

    I made a spreadsheet to compare the various displays I had in hand. In the end I settled on a 160x128 ST7735 display. It can be bought today for $5 Canadian, delivered, more or less the same price as a UC1609. It could do 16x8 characters with a decent 10x16 antialiased font. Adafruit has published a good Arduino library for it. 

    I made a board for this display a couple of months ago (top center in the photo). It has level shifting and a regulator so it can be used with 5V or 3.3V, depending on how it is populated. It has suitable mounting holes (the display's holes are too small for the hardware I'm specing) and will ultimately have a byte-wide connector so will connect to any MCU breakout. 

    BTW that red board is nice too. Suitable holes, does 3.3 & 5V, has an SD card slot, and its 200x176 pixels. Just a couple of bucks more. I might have to revisit that one if I can make it work. I'm not so sure about the availability of a driver for its ILI9225 controller.

  • LED Segment Displays

    Tom Dowad05/09/2022 at 00:47 0 comments

    LED segment displays, both 7 and 14, are great for simple text when you don’t require a lot of characters. They are generally easier to read than other displays due to large, bright characters. They’ve been around for about 50 years or so, and still being used, so its not as if they've been made obsolete by more sophisticated technology now available. I reckon some LED segment displays belong in the kit.  

    Sparkfun makes a really nice 4-character 14-segment display, in multiple colours. These used the QWIIC I2C connector with 3.3V power, which can be connected into my Grove-centric system with an adapter cable they also sell. Check this link:

    https://www.sparkfun.com/products/16919

    I2C is a good interface for small text displays as bandwidth is not an issue. In particular with the 14-segments, you wouldn’t want to drive the segments directly with GPIOs as it would require too many MCU pins. So having the designers at Sparkfun taking care of this suits me just fine.

    These parts each have 4 digits, but several can be concatenated, for 8, 12, or 16 characters, limited to 4 parts due to I2C addressing limitations. The holes are a suitable size with good clearance. 

    They are just about ideal. A bit pricy but understandably so. I am going to buy some of these to add to the kit.

    For a 7-segments, there is a make available on Aliexpress that I like: DIY More. They’ve got a lot going for them: 4-wire interface with TM1637 driver chip, good sized mounting holes with good clearance, 5 LED colours available, and inexpensive. 

    What I really liked to see was the documentation printed on the back silkscreen. That is, the Arduino library is mentioned. This is the first time I’ve seen this done, and it’s one of my goals for this project ie to provide adequate documentation printed on each circuit board. Space allowing of course. Now factually, I wasn’t able to find the correct Arduino library, but its the thought that counts.

    DIY More has 4, 6, and 8 digit displays in several sizes. But with regard to the system I am creating here, there are some problems:

    1. The 4-digit displays do not have the same center as the mounting hole center. That means, when you go to mount these, start measuring and calculating. 

    2. The 4-pin connector has ground and voltage reversed, relative to Grove. That means either a modified cable or an adapter board is needed. 

    3. The 4-digit displays cannot be concatenated. The board extends beyond the display on left and right, so it’s physically impossible.

    The 6-digit display _is_ centered on the holes, and I doubt I would want to concatenate two of these. I made a cable adapter with an M5Stack Grove-to-0.1” adapter, swapping ground and power on the Grove cable. I tried it out with a Mega2560 and a Teensy, and it works at both 5V and 3.3V. So voltage is covered. 

    I never did find the right library. But I could see it was workable,  just a matter of correctly juggling the characters. 

    These DIY More units get the nod. I’ll make a Grove pin adapter board for these, not because its difficult to swap the ground and VCC pins on a Grove cable, but because one day I will forget to swap the pins and blow the thing up. Its sure to happen.  

    DIY More also make an 8-digit display, but it uses a shift register and requires 5 pin connections, so not suitable. Another company makes a MAX7219 8-digit display that fits the bill, and could be used with a simple pin adapter.

    No doubt there are more 7-segment displays out there. I would keep looking but there is  other ground to cover. 

  • Displays

    Tom Dowad05/08/2022 at 01:43 0 comments

    The displays I would like to support are the classic Hitachi controller text display (the "cheap" option), a 16-bit colour graphic display (the "good" option), and the UC1609C 1-bit-per-pixel 192x64 display (my favourite for price/performance). I think there ought to be some 7-segment LEDs in there as well. 

    My intent is to use whatever off-the-shelf components are available, and make simple-as-possible adapter boards that result in system-compatible modules. Compatibility includes interfacing with the system's connector standards, and having the displays easily mountable using the chosen hardware and hole grid system.  

    A couple of  months back I was writing a lot of display drivers, and having to solder together a cable for each different display. Small graphic displays typically have three SPI pins, a reset pin, a data/control pin, and a backlight control pin, plus power and ground. Eight or nine pins all told. So it seemed a good match for the byte-wide connector which has been speced into this system.

    The requirements of the graphic displays to have SPI resulted into an addition to my byte-wide connector spec. That is, signal pins 0-3 should be the 4 SPI pins: SCK, MOSI, MISO, and SS. The remaining 4 pins can be any old GPIOs. At least one such connector should be present on an MCU breakout board.

    On my last board batch, I made two small display cable adapter boards that accept the byte-wide connector. These have optional resistive dividers, for knocking 5V signal lines down to 3.3V if necessary. On one there is an N-channel MOSFET for driving the backlight which the display datasheet says consists of 4 white LEDs in parallel. One of these small boards was for the UC1609C, the other for ST7735 or GC9A01 graphic displays. 

    Today I got the UC1609C working with the byte-wide adapter board. For the MCU I used a custom AVR128DB32 board that was also in the last board batch.

    I'm quite happy with the resultant display. I created a 10x16 pixel Monaco font, rendered from PNG bitmaps, into a C array with the correct format for this display. I understand there are some open source fonts out there, I'm guessing this Monaco font is breaking some laws.

    BTW the UC1609C module comes in both 5V and 3.3V versions, so it takes care of the dual voltage problem. 

    What I am not happy about with the small adapter board is the mounting. The holes on the display are too small for #4 screws. There is inadequate clearance for standoffs. The holes are not arranged to be equidistant around the center of the display (making mounting math more difficult). And my little piggyback board actually obscures two of the holes anyway. So its not practical as a unit that can be mounted onto a panel.


    But...I had also made a "smart" version of the UC1609C adapter, with an MCU on-board. On that board, I've added the mounting holes needed, making an effort to have these centered on the display center so calculating hole positions is simple. The standoffs for mounting worked quite well. 


    In any case --- I concluded a dumb version of this bigger board is the way to go. So its on the list, for the next batch. 

  • Power

    Tom Dowad05/07/2022 at 13:51 0 comments

    I should have stated in the beginning, this system is not intended for small gadgets that fit in the pocket. The orientation is toward gadgets in enclosures that sit on a desk, in a rack, for control systems, bots, vehicles, in the home, entertainment systems, etc.

    The scheme described here is intended for powering the digital part of the system. Obviously there are a lot of other devices requiring higher voltages and currents. But I'll think about that...next month. Today its just 3.3V and 5V. 

    While 3.3V is the way things have gone in digital systems, there are a variety of 5V devices that won't go away. The most convenient source of power happens to be 5V from USB. So a rule in this system is that power comes in as 5V. And another rule: it will be dual voltage, always. 

    Common connectors for bringing power into an enclosure include USB-B and barrel connectors. USB-B seems to be the easiest style of USB to deal with. Its the most durable and easiest to plug in. An off-the-shelf panel-mount USB-B cable is available, with mini or micro USB on the other end. The mounting holes are of a suitable size. That's a 3mm standoff in the hole.


    While USB will be current-limited to around 250 mA if coming from a PC, the USB AC adapter is ubiquitous and cheap, providing more current if necessary. Or go to a 5VDC wall wart with a barrel connector. 

    So with 5V as the main source, there will need to be a 3.3V regulator somewhere. Depending on the current requirement, this could be on the MCU module. Typically the MCU module will have power coming in from USB micro or mini, then output 3.3V on one of its pins. That might be good for 100 mA, depending on the part. If that is a enough current, then the USB-B cable as above can plug directly into the MCU, and the MCU supplies power to its breakout board.

    For higher current, say up to 1A, there will be a 3.3V regulator on the MCU breakout.  To bring in 5V to the breakout, I am thinking JST PH 2-pin. And as it happens there is an off-the-shelf cable to do just that, from a 2.1mm  barrel connector.

     I haven't seen a USB-to-PH cable, so I'll probably make a board for that.

    I don't think using the PH for 5V power is too dangerous. So far the 2-pin PH is intended to be used for contact closure, audio amp output to speakers, and LEDs. Into a LED? It's a way to test the LED. It's a feature. A contact closure? If the contacts are normally open, its fine. If not, then there is a regulator somewhere upstream that is going to go into current limiting and thermal shutdown. But still, probably no smoke released. Accidentally plugging 5V into the amp output to a speaker? That is bad. Don't do that!

    One other way I often bring in power is via a USB-to-serial adapter. As part of the recent board batches, I made a board converting the standard 6-pin 0.1" pitch connector to Grove. As mentioned in an earlier log, all serial Grove connections will carry 5V power. So this can also be a way of bringing in 5V. If power is not required over the serial Grove cable, its easy to remove the red power wire. 

    There are a few common higher voltages that ought to be supported ie 12V, 18V, and 24V. I'm imagining an external power supply module and a 5V switching regulator to step down the voltage as needed for the digital system. I'll deal with that later.

    For smaller battery packs, one option is to use 3 or 4 AA's or AAA's. Battery packs are available for these with the 2-pin PH connector. I will need to give this more thought. Any suggestions?

    To recap, there are three ways to bring in 5V: USB into the MCU, PH into the MCU breakout, or Grove into a serial connector on the breakout. Connections into an enclosure will be USB-B and barrel. A 3.3V regulator lives on the MCU module, or on the MCU breakout.

    It will be up to the user to think about how the system is powered, knowing the currents required, understanding which connections are...

    Read more »

  • MCUs

    Tom Dowad05/04/2022 at 18:41 0 comments

    There are many MCU modules available that can be easily programmed with Arduino. MCU modules are not easy to use without a breakout board, ie a board that takes the pins of the MCU or module and converts them into connectors. I prefer MCU-only modules like the Arduino Nano, Teensy, Pico, and so on. But the Uno/Mega shields are very useful in some circumstances.

    The problem with MCU modules today, is that they rarely share the same pinout. You might say, NTSP...Never Twice the Same Pinout...though that is not absolutely true. But this lack of standardization of pinouts is problematic when making electronic LEGO. Things need to be easy and not error-prone.

    The solution to too-many-standards is always to make another standard, right? So that's what I've done. My universal breakout borrows the shield concept from the Uno, though like the RPi plate, a unique name was needed. For this one, its "face". Like the Adafruit Feather, I've made one side of the face connector longer than the other, so its obvious which way to plug it in. The face connector is on a 0.1" grid but too wide for plugging into a breadboard.

    A design choice for this breakout was that it should mount in a 1U rack, with a mounting orientation that would have the face on the front panel. So its about 1.5" wide. Its contains a power supply, a few Grove connectors, a LED, some level shifters, a face bus, and a socket for an MCU module. The idea is to make one rendition per MCU module while leaving the rest of it more-or-less identical. That hasn't happened yet, but that's the idea.



    I chose to standardize the voltages per communications interface. Serial is 5V, in order to support MIDI and DMX, and there are level shifters on the board if the MCU is 3.3V. I2C is 3.3V, as there are so many sensors on I2C that require 3.3. SPI is also 3.3V because the main applications are typically SD cards, serial memories, and graphic displays which run on 3.3V. 

    Its debatable whether these voltages should be jumperable with solder bridges. It costs nothing to put a solder-bridge jumper on the board. But that opens the door to non-standard boards, leading to some confusion and possibly blown peripheral modules. I don't know. What do you think?

  • Cabling - so far

    Tom Dowad05/04/2022 at 04:21 0 comments

    As mentioned previously, I'm going for 2, 4, 6, and 10 pin connectors. These will all be 2mm pitch JST PH connectors, though the 4-pin could be Grove with the same boards. Each connector size has a ground pin, then 1/2/4/8 signal pins. For all but the 2-pin connector, there will also be a power pin, which can be 3.3 or 5 volts. The first pin is always ground, and the 2nd always power, if present. 

    I have used a 0.1" pitch 10-pin Dupont connector on the first board batches,  inspired by the need to connect to an ATSAM4S XPLAINED board. And while I've found some good cables on Aliexpress to work with this, nevertheless, I don't see the 0.1" fitting in the long run. I think the best way to deal with the will be to cut the Dupont cables in half, then crimp PH pins onto each wire and put those into a 10-pin PH housing. Crossing over the power pin which on the XPLAINED is pin 10. 

    But I wanted to talk about the set of interconnect boards. 

    Firstly, there are two boards the were already available. The Grove bussed connector board from Seeed (useful primarily for I2C expansion) and the M5 Stack Grove-to-0.1" board. The M5 Stack boards can be purchased from Digikey and are inexpensive. Its a clever design where the 0.1" side can snap off and you then have 4 holes which you can use as you see fit. I took advantage of this feature and stacked two of them, making a tap for connecting my logic analyser. One nice thing about building circuits with modules is that its easy to tap into cables for monitoring signals, kind of like test points being built-in.

    The other boards I've made could be partially summarized as convertors between the cable formats. That is, 10-to-2, 10-to-4, and 4-to-2. I would not make convertors for 6-to-4 or 6-to-2 as the 6 pin format is meant for SPI.

    I made a 4-pin merger. For any peripheral device that uses only one signal line and a 4-pin connector (eg a pot), then it might be useful to merge two of these onto one 4-pin cable. That one signal will always be on the first signal pin, and so the merger takes two of these in, and puts one signal onto signal 1 and the other onto signal 2. 

    A similar pass-thru board with just two connectors  ought to be created as a cable extender. I've made cable extenders by taking two 4-pin connectors and soldering their pins together, though this is not going to be robust so a board is better. 

    I made a board with two 4-pin connectors and resistive dividers to reduce signal voltage, typically to 2/3rds for converting 5V to 3.3V. Its a cheap way to do it, but I think I will make one using proper level shifters. 

    Something missing from this collection is a convertor from 4-pin to various 0.1" pitch pinouts. There are many modules available, for sensors, actuators, and so on, that use 0.1" pitch headers, and the pinouts vary. I believe there are 12 permutations of 4 pins to 4 pins. I tried making one with solder jumpers in a matrix, so that any in/out combination was possible. But it was too big. I want the adapter to disappear into the part. 

    One approach would be to replace the header pins with a JST XH connector, with 0.1" pitch, then make a special cable with XH on one end and Grove or PH on the other. But that seems painful. I think having a set of very small boards that cover all the useful permutations would be better. Then all of these devices can be converted to be system-compatible. 

  • Cabling System

    Tom Dowad05/03/2022 at 02:49 0 comments

    So far the cabling system consists of 2, 4, and 10 wire cables. I plan on adding a 6-wire cable for SPI. On the first pass each cable has a different connector, though I'll be changing that to be more consistent.


    The 4-pin cable is a Grove ie Seeed Studio's standard cable, which has a 2mm pitch. These can be purchased from Digikey so are easy to come by. They are good for I2C, serial, LED strips, quadrature encoders...anything requiring two wires...and also GPIOs, analog, and so on.

    The 2-pin cable is a JST PH which has a 2mm pitch. I am using these for contact closure, LED outputs, speakers, etc.  Some PH cables can be purchased on Aliexpress, but as I wanted a variety of lengths, I found a supplier using Alibaba and ordered several hundred direct from the factory. 

    The 10 pin has a 0.1" pitch and a Dupont style connector. Its 8 signal lines, power, and ground. The cables were purchased from Aliexpress. I'm finding these useful for consolidating several of the smaller connectors into a byte.

    All three styles of connector shell  have a plastic tab holding each wire, and its easy to temporarily bend up the tab, release the wire, then put it back in different position or different connector shell. I find this very useful. I've not had good luck with connectors that have a metal retaining tab.

    I am leaning toward having all the connectors PH. Then it would be easy to move the wires around between different width connector shells.  One might just as well buy the crimped wires without the shells, and put them in the shells as needed. The PH has a slightly lower profile then the Grove, which helps as space in an enclosure is often a problem.

    But the colour coding of Grove is helpful, the cables are easy to come by, and there are a variety of companies offering products using Grove. For instance, Sparkfun's I2C system, QWIIC, has a Grove adapter cable, so bridging into that system is easy. 

    Ultimately I think interconnect boards are best to come unstuffed,  soldering them together as needed. Yes that breaks the solderless concept. In practice I'm finding 1. the boards are so simple they solder together in minutes and 2. there are a variety of ways to put together a board eg using right angle vs straight connectors, male vs female, putting connectors on the other side of the board etc. Since the Grove and the PH have the same footprint, the user can make that choice when assembling. Then for instance one could bridge into STEMMA or DFRobot Gravity,  which use the JST PH as well. 

    A note regarding the connector orientation on the boards: the polarization slots should point inward, to allow for right angle or straight connectors to be used. Right angles always have the slot on the top. 

    I've made a few interconnect boards, and found a few others, I'll get into that...tomorrow.

View all 10 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates