Show Posts
Pages: 1 ... 13 14 [15] 16 17 ... 21
211  Using Arduino / Project Guidance / Re: heating control on: July 10, 2012, 03:39:00 pm
tried that and ended back at the original fault lol
212  Using Arduino / Project Guidance / Re: heating control on: July 09, 2012, 11:46:27 am
any ideas?
213  Using Arduino / Project Guidance / Re: altering an output over a period of time on: July 06, 2012, 10:01:22 am
Quote

So figure out how many seconds in your time period, divide by 256.
For better accuracy, maybe use a 16.16 fixed point accumulator to provide your eight bits.
Take out any non linearities in your conversion with a look up table.

any examples of this as it sounds a bit technical lol

Quote

You can get 0V or 5V, but you can't output any intermediate voltages unless you add an additional circuit to convert the digital output to an analog value.
o ok well il tell you what im trying to do, im trying to dim a high frequency floourescent that has a 0-10v pair on it so basically if i short those pair out it is at its dullest and broken apart at its brightest so what do we think the best is the best way to get around this?

thanks all
214  Using Arduino / Project Guidance / Re: heating control on: July 06, 2012, 09:56:09 am
correct me if im wrong the timing circuits there i just need to put a command in to pull it low at the end.  i have been playing with it for a little while and still having the same issues.
215  Using Arduino / Project Guidance / Re: altering an output over a period of time on: July 05, 2012, 03:33:55 pm
bit port

basically what im trying to do is have a o-10v output i know i can only get a 0-5v out of the arduino but i will have to figure something to convert to when i get there.
216  Using Arduino / Project Guidance / altering an output over a period of time on: July 05, 2012, 01:35:38 pm
hi there
im trying to make an output that goes from 0 to 255 (or vise versa) over a period of time such as 20 mins ?
and ideas or example would be helpful
thanks Joe
217  Using Arduino / Project Guidance / Re: heating control on: July 04, 2012, 03:00:23 pm
i have played with putting things in there until ive gone blue in the face but i only seem to be able to get the fan to run continously or no delay or just cutting out randomly

p.s the only bit thats been copied and pasted in is your bit and being dyslexic makes it even harder as i dont even understand general english!
218  Using Arduino / Project Guidance / Re: heating control on: July 03, 2012, 04:10:02 pm
yes thats what i was planning for

still not working lol mite have left something tho

Code:
#define THIRTY_SECONDS 30000

const int heatbutton     = 2 ;
const int ignition_fan_2 = 10;
const int saleswitch     = 4 ;
const int solenoid       = 12;
const int photo_pressure = 3 ;
const int lockoutled     = 8 ;
const int heatbutton_feed= 5 ;
const int fan            = 9 ;
const int relay230_24    = 11;
const int ionisation_in  = 7 ;
int ionisation           = 5 ;   
bool DoneInitialization = false;       

void setup()
{
  pinMode(heatbutton,       INPUT );   
  pinMode(ignition_fan_2,   OUTPUT);
  pinMode(saleswitch,       INPUT );
  pinMode(solenoid,         OUTPUT);
  pinMode(photo_pressure,   INPUT );
  pinMode(lockoutled,       OUTPUT);
  pinMode(heatbutton_feed,  OUTPUT);
  pinMode(fan,              OUTPUT);
  pinMode(relay230_24,      OUTPUT);
  pinMode(ionisation_in,    INPUT );
  //-------------------------------------------
  digitalWrite(heatbutton_feed, HIGH);
}

void loop() {
    int val = analogRead(ionisation);
   
  static unsigned long startTime;
  static int lastState = HIGH;
  int currentState = digitalRead(heatbutton);
  unsigned long now = millis();
  unsigned long switchHIGHTime = 0;
  unsigned long fanTurnOnTime;
 
  if (now - fanTurnOnTime > switchHIGHTime)
    // Turn the fan off
   
  if (currentState == HIGH) {  // Code goes here to occur whenver the button is HIGH
  delay(10);    //debounce
    if (!DoneInitialization)
    {                                                 
      if (digitalRead(ionisation_in)==   HIGH) {           // if ionisation swith HIGH
        if (val >900) {                                       
          digitalWrite(lockoutled,            HIGH);
         delay(10);
          digitalWrite(heatbutton_feed,       LOW);
          return;
        }
      }   
      else {
        if (digitalRead(photo_pressure)==     HIGH) {         // if photo swith HIGH
        delay(10);
          digitalWrite(lockoutled,            HIGH);
         delay(10);         
          digitalWrite(heatbutton_feed,       LOW);
         return;
       }
      }
      digitalWrite(fan,                    HIGH);
      delay(3000);       
     
    //---------------------------------------------------------------------
    if (digitalRead(saleswitch)==HIGH) {           // sale switch if HIGH
    digitalWrite(relay230_24,    HIGH);        // 230V out put to ignition
    digitalWrite(ignition_fan_2, HIGH);
    delay(1000);
      digitalWrite(solenoid,     HIGH);
    }
    DoneInitialization=true;                           // Initialization is done, don't run it again until button has been low
    }
    //---------------------------------------------------------------------
    if (digitalRead(saleswitch)==   LOW) {          // sale switch if LOW
      digitalWrite(lockoutled,      HIGH);
      digitalWrite(solenoid,        LOW);
      digitalWrite(fan,             LOW);
       delay(10);
      digitalWrite(heatbutton_feed, LOW);
    }
    //---------------------------------------------------------------------
    delay(3000);
    if (digitalRead(ionisation_in)== HIGH) {
      if (val <900)                         {            // ionisation if LOW
        digitalWrite(lockoutled,     HIGH);
        delay(10);
        digitalWrite(heatbutton_feed, LOW);
      }
    }

    if (digitalRead(photo_pressure)==LOW)  {          // photo if LOW
      delay(10);
      digitalWrite(lockoutled,       HIGH);
      delay(10);
      digitalWrite(heatbutton_feed,  LOW);
    }
    //---------------------------------------------------------------------
    else {
      digitalWrite(ignition_fan_2, LOW);
    }
    if (lastState == LOW) {
      startTime = now; // Time when the switch went to HIGH
    }
  } else {                      // Code goes here to occur whenver the button is LOW
    digitalWrite(solenoid,       LOW);
    digitalWrite(ignition_fan_2, LOW);
    DoneInitialization=false;                    // resetting the count
    delay(1000);
    digitalWrite(relay230_24,    LOW);
 
    if (lastState == HIGH) {
      switchHIGHTime = now - startTime; // determine how long it was HIGH for
      if (switchHIGHTime > THIRTY_SECONDS)
        switchHIGHTime = THIRTY_SECONDS;
     
      fanTurnOnTime = now;
      switchHIGHTime = THIRTY_SECONDS; // set to 30 seconds if it was on that long
      // Turn the fan on here
    }
  }
  lastState = currentState;
  }
219  Using Arduino / Project Guidance / Re: heating control on: July 02, 2012, 03:43:16 pm
still not working?

Code:


const int heatbutton     = 2 ;
const int ignition_fan_2 = 10;
const int saleswitch     = 4 ;
const int solenoid       = 12;
const int photo_pressure = 3 ;
const int lockoutled     = 8 ;
const int heatbutton_feed= 5 ;
const int fan            = 9 ;
const int relay230_24    = 11;
const int ionisation_in  = 7 ;
int ionisation           = 5 ;   
bool DoneInitialization = false;       
// Variables will change:
int HeatButtonState = LOW;      // HeatButtonState used to set the fan
long previousMillis = 0;        // will store last time fan was updated
long interval = 20000;          // dleay time
void setup()
{
  pinMode(heatbutton,       INPUT );   
  pinMode(ignition_fan_2,   OUTPUT);
  pinMode(saleswitch,       INPUT );
  pinMode(solenoid,         OUTPUT);
  pinMode(photo_pressure,   INPUT );
  pinMode(lockoutled,       OUTPUT);
  pinMode(heatbutton_feed,  OUTPUT);
  pinMode(fan,              OUTPUT);
  pinMode(relay230_24,      OUTPUT);
  pinMode(ionisation_in,    INPUT );
  //-------------------------------------------
  digitalWrite(heatbutton_feed, HIGH);
}

