element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Project14
  • Challenges & Projects
  • More
Project14
Make a Connection Full Duplex Morse Code using the BBC micro:bit V 2.2
  • News
  • Member Updates
  • Competitions
  • Forum
  • Documents
  • Theme Suggestions
  • Polls
  • Members
  • More
  • Cancel
  • New
Join Project14 to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Erik.H
  • Date Created: 13 Sep 2026 1:37 PM Date Created
  • Views 41 views
  • Likes 2 likes
  • Comments 1 comment
  • https://au.element14.com/bbc-micro-bit/mefv22g/sbc-bbc-micro-bit-v2-21-go-bundle/dp/3847342
Related
Recommended

Full Duplex Morse Code using the BBC micro:bit V 2.2

Erik.H
Erik.H
13 Sep 2026

Hey, If you are going to "Make a Connection", why not make the communication "Full duplex" or both directions at once. So that it has at least 2 paths, no waiting and real time speed. This is a project I created this year for an OzBerry presentation for Science Week at Chatswood Library using DeepSeek AI. I thought it would also be perfect for showing off what the BBC micro can do for this Element 14 competition as well.

Overview

A two‑way Morse Code communication system built around the BBC micro:bit boards, a Tkinter dashboard running on my Laptop screen, and a serial link (USB port). It lets an operator key Morse Code by hand, decode Morse from a remote station, and send typed text out as Morse automatically — with live LED feedback, timing statistics, and self‑correcting timing algorithms. The tricky part is the timing !  We need to convince the BBC to send in both directions at the same time on the WiFi link while using the USB port all at the same time. We cheat by using time division multiplexing, several program threads and we also use actual time stamps in the message format to get around most of the various delays inherent to such a system. Morse Code timing is critical especially if we need to adapt to human sending not just computer sending. A one direction link will probably fail if we just send a key down message and a key up message at say 40 Words per minute. I think I can now send in both directions at once at about 5 Words Per Minte to about 45 (or more) WPM. I also have allowed for Farnsworth timing where characters are sent faster than normal. A common practice that allows extra "human thinking time" between letters. 

Preferred Hardware

  • Two micro:bit boards running MicroPython (main_v853_relay.py):

    • Master – connected to the PC via USB; UART output enabled.

    • Remote – battery‑powered; UART permanently disabled. I use my LED Light Power Bank or a different Laptop for power.

  • Morse Key on pin8 via an optional driver board (plus button_a as a parallel key). You don't need a proper key, but it is nice when you do have some different ones to choose from.

  • Relay output on pin16 via an optional driver board (follows key state). A fast relay is required, you can hear mine do not keep up at very high speed !

  • nRF51 radio link between the two boards (group 7, 1 Mbit/s). I chose WiFi because Bluetooth is too slow and has other problems as well.

  • LED matrix on the micro:bit shows local/remote key state, TX/RX, role, and heartbeat.

  • Optional power supply to power the relay/s connected to the optional Driver Board.

