Show Posts
Pages: [1]
1  Using Arduino / Motors, Mechanics, and Power / Re: Gears vs Belts on: July 01, 2013, 11:12:33 am
Torque is gram-cm, not kg-cm.
2  Using Arduino / Motors, Mechanics, and Power / Re: Gears vs Belts on: July 01, 2013, 02:31:42 am
The knob on the control valve turns perhaps 300 degrees.
3  Using Arduino / Motors, Mechanics, and Power / Gears vs Belts on: June 30, 2013, 07:25:22 pm
I'm putting together a project to control my gas water heater by turning the knob on the control valve.
I measured the torque required to turn the knob (crudely by attaching vice grips to the knob, then measuring the weight to turn it). Conservatively it needs 5.75 kg-cm. I have a stepper motor rated for 2.3 kg-cm so I thought 1:2.5 gear ratio would be appropriate.
My question is whether I should use gears or a belt. I'll have to devise some way of attaching the motor assembly to the gas heater controller vale and thought that a belt would be a little more forgiving in what will likely be a difficult mounting. I was considering mounting the motor assembly with a light spring to keep tension on the belt.
Any comments or suggestions appreciated!


4  Using Arduino / Networking, Protocols, and Devices / UdpNtpClient on: December 05, 2012, 12:21:04 am
Hi,
I have been using the UdpNtpClient code from http://arduino.cc/en/Tutorial/UdpNtpClient successfully for months. Earlier this week, however, my Arduino Ethernet stopped connecting to the time server. I determined that the IP address used in the example no longer worked for me. Using an alternate site fixed the issue.
Original that no longer works for me: IPAddress timeServer(192, 43, 244, 18);
New address that works for me:  IPAddress timeServer (198, 60, 73, smiley-cool;
There is a list of servers at http://tf.nist.gov/tf-cgi/servers.cgi
-Roy
5  Using Arduino / Programming Questions / Re: Passing class-member function to another class on: March 04, 2012, 10:14:59 pm
Hi,

Thanks for the responses. I was hoping for a "just put a -> after the variable and it'll work" type of answer. DuaneB: Your comments are interesting because I'm basically rewriting my original working sketch (which also includes buttons, LED displays, a web server and thermostat control) to make it object oriented. One of the first things that occurred to me is that, although the OO code is more understandable, extensible and compact from a coding perspective, I'm using more RAM. I'm not sure about more Flash but it wouldn't surprise me. pYro_65: the paradshift link greatly increased my understanding of this subject - Thanks!

-Roy
6  Using Arduino / Programming Questions / Passing class-member function to another class on: March 04, 2012, 12:49:19 am
Hi,
I'm creating a project to turn on & off my home's heat tapes (to melt snow on the roof to prevent ice dams) daily using the TimeAlarms.h library.
I'd like to create a HeatTape class that manages everything internally, including passing the onTickHandler (which is a function called by alarmRepeat). I'd like to define the onTickHandler within the HeatTape class because it uses a variable set within the class.
In my code below, I'd like to pass the HeatTapeClass::turnOn and HeatTapeClass::TurnOff functions to Alarm.alarmRepeat, but can not seem to do so. I've tried many variations including &HeatTape::turnOn without success.

Any suggestions are appreciated.
Thanks!

Code:
#include <Time.h>
#include <TimeAlarms.h>
class HeatTapeClass {

  public:
 
    // Properties
    char name[10];
    byte powerPin;
    byte programPin;
    byte hourOnLocation;
    byte minuteOnLocation;
    byte hourOffLocation;
    byte minuteOffLocation;
    AlarmId startAlarm;
    AlarmId endAlarm;

    // Methods
    void init(char *theName,
              byte thePowerPin,
              byte theProgramPin,
              byte theHourOnLocation,
              byte theMinuteOnLocation,
              byte theHourOffLocation,
              byte theMinuteOffLocation
              ) {
               
      strcpy(name, theName);
      powerPin = thePowerPin;
      programPin = theProgramPin;
     
      hourOnLocation = theHourOnLocation;
      minuteOnLocation = theMinuteOnLocation;
      hourOffLocation = theHourOffLocation;
      minuteOffLocation = theMinuteOffLocation;
     
      startAlarm = Alarm.alarmRepeat( getHourOn(),
                                      getMinuteOn(),
                                      00, // seconds
                                      turnOn // <----- how do I pass the HeatTapeClass::turnOn function here?
                                      );

      endAlarm = Alarm.alarmRepeat(   getHourOff(),
                                      getMinuteOff(),
                                      00, // seconds
                                      turnOff
                                      );
    };

    boolean isOn() {
      return digitalRead(powerPin);
    };
   
    void turnOn() {
      digitalWrite(powerPin, HIGH);
    };

    void turnOff() {
      digitalWrite(powerPin, LOW);
    };

    void toggleOnOff() {
      digitalWrite(powerPin, !(isOn()));
    };

    boolean isProgramEnabled() {
      return digitalRead(programPin);
    };
   
    void enableProgram() {
      Alarm.enable(startAlarm);
      Alarm.enable(endAlarm);
      digitalWrite(progamPin, HIGH);
    };
   
    void disableProgram() {
      Alarm.disable(startAlarm);
      Alarm.disable(endAlarm);
      digitalWrite(programPin, LOW);
    };

    byte getHourOn()    { return EEPROM.read(hourOnLocation); };
    byte getMinuteOn()  { return EEPROM.read(minuteOnLocation); };
    byte getHourOff()   { return EEPROM.read(hourOffLocation); };
    byte getMinuteOff() { return EEPROM.read(minuteOffLocation); };
   
    void setHourOn(byte value)    { EEPROM.write(hourOnLocation, value); };
    void setMinuteOn(byte value)  { EEPROM.write(minuteOnLocation, value); };
    void setHourOff(byte value)   { EEPROM.write(hourOffLocation, value); };
    void setMinuteOff(byte value) { EEPROM.write(minuteOffLocation, value); };
};
Pages: [1]