Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / Re: Adruino monitored wind turbine on: December 03, 2012, 10:47:21 pm
wireless with ethernet cable connected to wireless router than sending to another computer with a wireless hookup.
2  Using Arduino / Programming Questions / Arduino uno with ethernet shield problems on: November 29, 2012, 08:54:21 pm
Not sure if it is the program or if it is the router but I can not get the arduino uno with ethernet shield to send data to another pc wirelessly.
Can you view the program and tell me if there is anything that will help it work better. time is running out and I need to finish this before next week. please help    Michael Albert
Here is the code>    Thank you.

/*
 *    The purpose of this program is too monitor the voltage of a battery and depending on the voltage generator.
 *     The controller needs to handle a wide voltage range and a wide current range if connected to a turbine
 *    of varying speed. The speed can vary greatly and therefore the out will have to be carefully monitored.
 *
 *    The controller will have the following states:
 *        - Battery voltage below 14.0v       :    charge the battery
 *        - Battery voltage 14.0v or above    :    dump the turbine generator power to a dummy load
 *
 */
#include <SPI.h>
#include <Ethernet.h>
#include <Servo.h>

byte mac[] = { 0x90, 0xA2, 0XDA, 0X0D, 0X8B, 0X11 };  //mac address for Arduino//
byte ip[] = { 192, 168, 3, 178 }; //ip address//
byte gateway[] = { 192, 168, 1, 1 }; //internet access via router//
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(23); // server port

// Voltage divider constants (ohms)
const int    VD_R3                    =    10000;
const int    VD_R4                    =    1000;

// Manual buttons
const int    CHARGE_BUTTON            =    2; // DIN
const int    DUMP_BUTTON              =    3; // DIN

// LED displays
const int    STATUS_LED               =    13; // DOUT

// Battery charging
const int    BATTERY_MONITOR_PIN      =    0; // AIN
const int    INSTRUCTION_PIN          =    6; // DOUT
const float  BAT_VMIN                 =    11.9;
const float  BAT_VMAX                 =    14.0;

// Turbine RPM monitoring
const int    RPM_MONITOR_PIN          =    1; // AIN

// Other
const int    DELAY_TIME               =    32; // 32 default

