The Squid! Open robotics control module.

The Squid! Open robotics control module. Bluetooth, I2C or Serial interfaced for easy Human to Machine or Machine to Machine interface.

Similar projects worth following
The Squid is a module designed to interface with any controller with either Bluetooth, I2C or a serial port to control up to 16 small dc motors or up to 8 stepper motors. 16 ports can also be configured as analog inputs, digital inputs or digital outputs for feedback potentiometers, bump switches or LEDS, while also allowing a standalone mode to operate a bot without an external controller.

To make Squid as flexible as possible, the Squid will have three interface options to receive commands from an external controller. The options are Bluetooth, I2C and a serial port.  Commands will be simple, such as “m1f” meaning motor 1 forward.  A configuration page can be accessed via Bluetooth to configure Squid’s motor ports and I/O ports. The Squid can also be run in a standalone mode to allow users to control a bot without an external controller. Users will be able to directly program Squid’s PICs via ICSP (In Circuit Serial Ports) using “C”. Squid has 16 h-bridges that can individually drive small DC motors (800mA per channel) or two h-bridges can be combined to drive a Step motor. In addition, 16 I/O ports can be configured as analog inputs (default) or as digital inputs or digital outputs.

To allow other users to experiment with the Squid board, each PIC will have an in-circuit serial programming port.  The sub routines to handle all the features like usart for the Bluetooth and serial interface, I2C to communicate between the 2 PICs and other peripherals, A to D converter will be provided as an include file.  This will allow other makers to program the Squid to control whatever project the user wants to experiment with while easing the work load by already having callable sub routines to use the on board features.

The default configuration for the 16 H-bridges will be as individual drivers to control 16 individual small dc motors.  A configuration option will be provided to allow two H-bridges to be “bonded” as a 4 channel driver to control either a 4 phase unipolar step motor or a 4 phase bipolar step motor.  In case the 16 H-bridges is not enough, an I2C interface will allow the Squid to interface with other Squid boards or other peripheral devices.

The image below shows typical connection.  Configurable inputs--the LED shows a digital output, the potentiometer shows an analog to digital input and the switch shows a digital input.  The configurable motor drivers show a connection for a step motor and connections for small DC motors.  The idea is to make an easy to use robotics motor control board to Bluetooth to higher level controllers, such as a Raspberry Pi.  There is also a serial port for controllers without a Bluetooth module, plus plenty of available onboard FLASH memory can be programmed for standalone operation to allow the Squid to control a robot without a higher level controller.



Board layout

Software subroutines for MicroChip PIC onboard resources.

  1. USART interface for Bluetooth and direct connect serial interface.
  2. I2C interface to communicate between the PICs and other peripherals.
  3. Analog to digital converter.
  4. EEPROM routine to store to and read from PIC onboard EEPROM for configuration data.

Software routine to control small DC motors.

Software routine to control four phase unipolar step motors.

Software routine to control four phase bipolar step motors.

Software routine to organize I2C devices.

Software routine to receive and save configuration data.

Software routine to interpret commands from an external controller.

The videos below shows the Squid as a stand alone controller.


Squid schematics

sch - 75.47 kB - 04/20/2018 at 02:14


  • 2 × Microchip PIC16F874A-I/PT
  • 18 × TERMINAL BLOCK HEADER,2-POS,0.200"/5.08MM
  • 18 × TERMINAL BLOCK HEADER,3-POS,0.138"/3.5MM

