Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / Re: GPS accurate to microseconds on: November 24, 2013, 07:50:52 pm

Quote

You need a consumer module with 1 second output.  Some under $20 will have this tyied to a blinking LED...
Use this one second pulse to determine the accuracy if your Arduino Xtal in setup() then use the internal timer(s) for your measurements of phase shift.  Because you have a measured known frequency from your GPS marker pulse, you can skew (adjust) any small time differences between the two time sources.


So your saying to make sure the Arduino clock is synced to the 1 pulse per second on the GPS and then use the Arduino clock to time stamp each zero crossing?

I appreciate all of this help about how to go about it, but is there no way to just read the time given by the GPS into microseconds?
2  Using Arduino / Project Guidance / Re: GPS accurate to microseconds on: November 24, 2013, 04:50:15 pm


Still seems over complex. Why can't you just measure the time between the two zero crossings, timing it with say the micros(); function?


In industry they use GPS so that's the way my professor wants me to implement it unfortunately.

In what industry? Phase measurements are made all the time without GPS. Not saying you can't use the GPS as a triggering element to start a measurement, but it doesn't add any advantage as the accuracy of the measurement will be the function of time base accuracy being used to time the difference between the GPS signal and a zero crossing.
[/quote]

Power systems and SMART grid technology.  GPS gives a standard time source so multiple devices can be synced to the same clock.
3  Using Arduino / Project Guidance / Re: GPS accurate to microseconds on: November 24, 2013, 04:32:03 pm


Still seems over complex. Why can't you just measure the time between the two zero crossings, timing it with say the micros(); function?

[/quote]

In industry they use GPS so that's the way my professor wants me to implement it unfortunately.
4  Using Arduino / Project Guidance / Re: GPS accurate to microseconds on: November 24, 2013, 04:17:29 pm
The GPS is used to put a time stamp on each zero cross.  Because both waves are 60Hz, knowing the time difference for when they each cross zero will allow me to calculate the difference in degrees.  It is essentially a Phasor Measurement Unit used in power systems.

That's besides the point of this post though.  The problem I am having is reading the GPS to a microsecond accuracy.  The GPS receiver I have is accurate to 1us itself so i'm assuming it is possible.
5  Using Arduino / Project Guidance / GPS accurate to microseconds on: November 24, 2013, 03:15:43 pm
Hi everyone,

I'm doing a project for school where I need to calculate the phase difference between two sine waves.  I am using a zero cross detector as an input to an Arduino to detect the zero crossings.   Due to the nature of the project, I would ideally be using GPS to determine when the zero crossings happen.  I have come across the TinyGPS library but because I need accuracy in the microseconds I cannot use it as it only goes to 100ths of seconds.  Does anyone know of a way to either modify TinyGPS to give microsecond data or another library which already gives microseconds?

Thanks for any help. 
6  Using Arduino / Programming Questions / Digital HIGH, LOW Question on: October 23, 2013, 11:47:21 am
I'm using a zero cross detector to determine when a signal is positive and negative.  That part of the circuit works fine but in another section I need to control a relay based on the signal without using delay().  I want to set the relay LOW when the zero cross is HIGH and the relay HIGH when the zero cross is LOW.  I need to keep the code efficient so is there a way I can set the relay state opposite to the zero cross state without using if statements.

Code:
int crosspin=2;
int crosstime;
int prestate=0;
int state;
int pretime=0;
int peakpin=A8;
int relay=8;
int peak;
int ctr=0;


