Help with Testing Monitor One

Hello all. I'm new to this and I'm in the process of learning how to use my new Monitor One. It has an M12 8-Pin connector with some wire outputs built in, and I was looking to transmit a 5V signal from my Arduino to this pin and publish it in the event monitor. However, it keeps reading 0 and I'm not sure what is the pin internally that that analog in wire (yellow) connects to. I assumed it was A6 based on the documentation so that's what I've been using, but I'm not sure. I was wondering if anyone could let me know if that's the right pin number to use in the code, or if I have to do any additional wiring to get it to communicate. Thanks!

1 Like

Hi and welcome to the community!

On the file monitor_edge_ioexpansion.h we can find:

#define MONITOREDGE_IOEX_VOLTAGE_IN_PIN (A6)

So I guess you are right, this is A6.

How are you reading it? The monitor one reads it like so:

auto rawVoltage = analogRead(MONITOREDGE_IOEX_VOLTAGE_IN_PIN);

Finally, how are you connecting the boards? Did you connect GND between them?

Thanks

Below I have attached my code. I'm not sure if I'm formatting the code in this post correctly, so I apologize about that.

#include "Particle.h"

SerialLogHandler logHandler(LOG_LEVEL_INFO);
SYSTEM_THREAD(ENABLED);

void setup() {
    pinMode(A6, INPUT);
}

void loop() {
int ArduinoIn = analogRead(A6);
Particle.publish("Arduino", String(ArduinoIn));
delay(30000); //delay half-minute
}

I see.

The easiest would be to start with the Monitor Edge firmware:

There are instructions how to use it in the README of that repo.

It will enable power to the I/O card which migth be required to power the input you are trying to read.
Then you add your exact code in loop() of the monitor main.cpp file:

void loop()
{
    Edge::instance().loop();

    int ArduinoIn = analogRead(A6);
    Particle.publish("Arduino", String(ArduinoIn));
    delay(30000); //delay half-minute
}

or without blocking loop() (recommended):

void loop()
{
    Edge::instance().loop();

    static unsigned long publishTime = 0;
    if ((millis() - publishTime) > 30000)
    {
        Log.info("publishTime...");
        publishTime = millis();
        int ArduinoIn = analogRead(A6);
        Particle.publish("Arduino", String(ArduinoIn));
    }

}

Best of luck!

2 Likes

Hi, so I've been trying to figure out how to use Particle Workbench, and I'm not sure how to upload this firmware. I was able to import and configure the firmware to Workbench and I made my code in the main.cpp section, exactly as you said.
I was also able to compile the code, but when I try to flash code and Device OS, it says my device is not recognized. However, I did check in device manager and the device shows up when I plug it into my computer via the TSOM USB port on the Monitor One. I tried a few of the troubleshooting, including trying PuTTY, but I haven't been able to get any output out of this. I have tried to do the particle identify command via Paritlce CLI, but it also says device not found and to ensure the device is in listening mode. The exact error i got was: "Could not get device info, ensure the device is in listening mode: Serial timed out". I can't find any information on this, so if you know anything about this, that would be much appreciated!

Additionally, do you happen to know if any of the wires in the M12 8-Pin connector need to be wired or soldered to the board? I bought this device pre-made and I can't really tell if it's connected to A6 or not just by looking at the board connections.

Anyways, thanks!

There's a lot going on here, but to solve the device not found problem:

  • Make sure you are using a USB to Micro USB B data cable, not a charger cable.
  • Makes sure the Monitor One is on and the status LED is on (it's not in sleep mode or shipping mode).
  • In Workbench, open a Terminal window using Particle: Launch CLI.
  • Use the particle usb list to see if the Monitor One is visible.
  • If you get No devices found. then there is a problem with either your USB cable or one of the other steps above.

You don't need to solder anything with the Monitor One. All of the necessary connections are made between the M12 and the I/O card from the factory.

2 Likes