Show Posts
Pages: 1 ... 2250 2251 [2252] 2253 2254 ... 3084
33766  Using Arduino / Project Guidance / Re: Water Feature Feasibility on: July 16, 2011, 03:00:36 pm
Quote
want to make a water feature using a 1.5A 12v pump that runs off of a 12v battery that is recharged by a solar panel.
Power equals volts times amps, so your 1.5A 12V pump needs 18 watts per hour.

Quote
The pump would only be ran around 5 hours a day, if that.
OK, so, 90 watts per day, maximum.

Quote
The solar panel I found was really small, only $20, and only 2w.
So, in full sun, that panel will require 45 hours to replace what is used in one day.

Quote
My main question is how long would it take a 2w solar panel to recharge a 12v marine battery to full?
Unanswerable with more details on the battery, and irrelevant in any case.

You will need more than one of those solar panels to power recharge the battery that powers that pump.
33767  Using Arduino / Programming Questions / Re: Understanding state machines, with regard to temperature control on: July 16, 2011, 02:02:34 pm
Grab a piece of paper. Define each state that the equipment can be in. Define how to get from one state to another. Define when to transition from one state to another.

The states might be:
1) fridge too cold, heater on
2) fridge too cold, heater not on
3) fridge too warm, cooler on
4) fridge too warm, cooler not on
5) fridge just right

Transitioning from state 1 to state 2 is easy - turn the heater off. Transitioning from state 2 to state 1 is also easy (and the more normal transition) - turn the heater on.

Determining WHEN to transition is the more difficult part. Clearly, you need to know something about the temperature of the fridge to know what state you are currently in. Some transitions are beyond your control, such as the fridge getting too warm or tool cold. Others are within your control.

Some transitions should occur automatically (from "fridge just right" to "fridge too warm, cooler off"). Others require explicit actions (turning the cooler or heater on).

Some transitions should not occur automatically - you might want to wait just a bit to see if the state remains constant - opening the fridge door will result in a change in temperature, but the thermal mass of the contents might drop the temperature again when the door is closed, with no need to actually run the cooler).

For some states, you want to remain in that state until the conditions for change remain true for an extended period of time.

Once you know the states, and what conditions trigger a transition, it is easy to implement the state determination and transition changes as code on the Arduino.

If you need help, post the states you come up with, the transition steps you determine are necessary, and when the transitions should occur.

We can then help you with code to determine the current state or the code needed to transition.
33768  Using Arduino / Programming Questions / Re: how do I create a datafile with numbers separated by TAB's on: July 16, 2011, 01:48:57 pm
Quote
But in the code I use numbers are splitted by a "," in a string and when copying this to excel it do not become nice columns with sensordata.
Excel can be told to use different separators when reading text files. The comma is quite common - the csv extension stands for comma-separated values - and excel can read csv files.

The character '\t' will put a tab in the file wherever it is used.
33769  Using Arduino / Programming Questions / Re: how to turn a relay off and on when voltage = x help ? on: July 16, 2011, 12:23:06 pm
Quote
The swop value will remain 1, until you reset it to 0
It will. The battery swap will occur as soon as the voltage drops to 400/1023 * 5.0 (1.95 volts), even if that drop occurs only for a few microseconds due to load. If that's OK, go for it.
33770  Using Arduino / Programming Questions / Re: trigger a pin via the internet? on: July 16, 2011, 12:19:11 pm
Quote
its not for turning the server off. Its for turning it on, if not in proximity of it.
Quote
i need to be able to turn it off when im not at home
Well, which is it?

Quote
however when i think of MAC addresses i think of them like this: 07:e0:17:8f:11:2f or this 07-e0-17-8f-11-2f
The MAC address consists of 6 btyes. Whether those bytes are shown with colons or dashes or commas between them matters not. The important part is the 6 actual values.
33771  Using Arduino / Project Guidance / Re: Piezoelectric Power Yield on: July 16, 2011, 11:35:23 am
The voltage generated appears to be from a nearly instantaneous change in force, not the slow change caused by bobbing up and down a small amount.

How many square meters of material were you planning on using?
33772  Using Arduino / Programming Questions / Re: trigger a pin via the internet? on: July 16, 2011, 11:28:15 am
Quote
can i make the arduino act as any other webserver, that just sends/opens the file called index.html when someone visits the site?
Perhaps you could start with making your shift key work.

It does not sound like you have any experience with web design (necessary if the Arduino is to be a web server), form design.usage (necessary if the data entered is to be sent back to the Arduino), or Arduino programming (necessary to interpret and use what you get back).

I'd recommend that you break this project into three parts. Install a web server on your computer - Apache is free, easy to install and configure and dirt simple to use. Then, learn some stuff about serving web pages.

Progress to serving forms, with input boxes and/or buttons. Learn to write a script that is invoked when the form is requested/submitted.

When you have your PC serving up three pages - the initial form, the ON page and the OFF page, in response to the selection of the ON and OFF buttons on the form, you are then in a position to make the Arduino serve up and respond to the form submission.

