Pages: [1]   Go Down
Author Topic: Arduino/PLC/RGB strips  (Read 1240 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I thought about a new project setting up an Arduino Uno R3 "communicating" with an PLC. the goal is that the arduino controlls the LED RGB strips. Therefore I want to have 6 Inputs for 6 individuall programmed Light actions.

Input 1 - only Yellow blinking at 2 Hz
...
Input 6 - running light, green at 1 Hz

The signal to choose the light actions comes from the PLC. My question is if this is all possible. I know that its possible to drive the LED strips but whats with the arduino gets the commands from the PLC (its just high or low signal). How would you programm it ?

Would be nice if you can help me handle that project!

Thx in advance for your answeres.

Best regards Mike
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey,

I have a question about programm control with Arduino. I´d like to use 6 digital inputs to control programm features. It´s used with an RGB strip.


Like:

Input 1: only Yellow
Input 2: only Red, blinking
Input 3: only Yellow with running light
...
Input 6: Green running light

The question is if this kind of program control is possible with the Arduino. Doesn´t matter which kind of Arduino I just search for a microcontroller which can handle with my Idea. Hope you can help me.

Thx in advance !
Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 187
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, this is perfectly possible. The only thing you have to keep in mind is the number of pins you have. If you do not use driver chips (so you have to wire up every led yourself through multiplexing) the it might get hard, but if you use a such a chip, it can be easely done.
Logged


Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18801
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Threads merged. Don't just create a new thread asking the same question please. Be patient and someone will answer you.

Quote
The question is if this kind of program control is possible  ...

Most things are possible. Perhaps you can ask a more specific question? Preferably one that shows you used Google or similar to do some research of your own.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, this is perfectly possible. The only thing you have to keep in mind is the number of pins you have. If you do not use driver chips (so you have to wire up every led yourself through multiplexing) the it might get hard, but if you use a such a chip, it can be easely done.

Hey, thanks for fast reply.

Further question. I use LED RGB strips as you can see in the link below. So the wiring effort is not the problem. Is it possible that you give me a short (really short) overview of the code needed to do this "programm control". The problem is all my contacted suppliers for RGB LED strips say that it is not possible to set up an Arduino lik eI want. I think like you do "it can be done". Confusing thing.

// Edit:

Sorry Nick for double posting, wont happen again. I search for about 1 Week to fix that problem. Try tu use the keywords on google "Arduino and PLC" you will get only none specific answeres.



http://gng.en.alibaba.com/product/554055040-200140982/full_color_smd_flexible_digital_lpd8806_rgb_led_strip.html
« Last Edit: April 24, 2012, 12:50:04 am by Myillusionart » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27099
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That  particular strip seems to have an embedded IC in it
drive IC: LPD8806
that receives commands and controls the LEDs.
You will need code to send messages to the chip.

Here's a good starting point:
http://www.ladyada.net/products/digitalrgbledstrip/index.html
« Last Edit: April 24, 2012, 12:52:52 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18801
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I use LED RGB strips as you can see in the link below.

Good idea to post the link. Just a tip ... you get a more detailed answer if you give more details in the question. Now we can see the link we can come up with helpful answers.

As an example:

https://github.com/adafruit/LPD8806

There: Arduino library for LED strips and pixels using LPD8806
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thx a lot to both of you!

Just to make sure i understand you right. Please have a look at my little "programm think sketch"  for the upcoming code using arduino PLC and the RGB LED strips. The inputPin1-6 get +5V from the PLC.

Code:

void setup ()
{

// setting up all the pins and functions i use e.g. pinMode

}

void loop ()
{

if (inputPin 1 == high)
{
doThingA;

if (inputPin 1 == low)
{
jumpBack to main loop;
}
}
else if (inputPin 2 == high)
{
doThingB;

if (inputPin 2 == low)
{
jumpBack to main loop;
}

// (...) continuing pin 3,4,5, 6

else
{
doThingG;
}

}



Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27099
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't need these
   if (inputPin 1 == low)
   {
      jumpBack to main loop;
   }
If it fails the High condition, the sketch will just continue & read the next sketch.

Also, you need to read the pin:

if (digitalRead(input1pin) == LOW) { ...}
if (digitalRead(input2pin) == LOW) { ...}
if (digitalRead(input3pin) == LOW) { ...}
if (digitalRead(input4pin) == LOW) { ...}
if (digitalRead(input5pin) == LOW) { ...}
if (digitalRead(input6pin) == LOW) { ...}
use the internal pullups, and have your switch ground the pin to make the condition active.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey,

thanks a lot!

I have another question, is there a possibility to calculate the time out of the used code ?  The change of the RGB strip colors should go as fast as possible.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27099
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure - but the outputs will change within microseconds of the button pushes.

use this:
unsigned long startTime = micros();

and then
unsigned long endTime = micros();

and do the math
unsigned long elapsedTime = endTime - startTime; // in microseconds
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: