Development

Dynamixel Interface – Castellated PCB

The Dynamixel Interface is a board that allows easy communication with a MCU or Processor with a simple UART module, the board integrates a voltage level converter and a Tri-state buffer to accomplish good communication between a Dynamixel servomotor and almost any microcontroller in the market. The board is breadboard-friendly and development ready as the connection pins are 0.1″ standard pitch and the castellated holes for SMD mounting and manufactured by PCBWay.

The Dynamixel interface is now easier to connect with a bunch of microcontrollers thanks to its voltage converter IC which makes possible the communication with low-power MCUs or even FPGAs, the interface offers communication indications LED for RX and TX, as well for the flow communication pin.

The connection to the MCU is as simple as providing power to the interface and connecting the 3 pins for the UART ( CTRL, TX, and RX ). I would use the following configuration for all the newest X-Series motors as well as for the old AX and MX Series motors with any 5V to 3.3V MCU like Arduino, PIC, STM, and ESP32.

I have tested the interface with an M5Stack Stamp S3 MCU along with an ST7735 LCD showing the motor position and moving the motor with the 3 push-buttons.

The castellated holes are one of the features that I most like about the PCBWay manufacturing skills, they always come just great even when choosing thinner PCB panels, and this design was not the exception, so I ordered some panels.

If you have intentions to fabricate more than one PCB of your design I really recommend panelizing your PCB in order to obtain the best deal and to have some spares in case the magic smoke decides to take some of those boards, I usually do my panels to fit almost the same PCB space as all my panels but you can also do your panel bigger or just let PCBWay to designed for you.

In this case, I decided to design my own Panel but I am sure that you can specify how would you like your panel to be made as some special silkscreen like identifications numbers, holes, fiducials, PCB batch number, PCB side, and feed direction for your PnP and so much more.

ESP32-S3 Stick Development Board

Sometimes there are projects that need more than one piece of the same PCB or it’s a design that is probably going to be used with other projects, that is the case for my ESP32-S3 Stick controller, as the ESP32-S3 is a very powerful and versatile microcontroller with Wifi and BLE and a lot of memory I am going to be using this PCB with many projects.

If you have been following my projects you will notice that it is pretty much the same development board as the ESP32-S2 Stick but now integrating the ESP32 S2 MCU and changing all the resistors, capacitors, and LEDs from 0603 to 0402 that makes a huge change for the PCB layout process.

The ESP32-S3 is a dual-core XTensa LX7 MCU, capable of running at 240 MHz. Apart from its 512 KB of internal SRAM, it also comes with integrated 2.4 GHz, 802.11 b/g/n Wi-Fi, and Bluetooth 5 (LE) connectivity that provides long-range support. It has 45 programmable GPIOs and supports a rich set of peripherals.

The ESP32-S3 Sticks incorporate some special features that I consider every ESP32 development board must have, such as a USB-Serial converter with RX and TX LEDs, a simple GPIO-LED, and an addressable RGB LED, at a second hand is always useful to have a reset and a general purpose push button.

This board like many ESP32 boards is breadboard friendly for prototyping but it also has castellated pins that allow it to be soldered directly to other PCB like any other SMD component, so that makes it a very versatile board for rapid prototyping or development.

In order to test this new development board I have also designed a 7 Color Paper display driver that interconnects the Stick with a bed of Pogo-Pins that I bought from Aliexpress that are very easy to solder and fit the through-holes quite nicely.

I have really enjoyed working with the ESP32-S3 Stick and the Paper display, but I still have to think about a good final project for it, if you have any ideas you are welcome to leave them in the comments below.

All the files are available on my GitHub if you are interested in making one on your own or also if you want to make some improvements or specific application modifications.

ESP32-S2 Stick

After designing the nRF PRO I decided to continue using the form factor and add a more capable MCU as the ESP32-S2 that has Wifi capability with a lot of Memory for the app and data.

