Show Posts
Pages: 1 [2] 3 4 ... 33
16  Using Arduino / Project Guidance / Re: Alt-Az Tracking Device - Astronomy Help! on: August 14, 2014, 06:10:14 am
Without gearing?
That is most definitely not the way I would approach it. It would require some pretty strong and extremely accurate servos to properly track the stars. Earth rotates once per day (duh), that means 0,004167 degrees per second. Even at medium magnification, you need several smaller adjustments each second to avoid noticeable jumps and telescope shaking. No servo of reasonable price can achieve that precision.
Gearing is the only reasonable way and to drive those gears you'd need either a DC motor with speed control and feedback or a proper stepper.
The conventional way of driving a stepper is with a microcontroller, so you can at least meet that requirement.

EDIT:
Is the alt-az mount a requirement? I would think that equatorial would be a significantly better option for star gazing.
17  Using Arduino / Project Guidance / Re: Solving angular measurements. on: August 14, 2014, 01:30:53 am
The problem you are having is because of this line:
    Serial.println(storedHeading[1] - storedHeading[0]);

You are not taking into account the direction of rotation, only the two positions where measurements are taken.
If you know you will never rotate your device for more than 179° at a time you can assume that it was rotated along the shorter direction, but that's not very nice way to do it.
Better, solution would be to check intermediate positions. You can accomplish that not by checking only when the button is pressed but continuously, and using that stream of information as a clue in which direction you are rotating your device.
18  Using Arduino / Project Guidance / Re: Can a single gps reciever get a RTK accuracy? on: August 12, 2014, 03:26:30 pm
An independent GPS unit capable of cm accuracy and costing less than (for example)  $500 would command an enormous market, so why isn't it here already?

The core of GPS system is not capable of that kind of accuracy. There is Gallileo, however.
http://en.wikipedia.org/wiki/Galileo_(satellite_navigation)
19  Using Arduino / Project Guidance / Re: Synchronized led blinking in multiple boards, wirelessly controlled on: August 12, 2014, 03:16:21 am
It's feasible.
One boards sends a ping to which the other board replies. The first board measures the time between sending and receiving the pulse, divides it by half for one way trip and applies the offset.
Assuming that the sending and receiving code is the same on both boards (takes the same amount of time) it should work.
20  Using Arduino / Project Guidance / Re: Can a single gps reciever get a RTK accuracy? on: August 11, 2014, 12:38:47 pm
Obviously not, as there would be no need for RTK system, would it?
Why not ultrasound for final approach? Much more accurate at small ranges than GPS.
21  Using Arduino / Project Guidance / Re: Game Console: Mutliple AVR work together on: August 08, 2014, 12:48:34 pm
Take a look at this:
https://www.youtube.com/watch?v=UApiKkhRDpo
22  Using Arduino / Project Guidance / Re: Two switches, one light, conditional? on: August 08, 2014, 11:58:28 am
No, not annoyed, just trying to get you into a habit of good naming as early as possible. The problem is not while you actively work on a piece of code. The problems start when you return to it after a few months and have no idea what you were thinking while writing it. Happened to me too many times. smiley-sad

You're welcome. If you need something else, you know where to find us.
23  Using Arduino / Project Guidance / Re: Two switches, one light, conditional? on: August 08, 2014, 06:54:09 am
No problem. Others helped me, all I'm trying to do is spread the love around.

Code:
      if (ledon  == LOW)
    {
      ledon = !ledon;                // toggle running variable
      digitalWrite(soundPin, ledon);      // indicate via LED
      unsigned long currentMillis = millis();
    }

Get rid of  "unsigned long".
You already declared that variable.
currentMillis = millis(); is enough.
I would advise you use a different, more descriptive, variable name, though. Something like buzzerOnMillis or similar.
Other than that, this part is good. You now know when the buzzer started to buzz.

Code:
if(currentMillis - previousMillis > three) {
    previousMillis = currentMillis;   
      if (ledon = true){
        digitalWrite(soundPin, LOW);
      }
  }
You never change the value of previousMillis so it's still 0. That means the code will enter this if statement if the buzzer was turned on more than three seconds after the power up. That is not what you want, is it?

You need to check if current time is more than three seconds after the time the buzzer was turned on.
if (millis() > currentMillis + three) or buzzerOnMillis if you chose to rename the variable.
Same condition can be expressed in more ways:
if (millis() - three > currentMillis)
if (currentMillis + three < millis())
if (currentMillis < millis() - three)
Pick the one you find the most intuitive.