void loop() {
  int val = analogRead(ionisation);
  int lastButtoncurrent = HIGH;
  int currentButtoncurrent = digitalRead(heatbutton);
  //--------------------------------------------------------------------

  if (digitalRead(heatbutton)==               HIGH) {
    delay(10);    //debounce
    if (!DoneInitialization)
    {                                                 
      if (digitalRead(ionisation_in)==        HIGH) {         // if ionisation swith HIGH
        if (val >900) {                                       
          digitalWrite(lockoutled,            HIGH);
          delay(10);
          digitalWrite(heatbutton_feed,       LOW);
          return;
        }
      }   
      else {
        if (digitalRead(photo_pressure)==     HIGH) {         // if photo swith HIGH
          delay(10);
          digitalWrite(lockoutled,            HIGH);
          delay(10);         
          digitalWrite(heatbutton_feed,       LOW);
          return;
        }
      }
      digitalWrite(fan,                        HIGH);
      delay(3000);       

      //---------------------------------------------------------------------
      if (digitalRead(saleswitch)==HIGH) {        // sale switch if HIGH
        digitalWrite(relay230_24,    HIGH);       // 230V out put to ignition
        digitalWrite(ignition_fan_2, HIGH);
        delay(1000);
        digitalWrite(solenoid,     HIGH);
      }
      DoneInitialization=true;                   // Initialization is done, don't run it again until button has been low
    }
    //---------------------------------------------------------------------
    if (digitalRead(saleswitch)==   LOW) {          // sale switch if LOW
      digitalWrite(lockoutled,      HIGH);
      digitalWrite(solenoid,        LOW);
      digitalWrite(fan,             LOW);
      delay(10);
      digitalWrite(heatbutton_feed, LOW);
    }
    //---------------------------------------------------------------------
    delay(3000);
    if (digitalRead(ionisation_in)== HIGH) {
      if (val <900)                         {         // ionisation if LOW
        digitalWrite(lockoutled,      HIGH);
        delay(10);
        digitalWrite(heatbutton_feed, LOW);
      }
    }

    if (digitalRead(photo_pressure)==LOW)  {          // photo if LOW
      delay(10);
      digitalWrite(lockoutled,       HIGH);
      delay(10);
      digitalWrite(heatbutton_feed,  LOW);
    }
    //---------------------------------------------------------------------
    else {
      digitalWrite(ignition_fan_2, LOW);
    }
  }
  //---------------------------------------------------------------------
  else {                                      // switching off
    digitalWrite(solenoid,       LOW);
    digitalWrite(ignition_fan_2, LOW);
    DoneInitialization=false;                 // resetting the count
    delay(1000);
    digitalWrite(relay230_24,    LOW);
  }
  if (lastButtoncurrent == HIGH) {
    unsigned long currentMillis = millis();
    if(currentMillis - previousMillis > interval) {
      previousMillis = currentMillis;   

      if (HeatButtonState == HIGH)
        HeatButtonState = LOW;

      digitalWrite(fan, HeatButtonState);
    }
   lastButtoncurrent = currentButtoncurrent;
  }

  //---------------------------------------------------------------------

}


220  Using Arduino / Project Guidance / Re: heating control on: July 02, 2012, 01:18:31 pm
any ideas?
221  Using Arduino / Project Guidance / Re: heating control on: June 23, 2012, 09:31:22 am
dont no what i have dun this time lol but still having the same prob?


Code:


const int heatbutton     = 2 ;
const int ignition_fan_2 = 10;
const int saleswitch     = 4 ;
const int solenoid       = 12;
const int photo_pressure = 3 ;
const int lockoutled     = 8 ;
const int heatbutton_feed= 5 ;
const int fan            = 9 ;
const int relay230_24    = 11;
const int ionisation_in  = 7 ;
int ionisation           = 5 ;   
bool DoneInitialization = false;       
// Variables will change:
int HeatButtonState = LOW;      // HeatButtonState used to set the fan
long previousMillis = 0;        // will store last time fan was updated
long interval = 20000;          // dleay time
void setup()
{
  pinMode(heatbutton,       INPUT );   
  pinMode(ignition_fan_2,   OUTPUT);
  pinMode(saleswitch,       INPUT );
  pinMode(solenoid,         OUTPUT);
  pinMode(photo_pressure,   INPUT );
  pinMode(lockoutled,       OUTPUT);
  pinMode(heatbutton_feed,  OUTPUT);
  pinMode(fan,              OUTPUT);
  pinMode(relay230_24,      OUTPUT);
  pinMode(ionisation_in,    INPUT );
  //-------------------------------------------
  digitalWrite(heatbutton_feed, HIGH);
}