It is a breadboard-compatible development board featuring the ESP32-S2 series of SoC, Xtensa® single-core 32-bit LX7 microprocessor 4 MB flash and optional 2 MB PSRAM in chip package 26 GPIOs, rich set of peripherals such as UART, SPI, I2C, TOUCH, DAC, ADC, and USB, a 2x2mm SK6812 RGB serial LED and a 0603 SMD blue LED. USB-C connector, castellated holes for low-profile integrations, and an onboard PCB antenna.

ESP32-S2 Stick

I have been using this board for all my projects as it’s easier to add to all my current and old projects such as the display-Array, the Cistercian Display, and the Dynamixel Configurator.

3-Digit Cistercian Clock
Single Digit Cistercian Clock
Dynamixel Configurator

This board is very versatile as I have been able to use it easily to test any idea that I have in a protoboard before adding it to a custom PCB, also is easy to add to any new project and not having to place all of those components and having to RF match the antenna every single time. The dimensions are efficient and I love how it looks as it’s a very thin PCB.

ESP32-S2 Stick Dimensions

The board has enough pins with the correct peripheral in hand to accommodate to any project you may have.

ESP32-S2 Stick Pinout

Lately, I have been using the services of PCBWay for my projects as they have awesome customer support and great quality PCBs, I really love how they do the castellated holes for my boards in a couple of days.

ESP32-S2 Stick Panel
ESP32-S2 Stick Development board

Let me know in the comments below how would you use this board or any project idea that you would like me to explore using this board. If you need more detailed info go to my GitHub.

31 Segments Cistercian Display

I have always loved displays, I really like anything that emits light and that is controllable, that is why I have created this new display that consists of the representation of numbers “Cistercian”, this single digit is capable of representing a number from 0 to 9999.

Cistercian Numbers

The easiest way to make a display is with individual LEDs, so the design is based on 7 segments displays that we all know and several reference pictures and representations that I have seen, that is how I import those shapes to a PCB and added some 0805 LEDs. I have made these PCBs with PCBWay as they have always delivered me some awesome look castellated holes and the price is pretty low, even for this panel that has 3 ENIG-finish PCBs with castellated holes.

Cistercian Displays 0805
Lighting a segment

After playing with this new hardware I realized that is inconvenient to use that many GPIOs in order to control the desired number to set in the display and there are a lot of LEDs controllers available in the market, also RGB LED controllers over SPI or I2C, so I have make some changes to the PCB and instead of having a common cathode pin is better and there are more controllers with common anode.

The controller that I have decided to use is a simple serial to parallel converter from LUMISIL and embedded in the same PCB routing fewer pins to the castellated holes and making it easier to use overall, and also has the possibility to set a custom constant current source for the LEDs.

Another alternative that I might implement is to use 3D printing to do the front face of the display as it will result in more customizable in terms of colors and non the standard PCB colors, I have also tried the Flexy-Pins for connection with the castellated holes.

3D printed display and Flexy-Pins connecting with the castellated holes

If you are looking to create your own PCBs I do really recommend using PCBWay and their Online Gerber Viewer as it has saved me from making a lot of mistakes in the past.

PCBWAY Gerber Viewer

Display Array Clock Firmware

For this clock project, I’m using a Raspberry Pi Pico, but the code should be easily ported to any other microcontroller, as the functionality of the clock itself is basic. The Raspberry Pi Pico has a built-in RTC so results easier to implement the clock. Other Microcontrollers with Wifi Capabilities could also obtain the clock data from a web service instead of an intrnal RTC making the board capabilities more atractive as weather or many other kind of IOT notificaions.

The firmware uses already converted images to have the nicest look, this could also be done with a Numerical Font and interchangeable backgrounds but I think it would not look this great.

For the image conversion, I use the software LCD Image Converter which is a very useful piece of software, fo the displays in the Display Array Board I use RGB565 and copy the data to *.h file in my project.

Image conversion

By clicking the button Show Preview we have access to the data Image to add to our project and send it to the display.

Image Data

