Loading...
  Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 18
61  Using Arduino / General Electronics / Re: measure battery voltage on: March 08, 2011, 01:11:51 am
Do you have a link to that DC/DC converter? I'm wondering if it could be an isolated converter (no ground continuity from input to outout) ?  If not, can you use a ohm better and see if the negitive in and out pins show continuity?

 The first way you showed it wired up should work if it's not a isolated converter. Not sure about it being a noise issue or not, only a scope would verify that or not.


Lefty


The converter is this one.
http://www.bodhilabs.com/vpackbareaaa.html

Do you know a better one?
62  Using Arduino / General Electronics / Re: measure battery voltage on: March 07, 2011, 04:23:41 pm


R1=56k
R2=15k

Battery is 4.1V
Arduino gives me back: 1.94V this would mean =7.24V?????

(If I calculated right the Arduino should read 0.866V or am I wrong?)
63  Using Arduino / General Electronics / Re: measure battery voltage on: March 07, 2011, 04:13:14 pm
Hope this helps...
64  Using Arduino / General Electronics / measure battery voltage on: March 07, 2011, 04:04:16 pm
Hy

At the moment I'm running an Arduino with an 1S LiPo (3.7V) with an
5v Step-Up regulator. Now I like to monitor also the lipo voltage with
an Analoge input. But when I do connected the battery to an Analog
Input it always reads ~5V.

How can I get the real value of around 4V?

I know this question has alredy been asked in the old forum but the solution didn't worked...

Thx
Andy
65  Using Arduino / Programming Questions / Re: String to int on: March 06, 2011, 04:37:58 pm
The largest number an int can hold is 32767, if that answers your question. Trying to go larger turns on the sign bit and it becomes negative.

How could I forget that of course that was the mistake!
Thx a lot!

Andy
66  Using Arduino / Programming Questions / String to int on: March 05, 2011, 06:31:49 pm
Hy

I got a problem with the atoi() command. Sometimes it does work and sometimes not...
example
I do process 360 values which i get through the serial.
The first column isn't a problem but as you can see in the second sometimes a "-" sign appears and
the value is completely wrong. Why does this happen?

Code:
217,31515
218,31721
219,31940
220,32172
221,32417
222,32676
223,-32587
224,-32299
225,-31995
226,-31676
227,-31340
228,-30920
229,-31935
230,32653
231,31767
232,30937
233,30158
234,29425
235,28737

Thx Andy
67  Using Arduino / LEDs and Multiplexing / Re: TLC5940 Woes on: February 10, 2011, 04:55:57 am
I got a similar problem with my project. I use a cable length of about 1m but when I do this
the TLC5940 draws 1.2A from my 2A power supply what for me looks like a short cut. But when
the cable is shorter ~20cm all works fine.
What can I do to prevent this "short"? Do I have to put caps in between?

PS: Sometimes it even draws 300mA without an LED connected (I did even change the Chip same result)

Thx
Andy
68  Forum 2005-2010 (read only) / Troubleshooting / Re: SoftwareSerial problem.. on: August 21, 2008, 10:20:55 am
So I got this little prog with the Software Serial but it doesn't show
anything!
Code:
#include <string.h>
 #include <ctype.h>
 #include <AFSoftSerial.h>

