Macchina Docs
  • Macchina.cc
  • Introduction
    • Disclaimer
  • Product Documentation
    • M2 Docs
      • Getting Started
      • Arduino IDE Quick Start
      • M2 Code libraries
        • CAN bus
        • Single-wire CAN
        • LIN
      • Next Steps with M2
      • Detailed Reference
        • Installation
        • Processor
        • Pin Mapping
        • Automotive Interfaces
        • Communication
          • M2 Bee-Compatible Add-ons
          • Cellular
        • Power
        • Storage/Memory
        • 12V IO
        • LEDS/Buttons
        • Enclosures
        • Breakout Board
        • Schematics and Source
      • Versions of M2
    • A0 Docs
      • Quick Start Guide
      • Firmware Reference
      • Hardware Reference
      • Projects
      • Troubleshooting
    • SuperB Docs
      • Getting Started
      • Hardware
      • Sending AT Commands
    • P1 Docs
      • Getting Started
      • Pin Mapping
      • Interfaces
      • Power Supply Note
    • OBD3way Docs
  • Projects
    • A0 Projects
      • A0 CAN Vehicle Data
      • A0 CAN Point to Point
      • A0 CAN Read VIN
      • Work-in-Progress A0 projects
    • M2 Projects
      • "OK Google, start my car!"
      • M2 and SavvyCAN, the Basics
      • Help Collect Voltage Data
      • Mini-Project Tutorials
        • M2 CAN Loopback
        • M2 CAN Point to Point
        • M2 SWCAN Point to Point
        • M2 VIN Extraction
    • P1 Projects
      • P1 CAN Vehicle Data
      • P1 CAN Loopback
    • Community Projects
    • Project Support
    • Other Resources
  • Support /contact us
    • Contact US / FAQ
    • Common Issues
    • Out of Stock/ Status
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Projects
  2. M2 Projects
  3. Mini-Project Tutorials

M2 VIN Extraction

Use M2 to read a Vehicle Identification Number (VIN) and write it to an SD card.

PreviousM2 SWCAN Point to PointNextP1 Projects

Last updated 1 year ago

Was this helpful?

Items Used

  • 1x M2

  • 1x Car with OBD-II Port

M2 Sketch

Upload THIS SKETCH to your M2, which queries the vehicle's Engine Control Unit (ECU) for the VIN and then writes it to a text file via the onboard SD slot.

Sketch Libraries

The sketch above makes use of multiple libraries, install them through the links below:

Collect VIN

With the vehicle running, plug M2 into the OBD-II port. M2 should flash yellow lights as it queries for the VIN, then light up green for success or red for failure. In either case pressing button 1 will make M2 try again, writing a new text file each time.

GitHub - TDoust/M2_12VIO: Macchina M2 12VIO Library for use with the Macchina M2 OBDII HardwareGitHub
GitHub - antodom/pwm_lib: This is a C++ library to abstract the use of the eight hardware PWM channels available on Arduino DUE's Atmel ATSAM3X8E microcontroller.GitHub
GitHub - collin80/iso-tp: ISO 15765-2 TP implementation for ArduinoGitHub
GitHub - collin80/due_can: Object oriented canbus library for Arduino Due compatible boardsGitHub
GitHub - collin80/can_common: Common structures and functionality for CAN librariesGitHub
Logo
Logo
Logo
Logo
Logo