After converting all the images for the clock we just need to call the corresponding image and send it to the corresponding display, for this, I have just used some simple if statements.

if(t.hour >= 1 & t.hour <= 9){
          lcdDrawNumber(pio,sm,display1,0);
          lcdDrawNumber(pio,sm,display2,t.hour);
       }else if(t.hour >= 10 & t.hour <= 12){
          lcdDrawNumber(pio,sm,display1,1);
          lcdDrawNumber(pio,sm,display2,t.hour-10);
       }else if(t.hour >= 13 & t.hour <= 21){
          lcdDrawNumber(pio,sm,display1,0);
          lcdDrawNumber(pio,sm,display2,t.hour-12);
       }else if(t.hour >= 22 ){
          lcdDrawNumber(pio,sm,display1,1);
          lcdDrawNumber(pio,sm,display2,t.hour-22);
       }else if (t.hour == 0){
          lcdDrawNumber(pio,sm,display1,1);
          lcdDrawNumber(pio,sm,display2,2);
       }

After doing this for minutes, AM, and PM screens we can add some animations by sending the Space image and the colon symbol image at different rates, and also this can be applied to the configuration state of the clock.

if(ConfigureTime_MODE == OFF){
         lcdDrawNumber(pio,sm,display3,COLON);
         sleep_ms(500);
         lcdDrawNumber(pio,sm,display3,SPACE);
         sleep_ms(500);
      }else{
         if(Selection  == HRS){
            sleep_ms(200);
            lcdDrawNumber(pio,sm,display1,SPACE);
            lcdDrawNumber(pio,sm,display2,SPACE);
            lcdDrawNumber(pio,sm,display3,COLON);
            sleep_ms(200);
         }else if(Selection == MINS){
            sleep_ms(200);
            lcdDrawNumber(pio,sm,display3,COLON);
            lcdDrawNumber(pio,sm,display4,SPACE);
            lcdDrawNumber(pio,sm,display5,SPACE);
            sleep_ms(200);
         }
      }

Resulting in an animation like the following:

Matrix Clock Animation

Raspberry Pi Pico connection with Display Array Board

Raspberry Pi Pico and Display Array Board

Posible error in the Pico SDK

There is a chance that your pico-SDK has an error and the program would not start. In your SDK directory: pico-sdk/src/common/pico_time/time.c file comment line 17, //CU_SELECT_DEBUG_PINS(core) and now the program should run with any problem.

#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include "pico.h"
#include "pico/time.h"
#include "pico/util/pheap.h"
#include "hardware/sync.h"
#include "hardware/gpio.h"

CU_REGISTER_DEBUG_PINS(core)
//CU_SELECT_DEBUG_PINS(core) //Comment this line for RTC troubles

const absolute_time_t ABSOLUTE_TIME_INITIALIZED_VAR(nil_time, 0);
// use LONG_MAX not ULONG_MAX so we don't have sign overflow in time diffs
const absolute_time_t ABSOLUTE_TIME_INITIALIZED_VAR(at_the_end_of_time, ULONG_MAX);

typedef struct alarm_pool_entry {
    absolute_time_t target;
    alarm_callback_t callback;
    void *user_data;
} alarm_pool_entry_t;

Below you can download the source code of this clock and also the Precompiled UF2 File. The media files can be downloaded on the previous post.


image/svg+xmlOpen Source Licenses HardwareSoftwareDocumentationCERN-OHL-P-2.0GPL-3.0-or-laterCC-BY-4.0


Download

SPI Display Array Board – Clock

The main idea of this project was to make a customizable clock, a clock that would have the option to change its appearance very easily, The first option was to make it with RGB LEDs and change the color at will, maybe to have the ability to change the color according to the time of the day or with the ambient temperature, but what is more customizable than a display by itself, nowadays we can find very nice IPS Displays that are very cheap.

Maybe the hardest step of this project was the clock creation, making the graphics for each clock was really challenging as I wanted to look very similar to the real ones, like the Flip Clock, the seven-segment Display clock, the LED matrix clock.

