Dev Notes

Prototyping tips to connect software and hardware (recent notes)

3 min read
Yuki Nakata
#prototyping#software#hardware#communication#design thinking

With a grasp of communication methods, I/O design, and a minimal programming mindset, prototypes are far more malleable than expected. These are my notes.

From recent projects, I realized that software prototypes can be shaped quite freely into the form I want. The key points are threefold:

  • Nail the communication basics
  • Build a sense for “can this be solved in code?”
  • Design inputs and outputs (I/O) first

1. Nail the communication basics (socket/serial)

  • Socket communication (TCP/UDP): Suited for data exchange across PCs and networks. Libraries are abundant in Node/Python/C++, and it pairs well with async processing.
  • Serial communication (UART/USB-Serial): The standard for microcontrollers and instruments. Decide baud rate, parity, flow control, and make message boundaries (newline or delimiters) explicit to make it immediately more manageable.
  • Shared heuristics:
    • Keep the protocol simple (start with text, move to binary if needed)
    • Fix the message format and make the send/receive state explicit
    • Log everything you “sent/received”

Once you master the communication method, connecting software and hardware becomes surprisingly easy.

2. Minimal toolkit to build a “programming sense”

Understanding just these four is enough to get far:

  • Variables: Boxes that remember state
  • Functions: Transformers of input → processing → output
  • Loops: Repeat the same procedure
  • Conditionals: Branch based on state

This builds a nose for “can this be solved in code?” Start by fixing the I/O and compose “the smallest working” with functions. Frameworks can wait.

3. Design I/O first

When prototyping, first define the final inputs and outputs:

  • What is the final output? (numbers, images, signals, actions)
  • Which inputs lead to it? (sensor values, clicks, keyboard, API)

Simply visualizing this I/O and conveying it to an AI assistant is enough to naturally determine functions, data structures, and the granularity of communication. Implementation becomes faster with a minimal setup.

4. Send data in a structured format (JSON-like)

Even if you don’t know the word “JSON,” putting content into an easy-to-understand set of “boxes” makes software–hardware conversations much easier.

  • Tips
    • Put “name” and “value” together in each message
    • Group similar information into one box
    • Decide which boxes are required vs optional

For example, sending sensor readings and device state:

{
  "type": "sensor_reading",
  "device": {
    "id": "A-01",
    "mode": "normal"
  },
  "data": {
    "temperature_c": 23.4,
    "humidity_pct": 41.2
  },
  "ts": 1727059200
}

Sending the same information as scattered strings forces the receiver to reorder and reinterpret. If you put it into boxes (structure), the receiver only decides “which box to read,” and processing stabilizes. Start with these three boxes:

  • type: What kind of message is this? (a cue)
  • device: Who sent it and in what state? (self-introduction)
  • data: The actual values (the main part)

If sender and receiver agree on box names, they can “communicate” across languages and implementations. Start with text boxes (JSON-like), and switch to binary later if needed.

Start small, layer thinly

  • Always include some visualization (logs). Know what works and what doesn’t.
  • Verify at each step that the expected I/O is satisfied

“Make the smallest thing work → observe → add the next piece” is, once again, the royal road for prototyping.


Bottom line: grasp the communication method, develop a minimal programming sense, and design I/O. With these three, prototypes come together more easily than expected.