Site Information

 Loading... Please wait...

Blog

How to Build a CAN Bus Prototype Before Designing Your PCB

Posted by Wilfried Voss on

How to Build a CAN Bus Prototype Before Designing Your PCBModern embedded systems rarely begin with a custom PCB. In fact, the fastest and often the most successful development projects start on inexpensive development hardware that allows engineers to validate concepts, write firmware, and test communication long before the first schematic is finalized.

When developing CAN Bus and SAE J1939 applications, I have found that the best investment is not an expensive evaluation platform but a flexible prototype system that lets me move from an idea to a working application within hours. Over the years, one platform has become my preferred proof-of-concept hardware: the Arduino Due–based ECU Development Board with Dual CAN Bus Interface.

This approach has dramatically reduced development time while producing software that can later be migrated to virtually any embedded platform with surprisingly little effort.

Why Prototype Before Designing Hardware?

Designing a custom PCB too early often creates unnecessary risk.

Once hardware has been designed, manufactured, assembled, and tested, changes become expensive. A single overlooked requirement may require another PCB revision, adding weeks to a project schedule.

By contrast, firmware running on a flexible prototype platform allows developers to answer important questions immediately:

  • Does the communication concept work?

  • Is the selected protocol appropriate?

  • Can the processor handle the required message rates?

  • How much memory is actually needed?

  • Are timing requirements realistic?

  • How should diagnostics be implemented?

Finding these answers before the PCB exists significantly lowers development costs.

For CAN Bus applications, the benefits are even greater because communication behavior can be validated using real networks instead of simulations.

Why I Prefer the Arduino Due Platform

Arduino-Based ECU Development Board With Dual CAN Bus InterfaceMany engineers associate Arduino with education or hobby projects. That perception overlooks one important fact: the Arduino ecosystem is one of the fastest embedded development environments available.

The Arduino Due offers several advantages for rapid CAN Bus development:

  • 32-bit ARM Cortex-M3 processor

  • Excellent C/C++ development environment

  • Fast compile-download-debug cycle

  • Mature software libraries

  • Large development community

  • Low hardware cost

  • Immediate access to GPIO, timers, serial ports, SPI, I²C, USB, and CAN

Combined with a dual CAN Bus interface, the platform becomes a powerful development system for automotive and industrial networking applications.

Instead of spending weeks bringing up new hardware, developers can begin writing application software immediately.

Real Projects Built on the Prototype Platform

Over the years, this development board has been the starting point for numerous commercial and experimental CAN Bus projects, including:

  • SAE J1939 data traffic simulator

  • SAE J1939 baud-rate converter

  • GPS-based telematics application

  • SAE J1939 data logger

  • CAN Bus bridge

  • CAN protocol analyzers

  • Network monitoring tools

  • Gateway applications

  • Diagnostic utilities

Many of these projects eventually migrated to dedicated embedded hardware while retaining the vast majority of the original firmware.

That demonstrates one of the greatest strengths of a well-structured software architecture.

Write Portable Software from Day One

One mistake frequently seen in embedded software is tightly coupling application logic to the underlying hardware.

For example, application code directly accesses CAN controller registers, GPIO peripherals, timers, or interrupt routines throughout the project.

While this may work on the first platform, migrating to different hardware later often becomes a major undertaking.

Instead, I strongly recommend separating hardware-dependent code from the application itself.

The application should never care whether it is running on an Arduino Due, an STM32, an ESP32, or another ARM Cortex processor.

It should simply request services from a hardware abstraction layer.

The Hardware Abstraction Layer

In my CAN Bus projects, hardware-specific functionality is isolated into a dedicated module.

Typical hardware-dependent functions include:

  • CAN initialization

  • CAN transmit

  • CAN receive

  • Timer services

  • Serial communication

  • Digital I/O

  • LED control

  • Delay functions

Everything else remains hardware independent.

The application communicates only through clearly defined functions.

When migrating to another processor, only these hardware interface functions need to be rewritten.

The application logic itself remains unchanged.

CAN Bus Is Usually the Only Major Difference

For most CAN Bus applications, the largest hardware dependency is the CAN controller.

