Controlling a relay off of a LED Controller

First of I am new to arduino, sorry if I am asking a simple question.

I have an LED controller for my Aquarium that sends out a PWM single 1-255 with a 5v signal. I am wanting to have a relay turn on when the signal hits 100 on one of the channels. I have a spare Arduino that I have that I was going to use the signal to control the switch.

will this work? Thanks for any help.

const int digitalin = 8;
const int relayout = 13;
const int threshold = 100;
void setup() {
  pinMode(relayout, OUTPUT);
void loop() {
  int digitalValue = digitalRead(digitalin);

  if (digitalValue > threshold) {
    digitalWrite(relayout, HIGH);
  } else {
    digitalWrite(relayout, LOW);

No, because digitalRead only gives you true or false, HIGH or LOW, 0 or 1.

I would say the easiest way is to tap of the signal and put it trough a RC filter to convert it to a voltage. From there you can use that to drive the relay. This can be an Arduino but it’s really overkill. Just a single comparator is enough. You can then use a pot to set the threshold.