View all 8 components

  • The First test of Squid in a robotics application.

    Dennis06/04/2018 at 02:40 0 comments

    Here’s the first test of Squid in a robotics application. Although Squid is designed to be controlled by an external controller such as a Raspberry Pi, Squid can also operate in a standalone mode.  In this video, Squid is controlling a simple insect-like robot using layered behaviors. With a lot of onboard resources, I can think of a lot of add ons I might add to the robot. I have additional updates I want to add like I2C and analog to digital conversion, but with the first operational Squid, I wanted to jump ahead a bit and place Squid on a robot. Below are a couple of pictures of the bot with Squid as its controller. The robot can now also very easily be controlled through a Bluetooth connection.

  • The first assembled Squid

    Dennis05/30/2018 at 02:36 0 comments

    Here is the first assemble Squid shown with the Bluetooth module installed. Now it’s time to start testing it on some robotics project.

  • Testing the Bluetooth

    Dennis05/28/2018 at 15:21 0 comments

    Connecting a PIC to a Bluetooth module opens up a lot of possibilities for robotics. Here is the test setup for Squid. In an earlier post, I was using a 4Mhz crystal I switched to a 20Mhz for the PICs clock. In the image below, I’m using a JY-MCU Bluetooth module the HC-5 version. The Bluetooth module is connected to the PICs USART pins with two 10k ohm resistors to divide the PICs TX voltage from 5 volt to 2.5 volt. A safe level for the Bluetooth module while still a high enough voltage to be a logic level 1.

    In “int main” I added the following two lines of code to test the Bluetooth connection.



    This will transmit a “b” every second, and since the interrupt is enabled, any characters sent to the Squid will mirror back to the computer that is connected through Bluetooth to the PIC.

    Next, we need to “pair” the Bluetooth to a computer. Power up the test setup, and on the computer, go to the Bluetooth devices. Highlight HC-05 and click “pair”.

    Enter the passcode for the Bluetooth module in this case “1234” and click “NEXT”.

    And we are connected.

    Next, we need to find our COM port. Open Bluetooth devices and click “Bluetooth Settings” and “COM ports”. There will be two COM ports--an incoming and an outgoing.

    I’m using Putty as a terminal, so the next step is to open Putty and click the serial radio button, enter the outgoing com port and BUAD rate (speed). 

    If Putty fails to connect, try opening Putty and connecting to the incoming Com port then close Putty, open Putty again, and then try connecting to the outgoing COM port. I ran into this problem…I’m not sure why, but it worked.

    Once connected, the below screen should appear. A “b” is being received every second, and every key I press is being mirrored back…SUCCESS!!!

  • Writing code for the USART.

    Dennis05/16/2018 at 02:27 0 comments

    First, we need an area to start coding.  After the project has been created, click “File” in the upper left hand corner and then click “NewFile”. The box below will pop up. Highlight “C” and then “C Main File” and finally click “Next”.

    In the next box, you can name the page.  I called mine sqmain.  Then click “Next”.

    We now have a page to code on.

    Next, include the h files.  I also “defined” a crystal frequency “XTAL_FREQ” as 20 Mhz to be used in later time delays. Also define a couple of subs “void usart_setup(void);” and “void usart_write(char);”. Both sub-routines are self-explanatory. The setup sub-routine will be used to setup the PICs USART and the write will transmit the “char” data. I didn’t define a receive sub-routine because I will be using an interrupt to receive data. The configuration for the PIC is also shown below. I also created an array “char uart_receive_array[10];”to save data being received by the usart. 

    Below is the “usart_setup” sub-routine.  I know I should set it up to calculate changing the buad rate, but for now, this will get the USART running.  The buad rate is set to 9600 which is the Bluetooth module’s initial speed.  The USART will be in asynchronous mode, and transmit and receive will be continuously enabled.

    Below is the transmit sub-routine.  Short and simple, call the sub with “usart_write('a');” and the usart will transmit an “a” and wait for it to complete.

    Finally the interrupt.  For now, just the usart receive interrupt is handled, but additional interrupts can be added as needed. When an interrupt is generated, the interrupt handler below will disable global interrupts “GIE = 0;” and check for the interrupt that was generated. If the USART receive interrupt was generated, each data register in the array will be moved to the next highest register. The lowest register “uart_receive_array[0]” will receive the new character being received. The character will then be sent to the write sub-routine “usart_write(uart_receive_array[0);” to acknowledge that the character has been received. I will be adding code to decode the received commands in future updates.  Before exiting the interrupt handler, the global interrupts are re-enabled “GIE = 1;”.

    These bits will need to be set in the “main()” routine to enable the USART received interrupts.

        RCIE = 1;                                   //Enable interrupt on receive data

        PEIE = 1;

        GIE =1;                                     //Enable interrupt

    After testing, it seems to be working.

  • Test set up to write and test code.

    Dennis05/08/2018 at 00:18 0 comments

    When starting a new program, I like testing each individual sub-routine and function on a solderless breadboard setup. This can help work out problems while reducing the risk to the fully assembled circuit board. Below is an image of a quick and easy setup for testing. I’m using a PICKIT 3 to store the program in the PIC. The USART and I2C pins are easily available to test connections to other devices.

    For an IDE (Integrated Development Environment), I’m using MPLABX v3.05 with XC8 as the compiler.  I was debating about writing the program in assembler but decided to use “C” since more people are familiar with “C”.

    For anyone new to the wonderful world of MicroChip PICs, here is a quick run through of starting a new project. First, open MPLAB, click on “file” and click “New project”. Highlight “Microchip Embedded” and “Standalone Project” and click “Next”.

    Select the device you are going to use. In this case, PIC16F874A and click “Next”.

    Select your programmer and click next.

    Select the compiler you are going to use and click “Next”.

    Type the name of your project, select a file location and click “Finished” and you have created a new project.

  • Preliminary board layout

    Dennis04/22/2018 at 20:04 0 comments

    I finished the preliminary circuit board layout. I still need to check and double check everything before exporting it to Gerber files and ordering boards. 

  • Preliminary Schematics

    Dennis04/20/2018 at 02:11 0 comments

    I finished the preliminary schematics.  I’ve decided to base the first Squid prototype around two PIC16F874A controllers.  The two PICs will communicate to each other and also other off board peripheral devices via an I2C interface.  PIC one will be able to communicate with higher level controllers with a Bluetooth module through the PICs onboard USART.  The second PIC will be able to communicate to higher level controllers through a direct serial interface via again the PICs onboard USART.  Using two PICs will supply the resources to handle the 16 individual H-bridges and 16 I/O ports.

    The Squid board will be fairly small even though the schematics are in two sheets.

View all 7 project logs

Enjoy this project?



malvasio.christophe wrote 04/23/2018 at 07:19 point


i didn't ask :

how many amps per phase it will support ?


  Are you sure? yes | no

Dennis wrote 04/23/2018 at 10:12 point

800 mA on this one but a higher amp version will not be too difficult.

  Are you sure? yes | no

malvasio.christophe wrote 04/24/2018 at 00:36 point


so you target 800 ma on the wheeled walker

i have some nema 23 400 step/r ~360 ma at 12.1v

how much your unit price of squid ?

  Are you sure? yes | no

Dennis wrote 04/25/2018 at 01:35 point

There is still a lot of work to be done but probably around $50

  Are you sure? yes | no

malvasio.christophe wrote 04/16/2018 at 06:11 point

will the eeprom store be avoided ?(if wanted)

will it come usable without soldering to do ?

  Are you sure? yes | no

Dennis wrote 04/17/2018 at 02:24 point


 The board will have a default setting for 16 dc motors and 16 analog inputs. The EEPROM will only be used if the configuration is changed from the default setting. If the configuration is changed it will automatically be stored in the PICs on board EEPROM. Hopefully there will be fully assembled versions available eventually.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

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