the project works with arduino uno, but doesn't work with arduino nano neither arduino mega pro

Support forum for MegunoLink
Post Reply
islam88elshaer
Posts: 1
Joined: Sun Dec 07, 2025 7:36 pm

Mon Dec 08, 2025 8:34 am

I have an Interface panel using Gauge and textBox
using serial communication
My control board is arduino mega pro based
the Monitor doesn't receive any data from arduino mega pro USB cable, Therefore the Gauge and other controls doesn't respond
but by using exactly the same code on arduino Uno it works well, the monitor receives serial data and the Gauge responds.
Is there any additional configurations i should use with arduino mega pro ???

I attached my board photo and the progect photo
This is my code

Code: Select all

#include "MegunoLink.h" // Helpful functions for communicating with MegunoLink Pro. 
const int flowSensorPin = 3; // The pin the sensor is connected to
volatile int pulseCount = 0; // Counter for pulses
float flowRate = 0.0; // Calculated flow rate
unsigned long lastMillis = 0; // Time of last reading
const float calibrationFactor = 7.5; // Sensor specific calibration factor (pulses per liter)

void SendToIPGauge1(float vv)
{
InterfacePanel MyPanel;  
// Set control value
 MyPanel.SetNumber(F("IPGauge1"), vv);
}

void setup()
{
 Serial.begin(9600);
pinMode(flowSensorPin, INPUT_PULLUP); // Set the sensor pin as input with internal pull-up resistor
 attachInterrupt(digitalPinToInterrupt(flowSensorPin), flowSensorISR, RISING); // Interrupt on rising edge
}

void loop()
{
// Calculate flow rate every second
  if (millis() - lastMillis >= 100) {
    noInterrupts(); // Disable interrupts during calculation
    flowRate = ((1000.0 / (millis() - lastMillis)) * pulseCount) / calibrationFactor;
    lastMillis = millis();
    pulseCount = 0; // Reset pulse count
    interrupts(); // Re-enable interrupts

    Serial.print("Flow Rate: ");
    Serial.print(flowRate);
    Serial.println(" L/min");
    //SendToIPGauge1(flowRate);
    MyPanel.SetNumber(F("IPGauge1"), flowRate);
  }
}
// Interrupt Service Routine (ISR)
void flowSensorISR() {
  pulseCount++;
}
Attachments
WhatsApp Image 2025-12-08 at 10.22.35 AM.jpeg
WhatsApp Image 2025-12-08 at 10.22.35 AM.jpeg (111.82 KiB) Viewed 16143 times
WhatsApp Image 2025-12-08 at 10.22.35 AM (1).jpeg
WhatsApp Image 2025-12-08 at 10.22.35 AM (1).jpeg (118.66 KiB) Viewed 16143 times
philr
Posts: 463
Joined: Mon May 26, 2014 10:58 am

Tue Dec 09, 2025 9:17 am

Does your new board use a different serial chip by any chance and is it a CH340?

https://learn.microsoft.com/en-us/answe ... er-windows

They released a driver a while ago through windows update that stops it working. You can download the old one here
https://learn.sparkfun.com/tutorials/ho ... rivers/all

Cheers
Phil
Post Reply