// Program variables
bool manual = false;
bool charging = false;
EthernetClient client;
void setup()
{
    pinMode(STATUS_LED, OUTPUT);
    pinMode(CHARGE_BUTTON, INPUT);
    pinMode(DUMP_BUTTON, INPUT);
    pinMode(INSTRUCTION_PIN, OUTPUT);
   
    digitalWrite(STATUS_LED, HIGH);
   
    Serial.begin(9600);
    if (Ethernet.begin(mac) == 0){
      Serial.println("Failed to configure Ethernet using DHCP");
      for(;smiley-wink
        ;
    }
    Serial.println(Ethernet.localIP());
}

void loop()
{
    int vin = analogRead(BATTERY_MONITOR_PIN);
    float voltage = calculateBatteryVoltage(vin);
   
    int rin = analogRead(RPM_MONITOR_PIN);
    int rpm = calculateRPM(rin);
   
    if (chargeButtonDown())
    {
        manual = true;
        charge();
    }
    else if (dumpButtonDown())
    {
        manual = true;
        dump();
    }
   
    if (!manual)
    {
        if (voltage < BAT_VMAX)
            charge();
        else
            dump();
    }   
   
    manual = false;
   
    delay(DELAY_TIME);
}

float calculateBatteryVoltage(int vin)
{
    float resconst;
   
    if (VD_R3 == 0 || VD_R4 == 0)
        resconst = 1.0;
    else
        resconst = ((VD_R3 + VD_R4) / VD_R4);
   
    return (5.0 / 1023.0) * resconst * vin;
}

int calculateRPM(int rin)
{
    // this function will determine the rpm from an analog value
    // for now just return value passed
    return rin;
}

inline bool chargeButtonDown() { return (digitalRead(CHARGE_BUTTON) == HIGH) ? true : false; }

inline bool dumpButtonDown() { return (digitalRead(DUMP_BUTTON) == HIGH) ? true : false; }

inline void charge() { digitalWrite(INSTRUCTION_PIN, HIGH); charging = true; }

inline void dump() { digitalWrite(INSTRUCTION_PIN, LOW); charging = false; }

inline bool getState() { return (charging) ? true : false; }

void SerialWriteData(float voltage, int rpm)
{
    Serial.print("Voltage: ");
    Serial.print(voltage);
    Serial.print("V");
    Serial.print("RPM: ");
    Serial.print(rpm);
    // TO DO: show whether charging or not
}

Also can not find a proper arduino ip address maybe that is the problem  again help and thanks
3  Using Arduino / Project Guidance / Re: Adruino monitored wind turbine on: November 29, 2012, 08:38:30 pm
The peak voltage of the turbine is aprox. 220v but only going to use 15v. to charge a 12v battery. Measuring the voltage from the turbine to the battery and checking to see if it is charging or discharging also monitoring the rpms of the turbine. Just trying to verify if the wiring I have will work and if not can someone help with any suggestions on the wiring.  thanks M.A
4  Using Arduino / Project Guidance / Adruino monitored wind turbine on: November 20, 2012, 09:38:53 pm
HI I am working on Adruino uno monitoring wind turbine that's supposed to send info to a near by computer wirelessly using an ethernet shield. Have program sort of working but not sure how I need to wire the board so I can get the info from the wind turbine to the Arduino uno than to the nearby computer. any ideas on a schematic. I am using a voltage divider with 10k and 1k respectively. with a dump load resistor of approx. 1.7M. Probably too high of a dump resistor? The voltage divider is connected to pin A0 and the dump resistor is connected to D6. Is this correct? I can't find a board schematic of the proper pins  can anyone give me some pointers  thank  m.a.
5  Using Arduino / Programming Questions / Re: Programming outside ssource WiFiShield_library to Arduino programming on: November 06, 2012, 10:18:29 pm
Sorry about that forgot to send code. Decided to use Ethernet shield, got it to upload to Arduino with Ethernet shield. Not sure if it is sending info back to computer. When I upload the code it shows as being right (No errors) but when I disconnect the USB and connect the Ethernet cable i don't get any info on PC screen or serial monitor. Also trying to get wireless router involved, any ideas how.
here is the code, can you look it over and see if you can figure out why it isn't sending the info back to PC?  Thanks  Michael

/*
 *    The purpose of this program is too monitor the voltage of a battery and depending on the voltage generator.
 *     The controller needs to handle a wide voltage range and a wide current range if connected to a turbine
 *    of varying speed. The speed can vary greatly and therefore the out will have to be carefully monitored.
 *
 *    The controller will have the following states:
 *        - Battery voltage below 14.0v       :    charge the battery
 *        - Battery voltage 14.0v or above    :    dump the turbine generator power to a dummy load
 *
 */
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x90, 0xA2, 0XDA, 0X0D, 0X8B, 0X11 };  //MAC ADDRESS FOR ARDUINO//
byte ip[] = { 192, 168, 1, 1 }; //ip address//

// Voltage divider constants (ohms)
const int    VD_R3                    =    10000;
const int    VD_R4                    =    1000;

// Manual buttons
const int    CHARGE_BUTTON            =    2; // DIN
const int    DUMP_BUTTON              =    3; // DIN

// LED displays
const int    STATUS_LED               =    13; // DOUT

// Battery charging
const int    BATTERY_MONITOR_PIN      =    0; // AIN
const int    INSTRUCTION_PIN          =    6; // DOUT
const float  BAT_VMIN                 =    11.9;
const float  BAT_VMAX                 =    14.0;

// Turbine RPM monitoring
const int    RPM_MONITOR_PIN          =    1; // AIN

// Other
const int    DELAY_TIME               =    32; // 32 default