Every processor family provides its own CAN driver:

  • Arduino Due

  • STM32

  • ESP32 TWAI

  • NXP LPC

  • Microchip SAM devices

  • External CAN controllers via SPI

Although the APIs differ, they all perform the same fundamental operations:

  • Initialize the controller

  • Configure bit timing

  • Transmit a CAN frame

  • Receive a CAN frame

  • Report status and errors

Once these functions are wrapped inside a hardware abstraction layer, moving the application to new hardware becomes surprisingly straightforward.

In many projects, replacing only a handful of low-level function calls is sufficient to bring the application to life on a completely different processor.

One Code Base, Multiple Platforms

This methodology has allowed the same application software to be reused across multiple hardware platforms.

Projects originally developed on the Arduino Due have later been migrated to:

  • ARM Cortex-based custom hardware

  • STM32 microcontrollers

  • ESP32 systems

  • Other embedded processor families

The communication protocol, application logic, diagnostics, and network behavior remain identical.

Only the low-level hardware interface changes.

This significantly reduces development time while improving software reliability because the application has already been thoroughly tested.

Faster Iteration Means Better Products

Rapid prototyping also changes the development process itself.

Instead of spending weeks waiting for hardware revisions, engineers can immediately test new ideas:

  • Add another PGN

  • Implement a new gateway function

  • Modify timing

  • Test different baud rates

  • Connect GPS receivers

  • Experiment with network routing

  • Evaluate different filtering strategies

Each iteration may take minutes rather than days.

This encourages experimentation and often leads to better technical solutions.

Low Cost Encourages Innovation

Another often overlooked advantage is cost.

Prototype hardware based on the Arduino Due is inexpensive enough that multiple systems can be kept on the workbench simultaneously.

One board may act as a simulator.

Another may emulate an ECU.

A third may operate as a gateway or logger.

This creates a complete CAN Bus test environment without requiring expensive laboratory equipment.

The result is a flexible development platform that supports rapid experimentation throughout the entire design process.

From Prototype to Production

Some engineers worry that starting with Arduino will somehow limit the final product.

In practice, the opposite is often true.

The prototype validates the software architecture, communication strategy, and application behavior long before production hardware exists.

When the custom PCB finally arrives, the firmware is already mature.

Development then shifts from creating software to adapting the hardware interface, dramatically reducing project risk and shortening time to market.

Conclusion

Rapid prototyping is not about building the final product on development hardware. It is about proving ideas quickly, refining software early, and eliminating unnecessary design risk.

For CAN Bus and SAE J1939 development, the Arduino Due–based ECU Development Board with Dual CAN Bus Interface has consistently proven to be an exceptionally productive platform. It combines low cost, fast development, and powerful hardware with the flexibility needed for professional embedded system design.

By keeping hardware-specific functionality isolated behind a clean abstraction layer, developers can build portable C/C++ applications that move easily from prototype hardware to production systems based on STM32, ESP32, ARM Cortex, and many other processors. In my experience, this methodology turns projects that once required months into prototypes that can often be demonstrated within hours or a few days, allowing engineering teams to focus on innovation instead of repeatedly solving the same low-level hardware challenges.


Exploring Arduino- Tools and Techniques for Engineering WizardryExploring Arduino: Tools and Techniques for Engineering Wizardry

Exploring Arduino makes electrical engineering and embedded software development accessible to everyone. Whether you're a complete beginner or an experienced maker, you'll learn the fundamentals of electronics, programming, and human-computer interaction through a carefully structured series of increasingly sophisticated projects.

Arduino expert Jeremy Blum guides you through each project with clear explanations, practical schematics, and reusable code examples that you can apply to your own designs. Every project includes downloadable source code, helpful tips, and companion video tutorials, making it easy to build confidence as your skills grow.

What's New in the Second Edition

The fully updated second edition reflects the rapidly evolving Arduino ecosystem and includes:

  • Updated coverage of the latest Arduino hardware and software

  • New full-color illustrations and schematics for improved clarity

  • Expanded discussions of servo motors and stepper motors

  • Deeper technical explanations behind key concepts

  • Enhanced coverage of wireless communication and Internet of Things (IoT) applications

  • Guidance for selecting the right Arduino board for your specific project