Flip Clock
LED Matrix Clock
7-Segments Display Clock
Blue VFD Clock
Ink Clock
Wood Clock

These are only a few clocks that I have created, but it will be awesome to see other designs and that is why I’m sharing the design files of this project, I think it would be awesome to see how a project can evolve in the maker community.

I have also designed a 3D printed enclosure or in this case a frame. It consists of only 3 parts that glued together to make a single clock piece.

3D Printed clock bracket

The PCB is intended to be compatible with any Microcontroller or SBC like the Raspberry as it only needs some GPIOs and an SPI Port. This makes the PCB compatible with a simple microcontroller as an Arduino to other more advanced microcontrollers. We could say this board is a breakout board for the arrangement of six displays and 4 buttons.

SPI Display Array Board CAD

Testing the clock designs

Before writing the clock firmware I decided to test all the designs that I have already created on the computer, so using the Raspberry Pi Pico I have written a simple program that allows me to set an image for each display in order to simulate how the clock would look like.

The code for this simple task consists of the initialization of the displays and just sensing the raw data of each image to the corresponding display.

#include "pico/stdlib.h"
#include "hardware/gpio.h"
#include "hardware/pio.h"
#include "ST7735.h"

#include "clockDigital.h"
#include "clockFlip.h"
#include "clockMatrix.h"
#include "clockVFD.h"
#include "clockInk.h"
#include "clockWood.h"

#define ONBOARD_LED 25
 
int main(){
    stdio_init_all();

    PIO pio = pio0;
    uint sm = 0;
    uint offset = pio_add_program(pio, &SPILCD_program);
    lcdPIOInit(pio, sm, offset, PIN_SDI, PIN_SCK, SERIAL_CLK_DIV);


    gpio_init(ONBOARD_LED);
    gpio_set_dir(ONBOARD_LED, GPIO_OUT);

    gpio_init(PIN_CS1);
    gpio_init(PIN_CS2);
    gpio_init(PIN_CS3);
    gpio_init(PIN_CS4);
    gpio_init(PIN_CS5);
    gpio_init(PIN_CS6);
    gpio_init(PIN_DC);
    gpio_init(PIN_RST);
    gpio_init(PIN_BLK);
    
    gpio_set_dir(PIN_CS1, GPIO_OUT);
    gpio_set_dir(PIN_CS2, GPIO_OUT);
    gpio_set_dir(PIN_CS3, GPIO_OUT);
    gpio_set_dir(PIN_CS4, GPIO_OUT);
    gpio_set_dir(PIN_CS5, GPIO_OUT);
    gpio_set_dir(PIN_CS6, GPIO_OUT);
    gpio_set_dir(PIN_DC, GPIO_OUT);
    gpio_set_dir(PIN_RST, GPIO_OUT);
    gpio_set_dir(PIN_BLK, GPIO_OUT);

    gpio_put(ONBOARD_LED, 1);
    gpio_put(PIN_CS1, 0);
    gpio_put(PIN_CS2, 0);
    gpio_put(PIN_CS3, 0);
    gpio_put(PIN_CS4, 0);
    gpio_put(PIN_CS5, 0);
    gpio_put(PIN_CS6, 0);
    gpio_put(PIN_RST, 1);
    lcdInit(pio, sm, st7735_initSeq);
    gpio_put(PIN_BLK, 1);

    lcdStartPx(pio,sm);

    for (int i = 0; i < 160*80*2; i++){
       lcdPut(pio, sm, one_Flip[i]);
    }

    gpio_put(PIN_CS1, 1);
    for (int i = 0; i < 160*80*2; i++){
       lcdPut(pio, sm, two_Matrix[i]);
    }

    gpio_put(PIN_CS2, 1);
    for (int i = 0; i < 160*80*2; i++){
       lcdPut(pio, sm, three_Digital[i]);
    }

    gpio_put(PIN_CS3, 1);
    for (int i = 0; i < 160*80*2; i++){
       lcdPut(pio, sm, four_VFD[i]);
    }

    gpio_put(PIN_CS4, 1);
    for (int i = 0; i < 160*80*2; i++){
       lcdPut(pio, sm, five_Ink[i]);
    }

    gpio_put(PIN_CS5, 1);
    for (int i = 0; i < 160*80*2; i++){
       lcdPut(pio, sm, six_Wood[i]);
    }
}