void loop() {
  int val = analogRead(ionisation);
  int lastHeatButtonState = HIGH;
  int currentHeatButtonState = digitalRead(heatbutton);
  //--------------------------------------------------------------------

  if (digitalRead(heatbutton)==               HIGH) {
    delay(10);    //debounce
    if (!DoneInitialization)
    {                                                 
      if (digitalRead(ionisation_in)==        HIGH) {         // if ionisation swith HIGH
        if (val >900) {                                       
          digitalWrite(lockoutled,            HIGH);
          delay(10);
          digitalWrite(heatbutton_feed,       LOW);
          return;
        }
      }   
      else {
        if (digitalRead(photo_pressure)==     HIGH) {         // if photo swith HIGH
          delay(10);
          digitalWrite(lockoutled,            HIGH);
          delay(10);         
          digitalWrite(heatbutton_feed,       LOW);
          return;
        }
      }
      digitalWrite(fan,                        HIGH);
      delay(3000);       

      //---------------------------------------------------------------------
      if (digitalRead(saleswitch)==HIGH) {        // sale switch if HIGH
        digitalWrite(relay230_24,    HIGH);       // 230V out put to ignition
        digitalWrite(ignition_fan_2, HIGH);
        delay(1000);
        digitalWrite(solenoid,     HIGH);
      }
      DoneInitialization=true;                   // Initialization is done, don't run it again until button has been low
    }
    //---------------------------------------------------------------------
    if (digitalRead(saleswitch)==   LOW) {          // sale switch if LOW
      digitalWrite(lockoutled,      HIGH);
      digitalWrite(solenoid,        LOW);
      digitalWrite(fan,             LOW);
      delay(10);
      digitalWrite(heatbutton_feed, LOW);
    }
    //---------------------------------------------------------------------
    delay(3000);
    if (digitalRead(ionisation_in)== HIGH) {
      if (val <900)                         {         // ionisation if LOW
        digitalWrite(lockoutled,      HIGH);
        delay(10);
        digitalWrite(heatbutton_feed, LOW);
      }
    }

    if (digitalRead(photo_pressure)==LOW)  {          // photo if LOW
      delay(10);
      digitalWrite(lockoutled,       HIGH);
      delay(10);
      digitalWrite(heatbutton_feed,  LOW);
    }
    //---------------------------------------------------------------------
    else {
      digitalWrite(ignition_fan_2, LOW);
    }
  }
  //---------------------------------------------------------------------
  else {                                      // switching off
    digitalWrite(solenoid,       LOW);
    digitalWrite(ignition_fan_2, LOW);
    DoneInitialization=false;                 // resetting the count
    delay(1000);
    digitalWrite(relay230_24,    LOW);
  }
  if (lastHeatButtonState == HIGH) {
    unsigned long currentMillis = millis();
    if(currentMillis - previousMillis > interval) {
      previousMillis = currentMillis;   

      if (HeatButtonState == HIGH)
        HeatButtonState = LOW;

      digitalWrite(fan, HeatButtonState);
    }
  }

  //---------------------------------------------------------------------

}


222  Using Arduino / Project Guidance / Re: heating control on: June 22, 2012, 11:08:13 am
Quote

Insert Quote

The only time previousMillis is ever set is after it's longer than the interval. It looks like you need to set the previousMillis variable to the current time the instant that the button goes from HIGH to LOW

ok how do i do that then?

Quote

Insert Quote

I've read half this thread. I have an idea why you want the delay but if I'm wrong Just ignore my post.

Most commercial furnaces have temp sensors on the fan circuit to make sure the fan keeps running after the burners quit. While you can continue to guess at this I think you would be better off installing a temp sensor and using that to turn off the fan.

That said I agree with everyone. Learn blink no delay and learn it well.

yes a temp sensor on the burner chamber would be better but im making this for a direct repalcement for a control curcuit what is not manufactured anymore
223  Using Arduino / Project Guidance / Re: heating control on: June 21, 2012, 02:46:13 pm
Code:


const int heatbutton     = 2 ;
const int ignition_fan_2 = 10;
const int saleswitch     = 4 ;
const int solenoid       = 12;
const int photo_pressure = 3 ;
const int lockoutled     = 8 ;
const int heatbutton_feed= 5 ;
const int fan            = 9 ;
const int relay230_24    = 11;
const int ionisation_in  = 7 ;
int ionisation           = 5 ;   
bool DoneInitialization = false;       
// Variables will change:
int fanState = LOW;             // fanState used to set the fan
long previousMillis = 0;        // will store last time fan was updated
long interval = 20000;          // dleay time
void setup()
{
  pinMode(heatbutton,       INPUT );   
  pinMode(ignition_fan_2,   OUTPUT);
  pinMode(saleswitch,       INPUT );
  pinMode(solenoid,         OUTPUT);
  pinMode(photo_pressure,   INPUT );
  pinMode(lockoutled,       OUTPUT);
  pinMode(heatbutton_feed,  OUTPUT);
  pinMode(fan,              OUTPUT);
  pinMode(relay230_24,      OUTPUT);
  pinMode(ionisation_in,    INPUT );
  //-------------------------------------------
  digitalWrite(heatbutton_feed, HIGH);
}