void setup() {
  // put your setup code here, to run once:
  
  pinMode(crosspin,INPUT);
  pinMode(peakpin,INPUT);
  pinMode(relay,OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  
  state=digitalRead(crosspin);
  peak=analogRead(peakpin);
  Serial.print("peak= ");
  Serial.println(peak);
  
  digitalWrite(relay,-state);
  
  
  
  if(state==HIGH&&prestate==LOW){
    crosstime=millis()-pretime;
    Serial.print("time= ");
    Serial.println(crosstime);
    pretime=millis();
  }
  
  if(state==LOW&&prestate==HIGH){
    crosstime=millis()-pretime;
    Serial.print("time= ");
    Serial.println(crosstime);
    pretime=millis();
  }
  prestate=state;

}

Thanks for any help.
7  Products / Arduino Due / Re: Problems with UTFT on: June 20, 2013, 10:35:26 am
I got it working.  Not exactly what happened but I tried it on a new computer and re downloaded the library.  The only thing I can think of is i I didn't properly delete the original library before adding the updated one.  Thanks for the help.
8  Products / Arduino Due / Re: Problems with UTFT on: June 19, 2013, 09:47:42 am
I just downloaded the latest version and it is still not working.  I even tried rewiring everything multiple times and still nothing.  Is downloading the new library the only thing you did to get it to work?
 
9  Products / Arduino Due / Problems with UTFT on: June 18, 2013, 01:05:37 pm
Hi,

I recently got an Arduino DUE and 3.2 inch SSD1289 TFT screen.

http://www.amazon.com/SainSmart-Display-Touch-Adapter-Arduino/dp/B008FWSG3S/ref=sr_1_6?ie=UTF8&qid=1371498262&sr=8-6&keywords=3.2+inch+tft+touch+screen

I've downloaded and added the Utouch and UTFT libraries located at http://henningkarlsen.com/electronics/library.php?id=55.

When running examples from either library, the code compiles and uploads to the Arduino but nothing is displayed on the screen.  The screen is wired to the Arduino based on the UTFT library documentation.

I've also tried writing my own code to see if the touch module works by itself.   

Code:

#include <UTFT.h>
#include <UTouch.h>





UTFT        myGLCD(TFT01_32, 38,39,40,41); 
UTouch      myTouch(6,5,4,3,2);


int x, y;
int led=9;
int check;


void setup(){
  Serial.begin(9600);
pinMode(led,OUTPUT);

}

void loop(){
 
  check=myTouch.dataAvailable();//checks if screen is touched
  myTouch.read();//reads touch
  x=myTouch.getX();//determines x coordinate
  y=myTouch.getY();//determines y coordinate
 
  Serial.print("check=");//prints so I can see results
  Serial.println(check);
  Serial.print("x=");
  Serial.println(x);
  Serial.print("y=");
  Serial.println(y);
 
  if(check==1){
   
    digitalWrite(led,HIGH);//if screen is touched, turn on led
  }
  else
 
 digitalWrite(led,LOW);

delay(10);
}

The output to the Serial Monitor remains 0 for all variables even when the screen is touched.

Any help on solving the display or touch issues is greatly appreciated.

Thanks
10  Using Arduino / Displays / Re: [solved] I can not get my 3.2'' LCD work with my Due on: June 18, 2013, 10:06:49 am
Hi,

I'm having a similar problem with my Arduino DUE and LCD screen.  I have the same screen as the one you posted.  Like you I hooked it up according to the UTFT example code but the only thing that works is the LED backlight.  If you know what you did to get it to work could you please post.

Thanks
11  Using Arduino / Project Guidance / Re: Hooking up Christmas lights to Arduino on: October 10, 2012, 12:22:12 pm
I ended up switching out all of the wires for new ones and it started working.  Must have been a bad wire in there somewhere.  Of course its something stupid like that.  Thanks everyone for all the information and help though.
12  Using Arduino / Project Guidance / Re: Hooking up Christmas lights to Arduino on: October 07, 2012, 09:48:24 pm
Sorry I haven't responded in awhile.  I've been busy with school work and other projects.  I tried hooking up the relay I have using this schematic http://www.plcs.net/relay5.gif.  The relay was clicking but again the lights didn't go on so I'm thinking it's the lights not being able to turn on and off quick enough.  I've never really used relays before so would using a solid state relay as suggested fix this problem?  Also would using the mechanical relay I already have with LED Christmas lights work as well?  Any help would be greatly appreciated.

Steve
13  Using Arduino / Project Guidance / Hooking up Christmas lights to Arduino on: September 26, 2012, 01:39:23 pm
I decided to try syncing some LEDs to music using an arduino and was able to make it work with no problems.  I am now trying to go a bit further and sync christmas lights to music.  I came across this instructables: http://www.instructables.com/id/Arduino-Christmas-Light-Controller/?ALLSTEPS.  Although the code for the blinking is my own I am using the circuit he has to power the lights.  When I hook up the circuit to the arduino, the relay clicks whenever the lights should be blinking but the lights don't go on at all.  Does anyone have any suggestions on how to fix this?
14  Using Arduino / Installation & Troubleshooting / Re: Arduino Not Recongnized by Computer on: September 11, 2012, 10:45:42 am
I got it working.  I'm not sure what was wrong but I ended up unplugging everything that was plugged in and tried the Arduino in every spot.  Eventually after reinstalling the drivers it worked in one of them.

Thanks everyone for the help.
15  Using Arduino / Installation & Troubleshooting / Re: Arduino Not Recongnized by Computer on: September 10, 2012, 10:28:07 pm
Yea it makes the sound that it recognizes something is plugged in, but when I go to the device manager it is listed as "Unknown Device" under the "USB controllers" tab.
Pages: [1] 2