You still need to add the part where you turn the flag back to LOW when the switches are in proper state.
24  Using Arduino / Project Guidance / Re: auto-editing code on: August 08, 2014, 02:02:56 am
What about various parameters stored in EEPROM? Sure, the code would have to be inside from the beginning but with enough foresight you could have a very flexible code.
25  Using Arduino / Project Guidance / Re: Potentiometer Temperature Stability on: August 07, 2014, 02:13:59 pm
Ok, why don't you put the temperature sensor in the water next to the ph probe?

Jumpers would be connected to resistors of different values hooked up in parallel, leading to an analogue input. Depending which jumper you short, you get different readings.

But I still don't get it. The ph changes with temperature. It's not that you get false readings - the actual ph changes, right? So who cares what temperature the water is? You need to adjust ph regardless.
26  Using Arduino / Project Guidance / Re: Potentiometer Temperature Stability on: August 07, 2014, 01:37:11 pm
I'd say that the stability over such small ranges is much better than your ability to eyeball the position and the actual temperature.
Alternatives to a pot is several jumpers, each for a predetermined temperature value.
But seriously, how much do you expect the temperature to fluctuate? And more importantly how large are the variations in ph with the change of temperature?
Uh, whatever the change in ph due to temperature, it's actual ph, isn't it? Are you sure you should compensate? Perhaps the ph probe needs compensation?
27  Using Arduino / Project Guidance / Re: Itead HC-06 Module, how to connect to Arduino on: August 07, 2014, 01:26:24 pm
Have you checked their documentation?
http://wiki.iteadstudio.com/HC06_Serial_Bluetooth_Brick#Demo

Note that this is 3,3V device. Plugging it into a 5V Arduino UNO can damage it.
28  Using Arduino / Project Guidance / Re: Two switches, one light, conditional? on: August 07, 2014, 12:19:59 pm
Get rid of this.

Code:
if (digitalRead(buttonPin) == HIGH)
  {
    delay(100);                        // delay to debounce switch
    ledon = !ledon;                // toggle running variable
    digitalWrite(soundPin, ledon);      // indicate via LED
  }

You don't want to mess with the value of ledon unless there is a change in the state of the button. What this does is toggle the ledon value and turns the buzzer on and off rapidly for as long as buttonPin is HIGH. You want only one change.


For the off timer, you started to work with millis(). That's fine and you'll need to get to know how to use it eventually, so why not now, eh?
I'm not sure how familiar are you with it, so forgive me if I cover the basics.

millis() gives you the time in milliseconds from the moment the microchip was turned on. It doesn't tell the time, only elapsed time. It's like a stopwatch, not a clock.
Using it is the same as you use any watch when you want to do something for a period of time. In your case you want to turn off a light three seconds after it was lit up.
What you do is take a look at what time it is (millis()) at the moment of turning the light on and store that time in a variable. You want to make sure you write down that time only once - at the moment of turning the light on and don't overwrite it unintentionally. We've already set up the basis for this when we introduced the flag.
The place to check this time is in
if (ledon  == LOW)
Now that you know when you turned the light on, all you need to do is occasionally take a look at the watch and see if three seconds have passed. If yes, turn the light off, if not, check again later.
In this case a good place to check time and decide if you want to do something is in the main loop.
29  Using Arduino / Project Guidance / Re: Two switches, one light, conditional? on: August 07, 2014, 10:31:23 am
Code:
if (digitalRead(buttonPin) == HIGH)
  {
    delay(100);                        // delay to debounce switch
    ledon = !ledon;                // toggle running variable
    digitalWrite(soundPin, ledon);      // indicate via LED
  }

What this does is change ledon value 10 times per second as long as buttonPin is HIGH. You want the ledon value to change only once for each switch change.

Try:
Code:
if (ledon  == LOW)
  {
    delay(100);                        // delay to debounce switch
    ledon = !ledon;                // toggle running variable
    digitalWrite(soundPin, ledon);      // indicate via LED
  }
Also, move this last bit inside the
if (buttonState  != buttonState2)
You want both conditions (different switch states and flag) to be met. Remember that you can nest as many ifs inside one another as you need.

Don't forget to place an equivalent code for changing the flag back to LOW (it would go inside else) and remember to turn the siren off.
30  Using Arduino / Project Guidance / Re: IC implementation of min function (looking for) on: August 07, 2014, 10:13:44 am
This is what I love about this community.
It's hard to find something when you don't know what it's called, but there is always somebody around that has more experience in a relevant area.
Pages: 1 [2] 3 4 ... 33