What You'll Learn

  • Master the fundamentals of electrical engineering and embedded programming

  • Build Arduino projects that communicate wirelessly with other devices

  • Understand how modern Arduino boards compare and when to use each one

  • Access downloadable source code and supporting materials for every project

  • Develop practical skills you can apply to your own embedded systems

Whether you're taking your first steps into electronics or looking for a rapid prototyping platform for more advanced embedded applications, Arduino provides an affordable, flexible, and powerful development environment. Exploring Arduino serves as both a hands-on introduction and a long-term reference, guiding you from simple experiments to sophisticated real-world projects with confidence. More information...

Why Embedded Engineers Need Raspberry Pi for CAN Bus Development

The Raspberry Pi has earned its reputation as one of the most versatile embedded computing platforms ever created. Originally introduced as an educational computer, it has evolved into a serious engineering tool used for industrial automation, robotics, automotive development, data acquisition, and IoT applications. For engineers working with CAN Bus and CAN FD networks, adding [...]

Read More »


Understanding CAN Bus Error Frames: A Practical Guide to Diagnosing CAN Network Problems

When you first connect a new CAN Bus network, everything usually works perfectly—until it doesn't. Your firmware transmits messages, but nothing appears on the network. Your CAN controller reports transmit errors. Suddenly, the node enters Error Passive mode, and eventually Bus Off. Your analyzer may even display Error Frames, but it rarely explains why they occurred. If [...]

Read More »


ESP32 CAN Bus Projects: Practical Wi-Fi Applications for Embedded Systems

The convergence of wireless networking and CAN Bus technology has fundamentally changed how engineers design embedded systems. For years, CAN Bus networks operated as isolated, wired communication systems found in vehicles, industrial equipment, agricultural machinery, and marine electronics. While they excel at reliable real-time communication, accessing data often required a physical connection through a CAN [...]

Read More »


Why Professional Engineers Still Use the Arduino IDE in 2026

A recent Facebook comment caught my attention: "Who's using Arduino IDE in 2026?" At first, I dismissed it as another attempt to provoke a reaction. But the more I thought about it, the more I realized that it reflects a common misconception. Many engineers still associate the Arduino IDE exclusively with hobbyists building blinking LEDs and garage [...]

Read More »


Why Teensy Is One of the Best Microcontrollers for CAN Bus Applications

When engineers begin working with Controller Area Network (CAN) systems, one of the first questions is usually, "Which microcontroller should I use?" The answer depends on the application, but one platform consistently stands out for its combination of performance, flexibility, and ease of development: Teensy. Originally developed by PJRC, the Teensy family has earned an excellent [...]

Read More »


ESP32 CAN Data Logger over Wi-Fi and Bluetooth: Build a Remote CAN & CAN FD Monitoring System

Industrial machines, commercial vehicles, agricultural equipment, marine electronics, and factory automation systems all generate valuable information over the CAN bus. The challenge is rarely collecting the data—it's accessing that data without being physically connected to the network. Imagine monitoring an engine from your office, recording CAN FD traffic from inside an industrial cabinet without opening the [...]

Read More »


Building High-Speed Data Loggers with Teensy: From CAN Bus to Connected IoT Systems

Data logging has evolved far beyond simply recording CAN messages to a memory card. Today's engineers expect real-time visualization, multi-channel data acquisition, remote connectivity, cloud integration, and support for modern protocols such as CAN FD—all while maintaining deterministic performance and low latency. If you are designing a professional-grade data logger, the choice of hardware platform can [...]

Read More »


Build a Professional SAE J1939 Test Bench for Under $200

Imagine you're developing—or simply testing—a J1939 device. Perhaps it's a dashboard, a CAN gateway, a telematics unit, a data logger, a display, or a diagnostic application. You don't have access to a truck, and even if you did, you probably wouldn't want to leave the engine running all day just to verify that your software [...]

Read More »


Turning a Raspberry Pi into a Professional CAN Data Logger

One of the greatest advantages of the Raspberry Pi is its ability to transform from a low-cost single-board computer into a surprisingly capable engineering platform. Add a CAN Bus interface, and it becomes much more than a hobbyist computer—it becomes a powerful tool for data acquisition, diagnostics, and embedded systems development. Whether you're troubleshooting a machine [...]

Read More »