Show Posts
Pages: 1 [2] 3 4 ... 20
16  Using Arduino / Project Guidance / Re: multiple input monitoring on: January 13, 2014, 01:23:30 pm
o I see, could I do this?

Code:
if (digitalRead(input1) && digitalRead(input2) && digitalRead(input3) && digitalRead(input4) && digitalRead(input5) && digitalRead(input6)) {   //check if any are high

17  Using Arduino / Project Guidance / Re: multiple input monitoring on: January 13, 2014, 01:08:12 pm
yes all that work's fine
18  Using Arduino / Project Guidance / Re: multiple input monitoring on: January 13, 2014, 12:48:56 pm
there is some other bits going on in here

Quote


//         ***  INPUT'S ***
const int input1   =  3;   
const int input2   =  2;   
const int input3   =  4;
const int input4   =  5;
const int input5   =  6;
const int input6   =  7;

//        *** LED OUTPUT'S ***
const int LED1     =  15;   
const int LED2     =  14;   
const int LED3     =  13;   
const int LED4     =  12;   
const int LED5     =  11; 
const int LED6     =  10;

//  *** LED/RESET/RELAY OUTPUT'S ***
const int Relay    =  8;
const int Reset    =  9;
const int LED      =  16;



int ledState = LOW;             // ledState used to set the LED
long previousMillis = 0;        // will store last time LED was updated
long interval = 1000;           // interval at which to blink (milliseconds)

void setup()
{
  //        ***  INPUT'S  ***
  pinMode(input1   ,    INPUT);
  pinMode(input2   ,    INPUT);
  pinMode(input3   ,    INPUT);
  pinMode(input4   ,    INPUT);
  pinMode(input5   ,    INPUT);
  pinMode(input6   ,    INPUT);

  //        ***  OUTPUT'S  ***
  pinMode(LED1    ,    OUTPUT);
  pinMode(LED2    ,    OUTPUT);
  pinMode(LED3    ,    OUTPUT);
  pinMode(LED4    ,    OUTPUT);
  pinMode(LED5    ,    OUTPUT);
  pinMode(LED6    ,    OUTPUT);

//  *** LED/RESET/RELAY OUTPUT'S *** 
  pinMode(Relay   ,    OUTPUT);
  pinMode(Reset   ,    INPUT);
  pinMode(LED     ,    OUTPUT);
 

}

void loop()  {
    unsigned long currentMillis = millis();        // LED  BLINKER
 
  if(currentMillis - previousMillis > interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;   

    // if the LED is off turn it on and vice-versa:
    if (ledState == LOW)
      ledState = HIGH;
    else
      ledState = LOW;

    // set the LED with the ledState of the variable:
    digitalWrite(LED, ledState);
  }
 
 
  if (digitalRead(input1)==    LOW) {  // INPUT  1
    digitalWrite(LED1,        HIGH);
  }
 
  if (digitalRead(input2)==    LOW) {  // INTPUT  2
    digitalWrite(LED2,        HIGH);
  }
 
 
  if (digitalRead(input3)==    LOW) {  // INTPUT  3
    digitalWrite(LED3,        HIGH);
  }


  if (digitalRead(input4)==    LOW) {  // INTPUT  4
    digitalWrite(LED4,        HIGH);
  }


  if (digitalRead(input5)==    LOW) {  // INTPUT  5
    digitalWrite(LED5,        HIGH);
  }


  if (digitalRead(input6)==    LOW) {  // INTPUT  6
    digitalWrite(LED6,        HIGH);
  }

 
  if (input1 && input2 && input3 && input4 && input5 && input6) {    //check if any are high
   digitalWrite(Relay,        HIGH);
  }
  else {
   digitalWrite(Relay,        LOW);
  }

  if (digitalRead(Reset)==  HIGH) {  // Reset button
    digitalWrite(LED1,       LOW);
    digitalWrite(LED2,       LOW);
    digitalWrite(LED3,       LOW);
    digitalWrite(LED4,       LOW);
    digitalWrite(LED5,       LOW);
    digitalWrite(LED6,       LOW);
    }
 }
19  Using Arduino / Project Guidance / Re: multiple input monitoring on: January 13, 2014, 12:32:10 pm
ok thanks for that, I got this:
Code:
  if (input1 && input2 && input3 && input4 && input5 && input6) {        //check if any are high
   digitalWrite(Relay,        HIGH);
  }
  else {
   digitalWrite(Relay,        LOW);


it seam's to write the Relay High regardless of the input's any idea's
20  Using Arduino / General Electronics / Re: 3phase mains faliure circuit on: January 13, 2014, 12:06:59 pm
so what size capacitor would we be looking at?
21  Using Arduino / Project Guidance / multiple input monitoring on: January 12, 2014, 04:47:15 pm
Hi there
I have 6 inputs labelled as:
input1
input2
input3
input4
input5
input6
How can I get the arduino to look at all its six inputs and if any of them go low to write an output low?
 
22  Using Arduino / General Electronics / Re: 3phase mains faliure circuit on: January 12, 2014, 04:41:06 pm
CT does not suit my application.
So are you saying picking up a phase putting it through a resistor into an opt out through a capacitor?
Could I not have two 100k .25w resistors in series?
 
23  Using Arduino / General Electronics / Re: 3phase mains faliure circuit on: January 11, 2014, 02:51:16 pm
ok thanks for that, I have had a bit of a look about
so correct me if I'm wrong, I can get away with just using a resister on the diode side?
calculating the resister size do I do the same theory as I would be calculating the resister for an LED?
24  Using Arduino / Microcontrollers / Re: ATTiny2313 bootloader on: January 09, 2014, 04:46:08 pm
yea! We are all up and working now. Thank you for your help.
25  Using Arduino / Microcontrollers / Re: ATTiny2313 bootloader on: January 08, 2014, 05:10:23 pm
Here is a screen shot of mine I would say it is the same as yours?


26  Using Arduino / General Electronics / Re: attiny84 freezing on: January 07, 2014, 05:43:38 pm
Quote
While you seem to be considering all the sources of hardware-based errors, what about a software error?
Can you post your code?

I know it cant be code issues as it was heavily tested before putting into service and I have 60 of these out there now working for approx 6-12 months all seem to be fine apart from these odd few

Quote
Hi, have you got the attiny and it circuitry shielded, or in a metal case?
Do you have a 0.1uF cap across the power supply pins of the attiny itself? (soldered right at the IC pins)
It sounds like you have not got enough bypassing, the optos are certainly a good idea.
A pic of your project and a circuit diagram would be great, even a pic of a hand drawn circuit.

Yes I do have a 0.1  UF very close to the attiny
I will get some pics up very soon
All cables into the board are screened and earthed

Quote
You don't mention the reset pin.
Put a 10kohm resistor from the reset pin to +5V. What you see is maybe autoresetting

no I don't have anything attached to reset pin this may be my problem I will give it a try

thanks for all your help
27  Using Arduino / Microcontrollers / Re: ATTiny2313 bootloader on: January 07, 2014, 05:35:39 pm
I copy that one into my boards.txt and still not working, I do  close the arduino  before altering anything I do not open until everything else has been closed, by the looks of it it cant be that folder must be something else on the down load?

I have deleted and reinstalled to make sure I have not altered anything else, still no difference?


 
28  Using Arduino / General Electronics / attiny84 freezing on: January 05, 2014, 05:07:36 pm
hi there

I have a attiny84 on a PCB that I have had made but every now and then it seems to just freeze midway through the loop. This may only happen once every four ,five weeks. Any ideas which may be causing this?
The power feed comes in through a 1000UF cap into L7805ABV volt regulator out through 33UF cap then into 0.1 UF cap
All inputs are optically isolated.
All outputs go into a ULN2803A transistor which in turn powers coils of  relays .
This unit is inside a metre square panel which is full of 3 phase kit which in turn could be noisy.
On the other hand there's other printed circuits in there working fine.
29  Using Arduino / Microcontrollers / Re: ATTiny2313 bootloader on: January 05, 2014, 04:56:37 pm
any ideas what the problem could be?
could it be anything else?

thanks Joe
30  Using Arduino / Microcontrollers / Re: ATTiny2313 bootloader on: January 04, 2014, 12:35:57 pm
yes this is my one
c:\Users\Joe\Documents\Arduino\hardware\tiny\boards.txt

?
Pages: 1 [2] 3 4 ... 20