AFSoftSerial mySerial =  AFSoftSerial(3, 2);

 int ledPin = 13;                  // LED test pin
 int byteGPS=-1;
 char linea[70] = "";
 char comandoGPR[7] = "$GPGGA";
 char latdms[9], londms[10], latdir[1], londir[1] = "";
 int latdd, londd, heading = 0;
 int cont=0;
 int bien=0;
 int conta=0;
 int indices[13];
  
 void setup() {
   pinMode(ledPin, OUTPUT);       // Initialize LED pin
   pinMode(rxPin, INPUT);
   pinMode(txPin, OUTPUT);
   Serial.begin(4800);
   for (int i=0;i<70;i++){       // Initialize a buffer for received data
     linea[i]=' ';
   }  
   mySerial.begin(4800);
  }
 void loop() {
   digitalWrite(ledPin, HIGH);
   byteGPS=mySerial.read();        
   if (byteGPS == -1) {           // See if the port is empty yet
     delay(100);
   } else {
     linea[conta]=byteGPS;        // If there is serial port data, it is put in the buffer
     conta++;                      
     if (byteGPS==13){            // If the received byte is = to 13, end of transmission
       digitalWrite(ledPin, LOW);
       cont=0;
       bien=0;
       for (int i=1;i<7;i++){     // Verifies if the received command starts with $GPR
         if (linea[i]==comandoGPR[i-1]){
           bien++;
         }
       }
       if(bien==6){               // If yes, continue and process the data
         for (int i=0;i<70;i++){
           if (linea[i]==','){    // check for the position of the  "," separator
             indices[cont]=i;
             cont++;
           }
           if (linea[i]=='*'){    // ... and the "*"
             indices[12]=i;
             cont++;
           }
         }
           Serial.print(linea);  // This is the important line :)
       }
       conta=0;                    // Reset the buffer
       for (int i=0;i<70;i++){    //  
         linea[i]=' ';  
       }                
     }
   }
 }

Geko
69  Forum 2005-2010 (read only) / Troubleshooting / Re: SoftwareSerial problem.. on: August 21, 2008, 06:42:41 am
ok yes that's true it doesn't make sense.
My goal is to use the Software.Serial with a GPS. But
until now I haven't made any success so I tried this
very easy program to get the Serial working....

Geko
70  Forum 2005-2010 (read only) / Troubleshooting / Re: SoftwareSerial problem.. on: August 21, 2008, 01:23:59 am
Yes of course but the Idea is to send a thing trough the mySerial receive
it by mySerial and print it to the Computer Port (Serial.print) to show the message.

Is this not possible?

Geko
71  Forum 2005-2010 (read only) / Troubleshooting / SoftwareSerial problem.. on: August 20, 2008, 02:05:54 pm
Hello

Today I treid running the SoftwareSerial thing with this sketch:
Code:
#include <AFSoftSerial.h>

AFSoftSerial mySerial =  AFSoftSerial(3, 2);

void setup()  {
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  Serial.println("Goodnight moon!");
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}

void loop()                     // run over and over again
{
  if (mySerial.available()) {
      Serial.print((char)mySerial.read());
  }
  if (Serial.available()) {
      mySerial.print((char)Serial.read());
  }
}

but I just got the Message "Goodnight moon!"...
I also should get the "Hello, world?" or am I wrong?

Thx
Geko
72  Forum 2005-2010 (read only) / Syntax & Programs / Re: Serial.print on: June 15, 2010, 03:22:48 pm
the value has always 5 places of decimals it won't change.
so there is no way?
73  Forum 2005-2010 (read only) / Syntax & Programs / Re: Serial.print on: June 15, 2010, 03:17:42 pm
hmm thx but it doens't relay work...

I tested it with:

for (int i=1;i<9;i++){
    Serial.println(lat, i);
  }

Result:


231.0
231.02
231.023
231.0231
231.02311
231.023117
231.0231170
231.02311706

Not one of this is the right one...
74  Forum 2005-2010 (read only) / Syntax & Programs / Serial.print on: June 15, 2010, 03:01:38 pm
Hy

I think someone has already asked this but I couldn't find the post..

So I got a sketch running in wich I have to print a Float value over the Serial port.

for example
float test = 231,02312

Serial.print((long)((float)test ));

I do get 231 that's good but how do I get the rest? The '0' is my problem it won't store in an Int value of course. so how can I print it?

thx
Andy

75  Forum 2005-2010 (read only) / Syntax & Programs / Arduino Atmeag8 Sleep on: January 01, 2010, 06:18:47 pm
Hy

I got a code from here for setting an atmega168 to sleep for given seconds and the wake it up for sending some data.
http://www.sensor-networks.org/index.php?page=0820520514

Now I would like to use this code on an Atmega8 but I do have to change some part could someone help me?

Thx
Geko
Pages: 1 ... 3 4 [5] 6 7 ... 18