Show Posts
Pages: [1] 2 3 ... 9
1  Using Arduino / Project Guidance / Re: Guidance on FSR/Button project on: April 05, 2014, 10:03:34 pm
First I have no idea what a FSR is?

I also am not entirely sure what you are asking, but if you are just trying to set a value for
Code:
int storeState = 0;  // to store the number
int counter = 0; //variable that will store the count
Just change the value every time the user pushes the up or down button, then use the "enter" button to exit the menu (no need to save since it resets the value every time you press the button up or down).  If you want the user to set the value every time the unit is powered on this will work.  No need to "save" the value.  Will that work?

Also check out "Debounce" http://arduino.cc/en/Tutorial/Debounce
2  Using Arduino / Project Guidance / Re: Switch to make Arduino controll a VFD on: April 05, 2014, 08:05:08 pm
Why not just add three relays and run the VFD logic through them? 
Have the Arduino control them and then you don't need to worry about separate ground path and if you ever need to replace the drive you won't need the same one. 
3  Using Arduino / Project Guidance / Re: Clamping inductive kickback of PWM fans? on: April 05, 2014, 07:19:26 pm
Quote
(can you elaborate on that since you have a scope ? What is your idea of "briefly" ?
No I can't at this time... I will when I get it back on the bench.  It is a good question, and I figured someone was going to ask when I was typing the original question.  Is it unrealistic to expect to clamp the spike totally or am I always going to have some?

Quote
Why do people think there is some necessity or advantage of using a Schottky diode for this purpose?
I usually use them for the low voltage drop, but in this case it was just what I had in the parts bin.  That is one reason I am asking is it the correct type to be using?  My understanding is a faster diode will perform better in this application?

The better spot for the diodes would be at the driver?

4  Using Arduino / Project Guidance / Clamping inductive kickback of PWM fans? on: April 05, 2014, 05:07:56 pm
Hi All,

So I have two large (25A @ 12v) fans that I am controlling via PWM and some MOSFETS.  They are working but I am seeing 62v PTP with the scope at the Fets output.  I have a schottky diode across the fan terminals at the fans, but am still getting the 62v spike briefly. 

Better way?
5  Using Arduino / Programming Questions / Re: Alternatring between two fans - How? on: November 12, 2013, 11:49:23 pm
The code was copied from the IDE using the "copy for forum" option... Perhaps you should ask them to change the tag since in puts them in.
I will, if I can figure out who to mention it to.

It is the same format it just adds the color tags, why don't you like it?
6  Using Arduino / Programming Questions / Re: Help with implementing a Menu on: November 12, 2013, 11:40:32 pm
You are using the same pins for the LCD as the buttons?
Code:
const int buttonLeft=   4;      // Left button
const int buttonRight=  3;     // Right button
const int buttonEsc=    2;       // Esc button
const int buttonEnter=  1;    // Enter button

int ButtonPushed = 0;

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

Or are you using one analog pin for all four buttons?
7  Using Arduino / Programming Questions / Re: Alternatring between two fans - How? on: November 12, 2013, 11:33:26 pm

Everyone here tries to help where we can, but it's a hobby, so if we're browsing the threads and can help we do that; if a thread looks like there's info missing, it gets closed and on to the next one.
Fair enough.
I have gotten a lot of good help from lots of people and am thankful for all of it.
The code I posted was not really part of my question, more of a example of when the fans turn on and off. 

Quote from: lar3ry
Personally, I will not bother trying to take code that is in QUOTE tags insted of CODE tags, fart around reformatting it to readability,  and guessing what else might be in the code, just to answer a question from someone who can't be bothered to ask it properly.
The code was copied from the IDE using the "copy for forum" option... Perhaps you should ask them to change the tag since in puts them in.

Quote from: PeterH
You could use a statemachine to clean up the logic. This example uses my statemachine library found here;
Interesting, I think that will work.  I was not thinking of breaking it out into separate functions, but that should do it.
Thanks


8  Using Arduino / Programming Questions / Re: Alternatring between two fans - How? on: November 07, 2013, 10:56:34 pm
When did I say I know the answer? 

And why do you post smart ass questions?  Who does that help?
9  Using Arduino / Programming Questions / Re: Alternatring between two fans - How? on: November 07, 2013, 09:01:01 pm
Nothing else in the code except for the declarations has anything to do with what was posted or asked.
10  Using Arduino / Programming Questions / Alternatring between two fans - How? on: November 07, 2013, 08:50:17 pm
Objective: 
Have two fans but only run one at a time, when the temp sensor calls for the fan to come on one will start and stay on until a shutdown temp is met.  Then on the next on call the other fan will come on and stay on until a shutdown temp is met.

I have the alternating part, but I dont know how to latch the on state so the fans don't bounce back and forth on each cycle through the loop. 


Quote
                            
 /*
 * FAN logic...
  */
if (inside_temp < shutdownTemp)                                                       // if temp is below shutoff point turn off
outputValue = 0;                                                                    // fan is off
else if (inside_temp > shutdownTemp && inside_temp < startTemp && outputValue == 0)   // we are above our shurdown point but under the startup point
outputValue = 0;                                                                    // fan is off
else if (inside_temp < outside_temp)                                               // if the temp inside is lower than te outside temp stay off
outputValue = 0;                                                                    // fan is off
else if (inside_temp > startTemp && inside_temp > outside_temp) {    //temp above start up
 dif =  inside_temp - outside_temp;
if (dif > dif_above){ // full output, outside temp went way down FAST and inside is still hot.
outputValue = 255; 
      }
      else{
       outputValue = map(dif, 0, dif_above, min_speed_adj, max_speed_adj);                   // start fan and adjust accordingly
       }
}
// pick what fan to use
// this works but will not do what I want, as this is it swaps fans on EVERY cycle in the loop
if (lastFanOn == 2){
lastFanOn = 1;
// use fan #1
analogWrite(fan_1, outputValue);  // writes to PWM output
analogWrite(fan_2, 0);  // writes to PWM output -- this fan is OFF --
              }else  {
             lastFanOn = 2;
              // use fan #2
               analogWrite(fan_1, 0);  // writes to PWM output -- this fan is OFF --
               analogWrite(fan_2, outputValue);  // writes to PWM output   
                 }
                              
                              

11  Using Arduino / Programming Questions / Re: Help with implementing a Menu on: November 03, 2013, 07:40:36 pm
Also find,
Code:
long debounceDelay = 500;    // the debounce time
and change it to
Code:
long debounceDelay = 150;    // the debounce time

I found 500 to be way to long...
12  Using Arduino / Programming Questions / Re: Help with implementing a Menu on: November 03, 2013, 07:32:52 pm
I would stick to the default parent child structure since it is easier to read and just change the display name. This is what I have for one I am working on. 

Quote
//Menu variables
MenuBackend menu = MenuBackend(menuUsed,menuChanged);
//initialize menuitems
    MenuItem menu1Item1 = MenuItem("Edit Settings");
      MenuItem menuItem1SubItem1 = MenuItem("On Temp.");
      MenuItem menuItem1SubItem2 = MenuItem("Off Temp.");
      MenuItem menuItem1SubItem3 = MenuItem("Battery Offset");
    MenuItem menu1Item2 = MenuItem("Status");
      MenuItem menuItem2SubItem1 = MenuItem("Fans");
      MenuItem menuItem2SubItem2 = MenuItem("Sensors");
      MenuItem menuItem2SubItem3 = MenuItem("Bat. Voltage");
    MenuItem menu1Item3 = MenuItem("Log Info");
      MenuItem menuItem3SubItem1 = MenuItem("Min/Max - In");
      MenuItem menuItem3SubItem2 = MenuItem("Min/Max - Out");


You also need to edit the menu values farther down the page...
Quote
  if(newMenuItem.getName()==menu.getRoot()){
      mySerial.print("Main Menu       ");
  //  ------ Edit Setings Menu:  ------
  }else if(newMenuItem.getName()=="Edit Settings"){
      mySerial.print("Edit Settings   ");
  }else if(newMenuItem.getName()=="On Temp."){
      mySerial.print("On Temp. edit   ");
  }else if(newMenuItem.getName()=="Off Temp."){
      mySerial.print("Off Temp. edit  ");     
  }else if(newMenuItem.getName()=="Battery Offset"){
      mySerial.print("Bat.Offsetet edt");
  // ------ Status Menu:  ------     
  }else if(newMenuItem.getName()=="Status"){
      mySerial.print("Status Display  ");
  }else if(newMenuItem.getName()=="Fans"){
      mySerial.print("Fans status     ");
  }else if(newMenuItem.getName()=="Sensors"){
      mySerial.print("Temp Sens. Disp.");
   }else if(newMenuItem.getName()=="Bat. Voltage"){
      mySerial.print("Bat. Voltage    ");   
  // ------ Log Info Menu:  ------   
  }else if(newMenuItem.getName()=="Log Info"){
      mySerial.print("Saved Data      ");
  }else if(newMenuItem.getName()=="Min/Max - In"){
      mySerial.print("Inside temps    ");
  }else if(newMenuItem.getName()=="Min/Max - Out"){
      mySerial.print("Outside temps   ");
  }

Hope that helps...
13  Using Arduino / Programming Questions / Re: Adding Tone to menu buttons, having problems on: November 03, 2013, 06:48:53 pm
Menu file...
14  Using Arduino / Programming Questions / Adding Tone to menu buttons, having problems on: November 03, 2013, 06:47:38 pm
Started out with a simple task of adding a "Beep" for each button press on a keypad to be used with LCD menu.

Note that the Menu is not complete in this code, but working. 

Code:
void  readButtons(){  //read buttons status
Does what it says it checks the status of four buttons Esc., Up, Down and Enter.  When the menu is displaying the default page "Main Menu" the Up and Down button works fine (does nothing but beep) but the Esc. one does not sound correct.  It sounds like it is getting cut off and starting over on every press. 

I have changed the debounceDelay time and tone duration, but they don't appear to have any change on the behavior. 
The problem appears to be caused by the menu code. 

This is what I added to make the beep on each key press.
Code:
if (buttonEnterState==HIGH || buttonEscState==HIGH ||  buttonLeftState==HIGH || buttonRightState==HIGH){
     tone(5, 1050, 200);
     }


The full code is attached.
15  Using Arduino / General Electronics / Re: Rds(on) loss calculation? on: May 19, 2013, 08:47:22 pm
I knew that was to good to be true!  smiley
Yep need another 0... oops

Other than the 100 * 100 being incorrect is the formula correct?






Pages: [1] 2 3 ... 9