A Host Of Sensors And Arm 0 on a Serial port

This is a USB MultiPort I  dongle that looks like a serial port to many host operating systems.  The serial port connects to an Arm 070 processor on the dongle using a simple serial protocol.    An Arm processor operates an Accelerometer/Gyro and Magnometer as well as analog or GPIO ports.

The USB MultiPort I is designed as the lowest cost board in this series of devices.  There is now as of March 2019 a USB Multi-Port II which adds 4 PWM ports for servo control.

The MultiPort I board is 20mm x 37mm before the USB jack sticks out farther as shown.   The USB jack is intentially offset so that plugging this into an end slot of a Raspberry Pi set of USB jacks does not block the other USB on the other side. All parts are on the top.

The idea here is to get a lot of very common robotic hardware IO to be accessable by simple connection to a serial port.   The CP2012 is common these days so it takes care of the USB to serial and then talks to the Arm STM32F070 M0 processor.
The Details Are Below For Those Who Are Curious
The 3D accelerometer/gyro device is the LSM6DS3 and is controled from the onboard M0 spi bus.  This is a very popular and low cost accelerometer that in my studies has shown itself to be very low noise relative to a host of other devices.   With the onboard M0 my thoughts are the processor would take care of masaging the accel/gyro data as seen fit for what the host requires for the positioning system in use.

The Magnotometer is the LIS3MDLTR which is a 3D magnometer and is also on the SPI bus for fast, reliable access.

The use of the USB to serial CP2102 allows USB to work for situations like bootloader and also offloads a lot of USB firmware as well as frees up some pins on the M0.  The CP2102 also is key in that it supplies the processor and sensors with 3.3V from the USB 5 so I like it.
By not loading a resistor you can use this board as a basic RX,TX serial port to 3.3V too.

A ROS node has been written that at this time accesses two analog readings in order to implement an analog joystick or other set of signals to be published to ROS topic /cmd_vel or to /joy.  Since this ROS node may be of use for MANY other situations I have placed it on my github here   Note that this ROS node could be used for all sorts of other things but at this time it is a simple python ROS node so is easily convertable for other uses others dream up.

A tiny 6-pin jack supplies full ST-LINK connectivity so I can debug in my eclipse environment using openOCD and can also do firmware download with ST-Link tools.
It would be possible to place the board into firmware download over serial mode but for this a wire has to go to the BOOT0 line and a switch attached so that is not fully automated over USB at this time using lines of the CP2102 such as DTR and RTS.  Maybe some other PCB rev.

At this time a very simple onboard monitor that is accessable using console with it's own commands and return formats is onboard in the firmware.  Normally for such things I use a protocol with a checksum and so on but because USB is in use the 'physical link' is very sound so I have kept the protocol extremely simple with only a few basic checks since the serial chip is under 1cm and on the same board as the processor.

I am excited about this latest Mark-Toys board as the uses extend well beyond robotics and a simple serial protocol make it highly accessable for many uses.  There are commands to read  3D  accel,  gyro, magnometer or ADC values and commands to turn on repeated reports for these for debug as of Feb 2019.   

Custom 3D printed case

USB MultiPort dongle case is offset so on one side you can still install other USB dongles or cables into the Raspberry Pi.  It is thin to allow another  USB device  below or above.

USB MultiPort Serial Commands  Version 20190507  (PWM is only available on MultiPort II)

All commands and all replies are ASCII where values are decimal ASCII representation. 
All Commands are case insensitive, start with ':' and a mnumonic/value and end in ';' or a return.

:R         Show revision and board type string
:A         Return accelerometer readings in X,Y,Z as signed 16bit decimal values separated by commas. 1G=16768
:G            Return gyro readings in X,Y,Z as signed 16bit decimal values separated by commas
:M            Return magnometer readings in X,Y,Z as signed decimal values separated by commas
:V            Returns all ADC readings in signed decimal form separated by comma. 1.0V=1220 counts
:V0           Returns voltage on A0 as a positive decimal value.   Use of v1,v2,v3 for other analog lines
:P1 000       Set PWM port to a percent of range defined by :PL and :PH. Value is in 10th of percent
              P2,P3,P4 also work.  000 = 0% of range set by PL and 999 = 99.9% of range set by PH
              PWM only of use on MultiPort II which has 4 PWM servo jacks labeled SV1,SV2,SV3, SV4
               By default PL and PH are set to 5 to 15 % true duty cycle corresponding to 000 to 999 in the :Px set commands
:PL 000       Set PWM lower true % duty cycle value in 10th of percent. 
              Set to 205 for 0.0% in a servo set setting 20.5% real duty cycle
:PH 000       Set PWM upper true % duty cycle value in 10th of percent. 
              Set to 415 for 100% in a servo set setting 41.5% real duty cycle

:DA           Continuously send accelerometer X,Y,Z every second or so
:DG           Continuously send gyro X,Y,Z every second or so
:DM           Continuously send magnometer X,Y,Z every second or so
:DV           Continuously send all voltages every second or so

MultiPort II board Using STM32F031 processor Adds  4 PWM ports

Below are shown the loaded topside of the MultiPortII.  The M0 processor has more pins and this allows support for 4 PWM ports as well as all the MultiPort I features.
The accelerometer/Gyro and magnometer (not loaded here) and ADC are all supported.

Notice the generous use of silkscreen to help identify the use of the jacks
Summary Of Simple Serial or Command Line Commands

USB A serial port is built into the MultiPort and is accessible at 115200 baud 8 bit 1 stop bit no parity settings.   By default there is very little feedback except confirm of new settings.  To see a console type of interface for manual usage enter  :C1 and then it is human friendly and shows what you type as well as other output.
Mark-World - Tech Projects To Amuse The Curious
USB MultiPort

Custom 3D printed case

USB MultiPort dongle case is offset so on one side you can still install other USB dongles or cables into the Raspberry Pi.  It is thin to allow another  USB device  below or above.