Firmware Features (v8.53) - flashed to the bbc:Microbit.    I use https://python.microbit.org/v/3

  • Fixed roles – master always master, remote always slave. No negotiation, no dual‑master. This was an issue because roles sometimes reversed on noisy channels.

  • TDMA timing – master transmits M<state> every 30 ms; slave replies S<state> 5 ms after each M. Slave re‑syncs on every beacon.

  • Interference handling – non‑M/S packets are dropped; up to 10 junk packets flushed per burst.

  • nRF51 hardware watchdog – 8 s timeout, resets the CPU on hard lock‑up. This may or may not work :(

  • Radio force‑reinit every 2 minutes; automatic reinit if radio‑send throws. May or may not work :(  However it seems to be OK now and quite stable over time.

  • Radio silence supervisor – reinit after 5 min of no traffic, reset after a further 1 min.

  • Memory monitoring – gc.collect() every 30 s; reset if free RAM < 4 KB. Yet another hack to keep it stable. We may not need this Garbage Collection anymore ?

  • UART protection – master streams only essential lines (E,L…, E,R…, DONE, MEM:); remote never writes to UART.

  • Audio sidetone – 800 Hz local (master), 600 Hz local (slave), 1000 Hz remote; only updated on frequency change. Sounds nice together.

  • Labels reduced to a minimum so the firmware shrunk by I think about 30% to make it fit. It was a necessary evil I am afraid.
  • Special Key de-bounce - not the standard one because it is too slow.

Dashboard Features (dashboard_v840.py)

Decoding

  • Adaptive Morse decoder for both local and remote streams.

  • Automatic unit tracking – median of recent dot/dash durations, Exponential Moving Average smoothing.

  • Cluster detection – char vs word gap clustering with sanity limits.

  • Retro correction – first character of a burst re‑evaluated once enough dots/dashes are seen.

  • Consecutive‑character rule – 6 identical decoded characters triggers a forced halve‑speed reset.

  • Auto‑recal – compares measured dash vs expected; lazy recal or full reset as needed.

  • Manual “Recalc Speed” button and optional Cheat mode (locks both decoders to the typed WPM).

Sending

  • Four message slots with Send buttons.

  • Typed text encoded to Morse, sent to the micro:bit as F<wpm>,<farnsworth>T<text>.

  • Fallback timeout if no DONE arrives.

  • Repeat mode – resends the last message every 2 s.

  • Abort button sends X to stop the micro:bit.

Display

  • Local/Remote key LEDs with drop‑shadow styling (green/blue).

  • Timing statistics table (dot, dash, intra‑char, char, word gaps) with target and % error rows.

  • Decoded Text panes for local and remote, colour‑coded, with per‑side Clear buttons.

  • Speed labels showing live WPM estimates for both sides.

  • Debug Log window (toggle button) – buffers up to 500 lines.

  • Clear All wipes decoded text and the debug log.

Persistence

  • Window geometry, left‑panel width, message slots, cheat flag, and debug‑window geometry saved to dashboard_config.json.

  • Auto‑connect on startup: scans ports, picks the micro:bit by description, retries up to 5 times.

  • Keep‑alive every 2 s keeps the USB serial link alive.

  • Reset µBit button runs pyocd commander -c reset. This is missing from my frozen .exe file - I could perhaps add an extra .exe file as a quick fix for people that do not want to install Python on their laptop.

Icon

  • Version 840 sets the window/taskbar icon via root.iconbitmap(resource_path('morse.ico')), using a _MEIPASS‑aware helper so it works both in development and in a PyInstaller --onefile --windowed build.


Recent Improvements (v838 → v840)

Version Change
838 Remote LED repositioned for label space; 3D ridge borders on frames.
839 Radio interference flushing; hardware‑timer watchdog attempt.
840 Icon fix for taskbar/title bar; decoder debug output trimmed to just decoded letters and blank lines.

Files to upload

  • main_v853_relay.py – micro:bit firmware (Do not forget to edit "MASTER_MODE" before flashing each unit). That is how it knows if it is a Master or a Slave.

  • dashboard_v840.py – PC dashboard (Tkinter).

  • morse.ico – multi‑size icon bundled with PyInstaller.

  • dashboard_config.json – auto‑saved UI state.

  • MorseDashboard.exe for those who do not want to install Python on their laptop. (This combines the dashboard.py and .ico file) - see below...

Build - this is how I made the .exe file

text
pyinstaller --onefile --windowed --name "MorseDashboard840" --icon=morse.ico --add-data "morse.ico:." dashboard_v840.py

Design Goals Achieved

  • Long-running stability — hardware watchdog, radio reinitialisation, and memory monitoring.
  • Deterministic TDMA link with no role negotiation required.
  • Minimal USB traffic to help avoid TX-buffer lock-ups.
  • Live, adaptive decoding with automatic speed correction.
  • Operator-friendly UI with clear local/remote feedback and persistent state.
  • External Ham Radio transmitter support via the relay, or potentially through an output from the optional Driver Board.
  • Single-board operation — can operate with just one BBC micro:bit and the dashboard.
  • Multi-board operation — appears to also work with four or more BBC micro:bit boards; keying any one board causes all connected boards to respond.

To Do - Upload the files and some nice photos and a video explaining how it all works !

Perhaps add some more code to go full duplex BBC:micro - WiFi - BBC:micro - USB - Laptop - Internet - Laptop - USB - BBC:micro - WiFi - BBC:micro

  • Sign in to reply
Parents
  • Qbit
    Qbit 2 days ago

    Nice project, looking forward for the visual documentation.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Qbit
    Qbit 2 days ago

    Nice project, looking forward for the visual documentation.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube