LMIC ESP8266 Hardware Motor and Safety Circuit Test


The LMIC board contains principally a L6205 DMOS Full Bridge DC Motor Driver and Hardware Safety Circuit, controlled from an ESP8266.

The Hardware Safety Circuit on the LMIC board, continually monitoring the L6205 for an over-load (Linear Motor Jam for example) , shorted output, thermal trip, cross conduction protection, voltage lockout.  Upon a fault, the SFLAG net is pulled HIGH.


L6205 Block Diagram example.


Schematic Snippet



Photo Normal boot display example.


All LMIC boards are tested, as part of production, using the below code which can be found in the GitHub repository.  ‘LMIC-1_Test_Code_Bring_Up_Hardware_Test’

  • The Motor Driver is capable of controlling DC motors with up-to 6A total load current, spread across the three output terminals.
  • The LMIC Board has a SMT 6A (Time Delay/Slow Blow) fuse, on the board (BEL 0685T6000-01 1206)
  • The Safety Hardware Circuit will pull the SFLAG HIGH, upon a detected fault.  It is up to the code, to determine what to do with it.
    • SFLAG is connected to the ESP8266 GPIO12 and this should be monitored.

In the ‘LMIC-1_Test_Code_Bring_Up_Hardware_Test’ code, you will see a function which is used for a custom delay timer (DelayFaultCheck), which in turn calls every millis, the hardware monitor (FaultConditionCheck).  The reason for this fast safety checking is to catch an error very quickly, so not to damage either the LMIC board, or what-ever the DC Linear Motor is connected too.

Note: The example code could be updated and the SFLAG GPIO14 monitored using an interrupt. This could be external or pin change, using example

attachInterrupt(14, ISR, Mode);


The DelayFaultCheck routine simply cycles, based on millis (1000 millis per second), to derive a required time period in seconds.  So DelayFaultCheck(2);  will simply delay for 2 seconds.  However, throughout the 2 seconds, on every millis, the code will call FaultConditionCheck.

The FaultConditionCheck routine monitors the Safety Circuit SFLAG net on GPIO14.  If it is LOW, will continue as normal.  If it is HIGH , then the code will essentially:

  • Set a pause, to reset the WDT (Watch Dog Timer)
  • Force the Motor Driver IC to be disabled.  Both outputs are set LOW – Motor stops!
  • Status LED flashes 20 time as an alert
  • OLED and Serial Output message updated
  • Restart the ESP8266
  • Cycle repeats

Two important options are included in the FaultConditionCheck routine.  This pertains to ‘Check EN_1’:.

  • If HIGH, the board will restart on a fault,  upon a automatically Soft or manual Hard Reset.
  • If LOW, the board will LATCH on a fault and the only way to Enable the Motor Driver, is a Power Cycle or Hard Reset.

The OLED has been setup to demonstrate the fault.


OLED examples displaying normal running and cycling of the Motor Driver output.








OLED examples displaying a hardware Safety Fault.  The right display, shown the Latched option enabled.


The test code will in either option, force an automatic soft reboot of the ESP8266.  You can decide what to do after, as you develop the code for your application.



Important Foot Note.

These Wiki pages are MOVING to the GitHub Wiki.   Simply select a repository pertaining to the board and click Wiki.


Other Details

Further information on this product may be found in our downloads and Wiki pages.  Other technical information and code examples are also shared in our GitHub Pages.  Project information may also be found on

We value our customers and should you have any other questions, please feel free to contact us.


Leave a Reply

This site uses User Verification plugin to reduce spam. See how your comment data is processed.

Cart Summary (Discounts shown at checkout)

    Product Price Quantity Subtotal

Basket totals

Subtotal £0.00
Total £0.00