// Program variables
bool manual = false;
bool charging = false;
EthernetClient client;
void setup()
{
    pinMode(STATUS_LED, OUTPUT);
    pinMode(CHARGE_BUTTON, INPUT);
    pinMode(DUMP_BUTTON, INPUT);
    pinMode(INSTRUCTION_PIN, OUTPUT);
   
    digitalWrite(STATUS_LED, HIGH);
   
    Serial.begin(115200);
    if (Ethernet.begin(mac) == 0){
      Serial.println("Failed to configure Ethernet using DHCP");
      for(;smiley-wink
        ;
    }
    Serial.println(Ethernet.localIP());
}

void loop()
{
    int vin = analogRead(BATTERY_MONITOR_PIN);
    float voltage = calculateBatteryVoltage(vin);
   
    int rin = analogRead(RPM_MONITOR_PIN);
    int rpm = calculateRPM(rin);
   
    if (chargeButtonDown())
    {
        manual = true;
        charge();
    }
    else if (dumpButtonDown())
    {
        manual = true;
        dump();
    }
   
    if (!manual)
    {
        if (voltage < BAT_VMAX)
            charge();
        else
            dump();
    }   
   
    manual = false;
   
    delay(DELAY_TIME);
}

float calculateBatteryVoltage(int vin)
{
    float resconst;
   
    if (VD_R3 == 0 || VD_R4 == 0)
        resconst = 1.0;
    else
        resconst = ((VD_R3 + VD_R4) / VD_R4);
   
    return (5.0 / 1023.0) * resconst * vin;
}

int calculateRPM(int rin)
{
    // this function will determine the rpm from an analog value
    // for now just return value passed
    return rin;
}

inline bool chargeButtonDown() { return (digitalRead(CHARGE_BUTTON) == HIGH) ? true : false; }

inline bool dumpButtonDown() { return (digitalRead(DUMP_BUTTON) == HIGH) ? true : false; }

inline void charge() { digitalWrite(INSTRUCTION_PIN, HIGH); charging = true; }

inline void dump() { digitalWrite(INSTRUCTION_PIN, LOW); charging = false; }

inline bool getState() { return (charging) ? true : false; }

void SerialWriteData(float voltage, int rpm)
{
    Serial.print("Voltage: ");
    Serial.print(voltage);
    Serial.print("V");
    Serial.print("RPM: ");
    Serial.print(rpm);
    // TO DO: show whether charging or not
}
6  Using Arduino / Programming Questions / Re: Programming outside ssource WiFiShield_library to Arduino programming on: October 30, 2012, 10:37:42 pm
Getting compiling errors even when i use the examples from the libraries. can any one give me some suggestions to solve this problem.   MIchael
7  Using Arduino / Project Guidance / Re: ardunio to read and send info to pc via wifi shield for wind turbine on: October 29, 2012, 12:37:17 am
thank you will review them in depth if I have in more questions I will ask you again thanks
8  Using Arduino / Project Guidance / Re: ardunio to read and send info to pc via wifi shield for wind turbine on: October 27, 2012, 03:20:50 am
basically attaching arduino to wind turbine to monitor output and then having the arduino send the info wirelessly to the PC. Using a small turbine to power the blades while the arduino monitors the charging output and send to the PC over the Wifi. Any ideas on how to get this to work programming wise.  Voltage output between 5 volts and 9 volts stops charging if over 9v and starts if under 5v. trying to have wind turbine charge battery and monitoring charge rate. Frequency roughly 60Hz

 thanks again  michael
9  Using Arduino / Project Guidance / ardunio to read and send info to pc via wifi shield for wind turbine on: October 27, 2012, 12:07:51 am
looking for any ideas in how to get this project off the ground, programming is the main issue  if any one can give me some ideas i'd appreciate it   The info need to send will be the voltage, current, and RPM's  looking for a basic example  with which I can build on    thanks  michael
10  Using Arduino / Programming Questions / Re: Programming outside ssource WiFiShield_library to Arduino programming on: October 25, 2012, 08:24:28 pm

wifi shield library in computer under my blink sketches but when i try to use the library compiler doesnt recognize the library is there any way i can get it to recognize the wifi shield library   also trying to use the arduino and wifi shield to communicate to pc information from a wind turbine that it is connected to   if any one has any suggestion i would appreciate it  michael
11  Using Arduino / Project Guidance / Re: adruino and pc wifi connection on: October 18, 2012, 07:32:09 pm
Sorry getting frustrated... i meant i am trying to get the arduino to communicate to the PC wirelessly using a WiFi shield. but am having problems trying to formulate a program that will give the PC the voltage and current from the device connected to the arduino. I know there is a WiFiShield_library but it doesn't seem to be doing anything to compile the program.. Any advice please  Michael

Sorry there are two issues but you can help with either one I'd appreciate it

12  Using Arduino / Programming Questions / Re: Programming outside ssource WiFiShield_library to Arduino programming on: October 18, 2012, 07:24:01 pm
Sorry was trying to download WiFiShield_library to arduino but keep losing the library and can't get it to download to arduino sketch  if that makes any more sense please help   Michael
13  Using Arduino / Programming Questions / Programming outside ssource WiFiShield_library to Arduino programming on: October 16, 2012, 08:06:11 pm
Trying to program to arduino with a new program that came with the WiFi Shield. Downloaded the program but can't get it to work on the arduino source code screen can anyone talk me through a procedure to make it work  thanks  Michael
14  Using Arduino / Project Guidance / adruino and pc wifi connection on: October 09, 2012, 09:21:47 pm
can anyone help me with a program to get an adruino, pc , and wifi to collaborate together and communicate with each other. tried several different types of basic c programs is there an easier way or can i use use  C++
if Anyone can give me soem advice thanks
15  General Category / General Discussion / Re: As a currently on-break college student who just discovered arduino.. on: October 06, 2012, 07:36:53 pm
As a current college student in electronics. the math is mainly right angle trigonometry and calculus and some basic math
Pages: [1] 2