Go Down

Topic: Help Controlling Arduino with Control4 inputs to run a LED strip (Read 495 times) previous topic - next topic

Shanedm1

I need a bit of advice controlling an Arduino with Control4.

Control4 is a home automation controller. I have code written on an Arduino that simply controls an addressable LED strip. I want the Arduino to run the code depending on the inputs from a Control4 processor.

I found a driver written for an Arduino Nano, but I am not sure the extent of how Control4 can influence the Arduino.

So basically, I want the LED string to run one sequence depending on an input from Control4 or a different LED sequence if it receives a different input from the Control4.

BTW, I an a noob with programming, but I can figure the code out eventually.

THanks!!

sterretje

Quote
I found a driver written for an Arduino Nano, but I am not sure the extent of how Control4 can influence the Arduino.
Do you want us to find it as well? With the risk that it's something totally different? Provide a link so we can see what you're talking about.

And a link to Control4 makes our life easier as well ;)
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Shanedm1

This is what I found for a Nano:
http://www.chowmainsoft.com/arduino

Control4 is a home automation controller system that receives variety of inputs and then uses its hardware to affect things such as lighting, security, audio, etc through the home. I don't know what the code looks like. Control4 also uses its own UI.

But basically, I want an Arduino to run one set of code to a LED strip and then at night time, the Arduino will run a different set of code to the LED. The input would come from Control4 (hopefully!).

If I can't get the Control4 to communicate with the Arduino, I would just use the Arduino as a standalone and accept the time input from wifi maybe?

If I can't get the Control4 to work with it, how could I get the Arduino to run the code depending on the time of day?

So, run a brighter LED strip during the day, and then at night, run the LED so its dimmer.

Grumpy_Mike

Quote
And a link to Control4 makes our life easier as well
And what part of "link" are you having difficulty understanding?

Shanedm1

https://www.control4.com

Control4 has numerous drivers to control other hardware through the home via IP, RS232, etc. Lighting, alarm, cameras, garage doors, etc. There are many drivers built so the different systems can communicate with each other. I had wanted to try to use Control4 as a trigger and then the LED strip would light up in a particular way depending on that trigger.

For EG: during the day, the LED would light up way but at night it would light up another way, based on the Control4 trigger.

Grumpy_Mike

Thank you for the link.

The software you downloaded is for:-
Quote
This is useful for connecting input based devices such as doorbells, motion sensors, door/window contacts, garage/gate sensors and more to Control4.
In other words it is an input to your control system. You need the control system to talk to the Arduino as an output device. It is poor code because it uses the String type of variables and not the string variable type.

It does not show what happens when you send data to the Arduino from your home hub.

It works by using RS232 signals to communicate to the home hub, so you will have to do some experiments to read what is being received and display it on the Arduino's IDE serial monitor.

To do this you need an RS232 / TTL converter card to sit between the Control4 hub and your Arduino.

Then read Serial Basics to see how to read and display the what comes over the RS232 lines.

Shanedm1

I have my work cut out for me!

Q: if I'm just using the Arduino as a stand alone to run the LED strip, is it possible to run one set of code for the LED and then when it's the evening (so time dependent) the code will change and run a different code? I have two programs for the LED strip and would like it to run a decode code depending on the time of day.
Is this possible?
Thanks so much !

Grumpy_Mike

Quote
f I'm just using the Arduino as a stand alone to run the LED strip, is it possible to run one set of code for the LED and then when it's the evening (so time dependent) the code will change and run a different code?
Yes it is quite simple.

You might want to run a real time clock board on the Arduino to make it easy to get the time. Like this one Real Time Clock


Shanedm1

Would you be able to point me to an example in code that can change programming that it time-of-day dependent?

coffeeBean

Would you be able to point me to an example in code that can change programming that it time-of-day dependent?

Have a look at the link G_M posted in #7, where the example prints out the time. You'll see you can work with (eg) now.hour so you could just use that in an "if" to see if it's 8am or whatever, then do stuff.

(You can even work with day of the week, so you could do something different on Wednesdays, for example)

The only "gotcha" is to make sure the stuff you do at 8am happens only when the time becomes 8am, as opposed to is 8am (since the hour will stay 8 for an hour). You don't want the dog feeder flap opening and closing like a maniac for a whole hour, only once at the appointed time. Cross that bridge later: get hold of the RTC as linked and get it working first ala the example.




Grumpy_Mike

Quote
The only "gotcha" is to make sure the stuff you do at 8am happens only when the time becomes 8am, as opposed to is 8am
You easily get round that by checking the time to see if it is time to do something different then when it is you change a variable to a number that the following code uses to decide what to do. The code that can do that is called a switch - case structure and is in the reference section.

Quote
Would you be able to point me to an example in code that can change programming that it time-of-day dependent?
Not really because it is so trivial. If you are that much of a beginner that it is a big mountain to you then do not start with this project. Get an Arduino and go through some of the examples in the IDE. There are lots of then under the files menu -> Examples. Start at the top and do at least the first two examples sub menus.

Run them, study them, make sure you can read the code and follow what happens.

Go Up