It's not a difficult project at all if you have experience in web (form) design, web scripting (responding to the form data), and Arduino programming. It's a big job if you have none of the three skills.

A big sign on the door that says "TURN THE SERVER OFF" is cheaper and easier.
33773  Using Arduino / Project Guidance / Re: Temperature sensor using LM335 and the Uno on: July 16, 2011, 11:19:13 am
Quote
I tried adding the "LM335" library I found
Where did you find it? Where did you install it? Did you restart the IDE after installing the library?

Quote
that didn't seem to work, as I get errors when I try to upload to the uno.
Seems like the answers to some of the previous questions are "no" or "in the wrong place" or "no".

What errors?

Quote
If you need more details, let me know
Well, yes, we do.
33774  Using Arduino / Networking, Protocols, and Devices / Re: GPS + ArduIMU+V2 on: July 16, 2011, 11:00:17 am
Links are better than names any day of the week.
33775  Using Arduino / Programming Questions / Re: Generate array with random values on: July 16, 2011, 10:59:07 am
Quote
I don't think this code generates 12 unique numbers...
The array starts with 12 unique numbers. The code simply shuffles the order of elements in the array. At the end, the elements still contain unique values.
33776  Using Arduino / Programming Questions / Re: SPI communication on: July 16, 2011, 09:43:26 am
Quote
Can I get a code to connect these pins to another SPI port for communication.
Wouldn't that depend on WHAT you wanted to communicate?
33777  Using Arduino / Programming Questions / Re: how to turn a relay off and on when voltage = x help ? on: July 16, 2011, 09:42:19 am
Quote
So how would i keep this relay off , and only turn on when second battery makes the switch .
second battery will have same problem as the first .
The Arduino is obviously going to have to monitor both batteries.

If both are high, no switching is required.

If one is low, and the other is high, consider switching to the high battery. Switch only if the high battery is not the current battery.

If both are low, switch to the one with the highest voltage.

By reading only once a minute, you'll avoid the constant toggling back and forth between active batteries.

You can add a tolerance, too. If the difference between the readings is less than the tolerance, do nothing. That is, if one battery reads 399, and the other reads 401, and the tolerance is 10, the difference (2) is less than the tolerance, so do nothing. If one reads 388, and the other reads 399, the difference (11) is greater than the tolerance, so switch, even though both are low.
33778  Using Arduino / Programming Questions / Re: how to turn a relay off and on when voltage = x help ? on: July 16, 2011, 09:19:19 am
Code:
      if (redstate == LOW)
      redstate = HIGH;
     
      else
      redstate = LOW;
Could be written as:
Code:
      redstate = !redstate;

Code:
  outputValue = map(sensorValue, 0, 1023, 0, 255);
It would be faster to compute the output value like so:
Code:
  outputValue = sensorValue / 4;
33779  Using Arduino / Programming Questions / Re: how to turn a relay off and on when voltage = x help ? on: July 16, 2011, 09:15:02 am
Quote
I know i can do this by time and not by sensing voltage , i would like to see if its possible
by reading the value of the voltage and switching relays on or off when voltages get to
a set level .
Of course it is possible. While you are reposting code, though, consider that you might want for the voltage to get to/under a threshold, and stay there for a period of time, before switching. In other words, switching as soon as the threshold value is reached may not be the best option. Low voltage for a period of seconds would be a reason to switch, not just low voltage. The reason for this is that the Arduino will see a low voltage if something that the battery is powering turns on, but the voltage may immediately rise again, so swapping batteries immediately would be unnecessary.
33780  Using Arduino / Programming Questions / Re: Serial commands on: July 16, 2011, 08:50:55 am
Quote
I was talking about wanting to use if (conditions){action} to check if something i typed matched any stored options
Easy. How will you be storing these options?

Some sample code:
Code:
#define SOP '<'
#define EOP '>'

bool started = false;
bool ended = false;

int index = 0;
#define ASIZ 24
char inData[ASIZ]; // Size as needed

void loop()
{
   while(Serial.available() > 0)
   {
      int inChar = Serial.read();
      if(inChar == SOP)
      {
         started = true;
         ended = false;
         index = 0;
         inData[index] = '\0';
      }
      else if(inChar == EOP)
      {
         ended = true;
      }
      else
      {
         if(index < ASIZ)
         {
            inData[index] = inChar; // Append the character
            index++;
            inData[index] = '\0'; // Append a NULL
         }
      }
   }

   if(started && ended)
   {
      if(strcmp(inData, "on") == 0)
      {
         // Turn something on
      }
      else if(strcmp(inData, "off") == 0)
      {
         // Turn something off
      }
   }
}

This can easily be expanded to be able to handle input like "Pin 7 on" or "Pin 9 127". Look at strtok() for extracting one or more tokens from a string.
Pages: 1 ... 2250 2251 [2252] 2253 2254 ... 3084