void loop() {
  int val = analogRead(ionisation);
  //--------------------------------------------------------------------

  if (digitalRead(heatbutton)==        HIGH) {
    delay(10);    //debounce
    if (!DoneInitialization)
    {                                                 
      if (digitalRead(ionisation_in)==   HIGH) {           // if ionisation swith HIGH
        if (val >900) {                                       
          digitalWrite(lockoutled,            HIGH);
         delay(10);
          digitalWrite(heatbutton_feed,       LOW);
          return;
        }
      }   
      else {
        if (digitalRead(photo_pressure)==     HIGH) {         // if photo swith HIGH
        delay(10);
          digitalWrite(lockoutled,            HIGH);
         delay(10);         
          digitalWrite(heatbutton_feed,       LOW);
         return;
       }
      }
      digitalWrite(fan,                    HIGH);
      delay(3000);       
     
    //---------------------------------------------------------------------
    if (digitalRead(saleswitch)==HIGH) {           // sale switch if HIGH
    digitalWrite(relay230_24,    HIGH);        // 230V out put to ignition
    digitalWrite(ignition_fan_2, HIGH);
    delay(1000);
      digitalWrite(solenoid,     HIGH);
    }
    DoneInitialization=true;                           // Initialization is done, don't run it again until button has been low
    }
    //---------------------------------------------------------------------
    if (digitalRead(saleswitch)==   LOW) {          // sale switch if LOW
      digitalWrite(lockoutled,      HIGH);
      digitalWrite(solenoid,        LOW);
      digitalWrite(fan,             LOW);
       delay(10);
      digitalWrite(heatbutton_feed, LOW);
    }
    //---------------------------------------------------------------------
    delay(3000);
    if (digitalRead(ionisation_in)== HIGH) {
      if (val <900)                         {            // ionisation if LOW
        digitalWrite(lockoutled,      HIGH);
        delay(10);
        digitalWrite(heatbutton_feed, LOW);
      }
    }

    if (digitalRead(photo_pressure)==LOW)  {          // photo if LOW
      delay(10);
      digitalWrite(lockoutled,       HIGH);
      delay(10);
      digitalWrite(heatbutton_feed,  LOW);
    }
    //---------------------------------------------------------------------
    else {
      digitalWrite(ignition_fan_2, LOW);
    }
  }
    //---------------------------------------------------------------------
    else {                                          // switching off
    digitalWrite(solenoid,       LOW);
    digitalWrite(ignition_fan_2, LOW);
    DoneInitialization=false;                    // resetting the count
    delay(500);
    digitalWrite(relay230_24,    LOW);
     unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;   
   
if (fanState == HIGH)
      fanState = LOW;
   
    digitalWrite(fan, fanState);
  }
    }
  //---------------------------------------------------------------------

}

224  Using Arduino / Project Guidance / Re: heating control on: June 21, 2012, 01:39:38 pm
ok i have this now working in a manner of speaking the delay seems to start as soon as its powered up instead of just when the button goes low ?

Code:

else {                                          // switching off
    digitalWrite(solenoid,       LOW);
    digitalWrite(ignition_fan_2, LOW);
    DoneInitialization=false;                    // resetting the count
    delay(500);
    digitalWrite(relay230_24,    LOW);
     unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;   
   
if (fanState == HIGH)
      fanState = LOW;
   
    digitalWrite(fan, fanState);
  }
    }
this at the top of the code
int fanState = LOW;           
long previousMillis = 0;       
long interval = 20000;
225  Using Arduino / Project Guidance / Re: heating control on: June 19, 2012, 02:31:58 pm
Quote

Use a stopwatch or timer instead of delay, delay will freeze the thread until the delay is up.

ok
does anybody have any examples for this that would be helpful to my project?
Pages: 1 ... 13 14 [15] 16 17 ... 21