For the SPI Display Array clock Firmware go to the Part2 of this project.


image/svg+xmlOpen Source Licenses HardwareSoftwareDocumentationCERN-OHL-P-2.0GPL-3.0-or-laterCC-BY-4.0


Visit my Tindie Store for the assembled board.

Download


Dynamixel, Smart motor configurator

There has been sometimes that it has been hard to communicate with this type of smart motors, I don’t always remember the set ID or even the last configured baud rate for serial communication, or even the simple task of changing a single parameter requires to write a custom program to change that value to that specific motor, for that reason I decided to start building a handheld device that will make this kind of tasks easier and faster.

A simple UI in a TFT LCD will let configure these motors in a few steps, the project is going to integrate electronics used in other of my projects to make this development easier and faster, hoping to have feedback from the robotics community who have work with this kind of motors by letting me know the best path to follow.

In this first step I will have a first approach for the graphical interface, here are some ideas that I have tried, and the most recent one.

I will be using an ST7789V controller 2.8 inch TFT LCD for this project as I think it is a good size for the data it will work with. I will also be using the MK26F microcontroller that I have in a Feather format and a Dynamixel interface board for communication with the motors. So it needs to be all wired, connecting the SPI, ADCs, and GPIOs from the feather board to the TFT LCD Breakout board.

I have added some interesting things to the graphics for a more fluid and friendly interface as movement on the main menu icons, as shown in the next picture.

I have noticed that there are a lot of Dynamixel motors, the classic AX-12A use the protocol V1.0 but the newer one uses the V2.0 and also they change some registers address making this whole idea a bit difficult, I am still thinking how many motor models this device will support, as a first step I will make the firmware ready for the AX-12A and the XL-320 as I think are most popular one and also the cheapest.

The first step is to port the Dynamixel library for Arduino that I wrote many years ago to my microcontroller and then also update the library to be compatible with the V2.0 Dynamixel protocol.

So there are some slight differences between registers address and all of this have to take in count when showing the info the configurator, so I have started to register this tables in a model file and maybe would be updated in a more compressible file in the future.

Motor scanning and selection menu

In order to test or modify the motor register, we need to scan and select the connected motors, for this task I have created a short function that Ping the bus and waits for each motor ID, and adds it to the motor list at a given baud rate and protocol.

for(motorID = 0; motorID < 254; motorID++){

             if( !(Dynamixelping(motorID,protocol) == -128) ){

                    motorList[motorIndex++] = motorID;

             }

             displaydrawRectangle(64,0,((motorID*240)/253),4,GREEN);

}

After the motor scanning, it’s useful to know certain values of the motor so I decided to read these and display them in the same window with the capability to scroll the motor list and at the same time select the motor of interest.

Configure Registers Window

In this window will be able to read and write directly to register of the selected motor in the previous windows, it will be accessible to both the EEPROM and RAM registers in order to properly test the written values, limits, or alarms.The new values will be written on a numerical touchscreen keyboard.

This window also shows if the EEPROM data is write-protected, in order to write the torque of the motor should be disabled, this can be done by writing a 0 to the Torque Enable register in address 24.

Factory Reset Window

The factory reset window is a simple but very efficient way to restore motor parameters to factory defaults with a press of a button.

This option will perform a reset function on the Dynamixel instructions set, so all it been handled by the motor itself, the motor list is also accessible from this window but it has to be in consideration that motors should not have the same ID as it can cause errors in the communication.

When a reset has finished successfully this window will also inform and will let you continue with the reset operations that you may need for other motors.

Configuration Window

