Arduino Mega (Sensor Reading Device)

This page provides instructions for setting up and using the Arduino Mega.


  • Git
  • Repository
  • Arduino IDE
  • VSCode
  • Bash
  • Arduino CLi


  • Arduino Mega

Setup Steps

  1. Clone the Repository:
    git clone ``
  2. Install Arduino CLI:
    Refrence: Official Arduino CLI Installation Docuemnt

  3. Update Arduino Core:
    arduino-cli core update-index --additional-urls
  4. Connect Arduino Mega:
    • Connect Arduino Mega yo your laptop and open Arduino IDE Make sure your IDE is able to recognize the device.
    • If and when you try to upload any code to the mega, it just stops responsing sometimes. Mega would still be working but you’ll see some sort of timeout when uploading code. Example:
        Device or resource busy
        ioctl("TIOCMGET"): Inappropriate ioctl for device
    • There are other kind of timeour erros as well. Usually restarting the Arduino IDE helps. I know it’s very annoying.
    • If that doesn’t work, after closing the IDE, try to find the process that is maybe still using the port that the mega is connected on. Sometimes the Arduino IDE’s serial monitor doesn’t detatch itself. So, for example, on linux, I usually do this:
            kill -9 $(lsof -t <PORT>)


            kill -9 $(lsof -t /dev/ttyACM1)
  5. Upload Code:
    • Please use git bash for this.
    • cd mega/
    •     chmod +x
    • For help:
          ./ -h
    • To install core, compile and upload code:
          ./ -i -c -u PORT=[Arduino port]


          ./ -i -c -u PORT="dev/ttyACM1"

Now your Arduino Mega should be ready to read sensor data.