The configuration windows allow to change the Baud rate speed, the Dynamixel protocol and perform a touchscreen calibration if needed.

As you have already noticed the touchscreen calibration options are accessible with the tact switches in case that the touchscreen values have changed over time, the only action that needs the touchscreen is the keyboard on the register configuration window.


Download

nRF52832 PRO Panel

This is a new project using the nRF52832 BLE MCU as a very versatile development platform that will allow me to do many projects that requires a connection over Bluetooth and also can perform actions to control basic systems, as data acquisition, data display, motor control, graphical interfaces and much more.

This board dimension is 48x18mm with 30 castellated holes on the side, a micro USB connector for power, and programming through a USB to serial converter CP2104, two tactile switches for user interface and firmware programming, 1 user LED.

I have made a small panel for easy fabrication, This panel dimensions are 92x66mm including the tooling rails at the sides. In this panel I want to test several things that a usually do not order in a regular PCB, such as tooling rails with tooling holes, external fiducial, Logo with EING finish at the top tooling rail, solder mask and cooper restrictions for text and logos, and castellated holes in a routing job, v-score at the edges of the board as well on the tooling rails.

I quoted this panel in many PCB Manufacturing houses and order some boards for the best price in the market that includes all the characteristics described above with PCBWay. (Even cheaper than the well-know 2 USD – 5PCS PCB Manufacturing House).

These board are now getting manufactured, the customer service has been awesome so far, as I ask to place the UL Marking on the Top Silkscreen layer in the bottom layer of this panel and received a preview of confirmation of this requirement, and received awesome feedback regarding the Vscore and Solder mask capabilities.

Making this board possible required some knowledge in PCB Manufacturing that I will below describe the research and application.

Castellated Holes: Also know as castellations are plated through-holes or vias at the edge of a board cut in the middle by a router making them pads that can be soldered to another PCB and make subassemblies.

The PCBs have finally arrived, here are some photos.

If you are thinking about ordering some PCBs and start your own prototypes I recommend you to try PCBWay.

https://www.pcbway.com/

MKL26 and MK26F Feather prototyping boards

Most of the Adafruit Feather use microcontrollers from Atmel, Esspresif and Nordic and it’s hard to find them with other brand microcontrollers, There are some feathers with the newest NXP Crossover MCUs, and that is why I have decided to add some MID-Range and Low power consumption ones.

The MKL26 Feather is a board that packs the NXP/Freescale MKL26 which has an ARM Cortex M0+ core at 48Mhz with 256kb of Flash and 32Kb of RAM. The board includes a microSD socket and RGB LED.

The MK26F Feather is a board that packs the NXP/Freescale MK26F which has an ARM Cortex M4F core at 180Mhz with 2Mb of Flash and 256Kb of RAM, it also has an RGB LED and socket for microSD but with an SDHC interface instead of SPI.

Having the Adafruit Feather format it’s very useful in case that you are working with other microcontrollers with different characteristics and this way it is easy to switch for project capabilities expansion.

I will use these boards with other projects to show you what kind of applications we can do with them. If you are interested you can purchase them at my Tindie Store.

MK26F Development Board

I personally like to work with NXP/Freescale microcontrollers, and that is why I have designed a development board with the intention to also expand to other brands of microcontrollers.

I have called this board a Pyramid, stating with the MK26F2M0VMD18 which come in a BGA144 footprint with a pitch between balls of 1mm, This MCU is a very nice microcontroller as its an ARM Cortex M4F with a CPU clock of 180Mhz in the High-Speed mode configuration with 2MB of Flash memory and 256Kb of SRAM. The board that I have designed includes an SDRAM of 16MB and an SDHC socket for SD Cards.

This board also includes a USB2.0 Host connector a couple of notification LEDs and an RGB LED. The board can be programmed through the JTAG/SWD port or by installing a USB Bootloader.

To this development board, I have also designed some boards called Blocks that will be swappable between the other brand MCU Pyramids.

If you are interested in this project please let me know in the comments section below.