Show Posts
Pages: [1] 2 3 ... 11
1  Using Arduino / Programming Questions / Re: [solved] debugging atmega328 w/ pl2303 (ebay usb $1.50 adapter) on: July 23, 2013, 01:07:45 pm
yup that was it, works fine with 5volts. ok so this means the sd card moves to the actual weatherstation unit, and not the receiver. oh well, live and learn. thank you John! (and crossroads lol.)
2  Using Arduino / Programming Questions / Re: debugging atmega328 w/ pl2303 (ebay usb $1.50 adapter) on: July 23, 2013, 12:50:41 pm
i found this from crossroads
quote:
So which is it? USB to TTL (0 to 5V signals), or USB to RS232 (+/- 10V signals)?
Sounds like it has a 3.3V output as well.
http://prolificusa.com/files/ds_pl2303HXD_v1.4.3.pdf
See page 18 for a typical usage of the chip with a RS232 transceiver chip.

If TTL, you can connect the Rx & Tx to the appropriate pins on your Arduino; Tx and Rx.

If its RS232, then you need an RS232 adapter to bring the levels from +/-10V down to 0-5V levels.

Does your PC have PL2303 USB drivers installed?
end quote:

this may be my problem hmm? im using 3.3v, let me set it up at 5 v and see what happens.
3  Using Arduino / Programming Questions / Re: debugging atmega328 w/ pl2303 (ebay usb $1.50 adapter) on: July 23, 2013, 12:23:09 pm
no, ive used 2 different atmegas to make sure one wasnt damaged. the power light is on - on the adapter. also, i have 2 of these adapters im trying, just in case one is damaged. i usually order stuff in twos. to me this should be a simple thing lol, very confused. the breadboard setup is minimal, atmega, xtal, xtal caps, thats it. (the entire circuit is a receiver for weatherstation. but since it didnt work from get go, im working with stripped breadboard. also, on an uno without sdcard this works fine. im building it on a breadboard to stay with the 3.3v because i want to add the sdcard, but i cant even get it to spit out "hello world" to the pc lol.
Code:
// receive w/ sd card support. add clock?

#include <SD.h>
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"

const int chipSelect = 8; //sd card
const uint64_t pipe = 0xE8E8F0F0E1LL; //pipe

typedef struct{
  float T; //temperature
  float RH;
  float HI;
  float DP;
  float pressure;
}
payload;
payload ard1;
RF24 radio(9,10);



void setup()
{

  ADCSRA &= ~(1<<ADEN); //Disable ADC
  ACSR = (1<<ACD); //Disable the analog comparator
  DIDR0 = 0x3F; //Disable digital input buffers on all ADC0-ADC5 pins
  DIDR1 = (1<<AIN1D)|(1<<AIN0D); //Disable digital input buffer on AIN1/0

  //  power_adc_disable();

  Serial.begin(57600);

  pinMode(7, OUTPUT); //write error
  pinMode(8, OUTPUT); //cs sd card

  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    digitalWrite(7,HIGH); //error
    // don't do anything more:
    return;
  }
  Serial.println("card initialized.");
  File dataFile = SD.open("datalog.csv", FILE_WRITE);

  if (dataFile) { //file header

    dataFile.println("Decimal Minutes (GPS): N32 31.581409999999998 W86 23.3472 Date: ");
    dataFile.print("Temperature");
    dataFile.print(",");
    dataFile.print("Pressure");
    dataFile.print(",");
    dataFile.print("Humidity");
    dataFile.print(",");
    dataFile.print("Dew Point");
    dataFile.print(",");
    dataFile.println("Heat Index");
    dataFile.close();
  }
  radio.begin();
  radio.openReadingPipe(1,pipe);
  radio.startListening();
}

void loop()
{

  if ( radio.available() )
  {
    // Dump the payloads until we've gotten everything
    boolean done = false;
    while (!done)
    {
      // Fetch the payload, and see if this was the last one.
      done = radio.read( &ard1, sizeof(ard1) );
      Serial.print(ard1.T);
      Serial.println(" oF");
      Serial.print(ard1.pressure);
      Serial.println(" in/Hg");
      Serial.print(ard1.RH);
      Serial.println(" % Hum");
      Serial.print(ard1.DP);
      Serial.println(" Dew Point");
      Serial.print(ard1.HI);
      Serial.println(" Feels like");
    }
  }

  File dataFile = SD.open("datalog.csv", FILE_WRITE);


  if (dataFile) {
    dataFile.print(ard1.T);
    dataFile.print(",");
    dataFile.print(ard1.pressure);
    dataFile.print(",");
    dataFile.print(ard1.RH);
    dataFile.print(",");
    dataFile.print(ard1.DP);
    dataFile.print(",");
    dataFile.println(ard1.HI);



    dataFile.close();
  }
}


4  Using Arduino / Programming Questions / [solved] debugging atmega328 w/ pl2303 (ebay usb $1.50 adapter) on: July 23, 2013, 11:26:45 am
morning all. apologies if this is in the wrong section, couldnt decide where to put it. this is not a 'how do i upload a sketch with this cheap adapter' question. i simply want to debug a breadboard atmega328p (3.3v 8Mhz). few months ago i was playing with an attiny85 and this adapter, and i got it talking fine, i cant get squat out with my current setup. any code (using examples) simple Serial.print("hello"); etc etc. im using the 3.3v output on the adapter, ground on the adapter, and rx line via 1k resistor to the tx line on the atmega. any advice appreciated. thank you.

http://www.ebay.com/itm/1pc-PL2303-USB-To-RS232-TTL-Converter-Adapter-Module-F-Arduino-CAR-Detection-GPS-/271234585265?pt=LH_DefaultDomain_0&hash=item3f26d752b1
5  Using Arduino / General Electronics / Re: rtc crystal accuracy on: July 07, 2013, 01:16:41 pm
i have been eyeing the ds3234. but at least i have a better understanding of what seems to be with my projects, and important part. i thank you all for replies and tutelage. i will reset my ds1305 and consider these options. some projects exact time isnt an issue with me, but some are shaping up to be. as usual you guys rock, but my wife doesnt like lefty and mark too much, i told her you guys said i gotta hit up sparkfun for a new clock!! smiley-eek-blue
6  Using Arduino / General Electronics / rtc crystal accuracy on: July 06, 2013, 11:11:24 pm
concerning rtc's, and the crystals. is it correct to say (im trying to understand) that clocks lose time because of the crystal accuracy? and if so, is the crystal accuracy affected by temperature? if this is a true statement, then if my clock crystal was kept at a constant temperature in theory, my clock should keep time pretty well, right? are all rtc's created equal? perhaps accuracy is not the correct word for this maybe tolerance? im not sure. are some crystals (manufacturers) better than others? my ds1305 has lost quite a bit of time over the last 2 months, but it resides in a room that has 15 degree minimum temperature swings daily. is the 1305 just a piece of cr@p? or is it the crystal. any help in understanding this from an rtc person greatly appreciated. thank you.
7  Using Arduino / Sensors / Re: Too much variations in temperature? on: July 06, 2013, 09:34:11 pm
take 2 readings, discard the first one

Code:
float trash=analogRead(0);
float realone=analogRead(0);
Serial.print(realone);

there is also something in the datasheet for the atmega328p on getting better precision from the adc. and... 10.4 Adc noise reduction mode, page 39.
8  Using Arduino / Project Guidance / Re: Large Quantity Manufacturing and Serial Numbers on: July 06, 2013, 09:05:05 pm
I have not used one of these but it may be your solution.

http://www.maximintegrated.com/datasheet/index.mvp/id/2903


Applications/Uses

    Equipment Registration
    Network-Node Identification
    PCB Identification
    Reference Design License Management



beat me to it. we used these in something similar you speak of for your product. LarryD is right its a good solution, plus easy solution, we came up with too. here is something im working on at home for box inventory, mostly just me fooling around and this isnt finished but you get the idea. works great so far.

Code:
#include <OneWire.h>
#include <avr/pgmspace.h>
//#undef PROGMEM
//#define PROGMEM __attribute__((section(".progmem.data")))
OneWire  ds(7);
byte addr[8];
byte i;
byte boxnumber;
byte xIndex = 0;
byte yIndex = 0;
char buffer[30];

prog_char box1_0[] PROGMEM = "Box 1";  
prog_char box1_1[] PROGMEM = "Items: stuff";
prog_char box1_2[] PROGMEM = "Location: Den";
prog_char box1_3[] PROGMEM = "String 3";
prog_char box1_4[] PROGMEM = "String 4";
prog_char box1_5[] PROGMEM = "String 5";
prog_char box1_6[] PROGMEM = "String";
prog_char box1_7[] PROGMEM = "String";
prog_char box1_8[] PROGMEM = "String 3";
prog_char box1_9[] PROGMEM = "String 4";
prog_char box1_10[] PROGMEM = "String 5";



PROGMEM const char *box1_table[] =  
{  
  box1_0,
  box1_1,
  box1_2,
  box1_3,
  box1_4,
  box1_5,
  box1_6,
  box1_7,
  box1_8,
  box1_9,
  box1_10 };

prog_char box2_0[] PROGMEM = "Box 2";  
prog_char box2_1[] PROGMEM = "Items: IC Chips";
prog_char box2_2[] PROGMEM = "Location: ";
prog_char box2_3[] PROGMEM = "DS1305 2EA";
prog_char box2_4[] PROGMEM = "DS1302 3EA";
prog_char box2_5[] PROGMEM = "ISD100P";
prog_char box2_6[] PROGMEM = "ADC0831 3EA";
prog_char box2_7[] PROGMEM = "AD8400 3EA ";
prog_char box2_8[] PROGMEM = "X9511WP";
prog_char box2_9[] PROGMEM = "DS1620 2EA";
prog_char box2_10[] PROGMEM = "TLC071";
prog_char box2_11[] PROGMEM = "LS7210";  
prog_char box2_12[] PROGMEM = "PCF8574";
prog_char box2_13[] PROGMEM = "X24165P 2EA";
prog_char box2_14[] PROGMEM = "U2403B";
prog_char box2_15[] PROGMEM = "DS1669";
prog_char box2_16[] PROGMEM = "QT110";
prog_char box2_17[] PROGMEM = "AT25128";
prog_char box2_18[] PROGMEM = "MAX7219";
prog_char box2_19[] PROGMEM = "MAX7221";
prog_char box2_20[] PROGMEM = "24LC256";
prog_char box2_21[] PROGMEM = "MAX619 2EA";
prog_char box2_22[] PROGMEM = "DS1615";  
prog_char box2_23[] PROGMEM = "74HCT125N";
prog_char box2_24[] PROGMEM = "74FO4N";
prog_char box2_25[] PROGMEM = "ATTINY85";
prog_char box2_26[] PROGMEM = "BQ2000 2EA";
prog_char box2_27[] PROGMEM = "DS275 2EA";
prog_char box2_28[] PROGMEM = "DS1232";
prog_char box2_29[] PROGMEM = "  ";
prog_char box2_30[] PROGMEM = "String 3";
prog_char box2_31[] PROGMEM = "String 4";
prog_char box2_32[] PROGMEM = "String 5";
// Then set up a table to refer to your strings.

PROGMEM const char *box2_table[] =  
{  
  box2_0,
  box2_1,
  box2_2,
  box2_3,
  box2_4,
  box2_5,
  box2_6,
  box2_7,
  box2_8,
  box2_9,
  box2_10,
  box2_11,
  box2_12,
  box2_13,
  box2_14,
  box2_15,
  box2_16,
  box2_17,
  box2_18,
  box2_19,
  box2_20,
  box2_21,
  box2_22,
  box2_23,
  box2_24,
  box2_25,
  box2_26,
  box2_27,
  box2_28,
  box2_29,
  box2_30,
  box2_31,
  box2_32};
  
prog_char box3_0[] PROGMEM = "Box 3";  
prog_char box3_1[] PROGMEM = "Items: stuff";
prog_char box3_2[] PROGMEM = "Location: Den";
prog_char box3_3[] PROGMEM = "String 3";
prog_char box3_4[] PROGMEM = "String 4";
prog_char box3_5[] PROGMEM = "String 5";
prog_char box3_6[] PROGMEM = "String";
prog_char box3_7[] PROGMEM = "String";
prog_char box3_8[] PROGMEM = "String 3";
prog_char box3_9[] PROGMEM = "String 4";
prog_char box3_10[] PROGMEM = "String 5";

// Then set up a table to refer to your strings.

PROGMEM const char *box3_table[] =  
{  
  box3_0,
  box3_1,
  box3_2,
  box3_3,
  box3_4,
  box3_5,
  box3_6,
  box3_7,
  box3_8,
  box3_9,
  box3_10 };

prog_char box4_0[] PROGMEM = "Box 4";  
prog_char box4_1[] PROGMEM = "Items: stuff";
prog_char box4_2[] PROGMEM = "Location: Den";
prog_char box4_3[] PROGMEM = "String 3";
prog_char box4_4[] PROGMEM = "String 4";
prog_char box4_5[] PROGMEM = "String 5";
prog_char box4_6[] PROGMEM = "String";
prog_char box4_7[] PROGMEM = "String";
prog_char box4_8[] PROGMEM = "String 3";
prog_char box4_9[] PROGMEM = "String 4";
prog_char box4_10[] PROGMEM = "String 5";

// Then set up a table to refer to your strings.

PROGMEM const char *box4_table[] =  
{  
  box4_0,
  box4_1,
  box4_2,
  box4_3,
  box4_4,
  box4_5,
  box4_6,
  box4_7,
  box4_8,
  box4_9,
  box4_10 };


void setup(){
  Serial.begin(9600);
}
void loop()
{
  if ( !ds.search(addr)) {

    //    Serial.println( "No more addresses" );
    //    Serial.println();
    ds.reset_search();
    delay(500);
    return;
  }
  Serial.print("ROM =");
  for( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);

  }
  Serial.println();
  if (OneWire::crc8(addr, 7) != addr[7]) {
    Serial.println("CRC is not valid!");
    return;
  }
  if (addr[0]==0x01 && addr[1]==0xD5 && addr[2]==0x04)
    boxnumber=1;
  else if (addr[0]==0x01 && addr[1]==0x34 && addr[2]==0xDF)
    boxnumber=2;
  else if (addr[0]==0x01 && addr[1]==0x34)
    boxnumber=3;
  else if (addr[0]==0x01 && addr[1]==0x34)
    boxnumber=4;
  else boxnumber=0;
  switch (boxnumber) {
  case 0:

    Serial.println( "No Box for this address." );


    delay(5000);
    break;
  case 1:
    for (int i = 0; i < 11; i++)
    {
      strcpy_P(buffer, (char*)pgm_read_word(&(box1_table[i])));
      Serial.println( buffer );

    }
    delay(5000);
    break;
  case 2:
    for (int i = 0; i < 29; i++)
    {
      strcpy_P(buffer, (char*)pgm_read_word(&(box2_table[i])));
      Serial.println( buffer );

    }
    delay(5000);
    break;
  case 3:
    for (int i = 0; i < 11; i++)
    {
      strcpy_P(buffer, (char*)pgm_read_word(&(box3_table[i])));
      Serial.println( buffer );

    }
    delay(5000);
    break;
  case 4:
    for (int i = 0; i < 11; i++)
    {
      strcpy_P(buffer, (char*)pgm_read_word(&(box4_table[i])));
      Serial.println( buffer );

    }
    delay(5000);
    break;
  }


}
9  Using Arduino / Interfacing w/ Software on the Computer / Re: WEB CAM ZONE TRIGGER on: July 06, 2013, 08:51:37 pm
noone is gonna answer your post trust me from experience. why the 2 extra spaces in web address,  after you read the how to post in this forum thread, you could have just did this...

http://downloadfull89.blogspot.com/2013/04/free-download-webcam-zone-trigger-pro.html
10  Using Arduino / Interfacing w/ Software on the Computer / simple windows <vb> app to read anything <and send> comport on: July 04, 2013, 10:25:47 pm
i did not write this whole code, but added some stuff to it. it was written as an example to read comports. its real simple and can be an elegant way of displaying what your arduino is saying to your pc. just thought id pass it along. source code. compiled app resides in serialportinterface/bin/debug. change it anyway you want. the license button just has an okbox with text saying change it.
11  Using Arduino / Programming Questions / Re: windchill formula uses exponents, how do we do that? on: July 01, 2013, 10:07:50 pm
Ans as V^0.16 is used twice one could store it in a variable so it can be reused iso recalculated.

this prints a lookup table for diff values of T and V
Code:
void setup()
{
  Serial.begin(115200);

  for (int T = 0; T < 100; T++)
  {
    for (int V = 0; V < 15; V++)
    {
      float tt = pow(V, 0.16);
      float Windchill  = 35.74 + 0.6215*T - 35.75*tt + 0.4275*T*tt;
      Serial.print(Windchill);
      Serial.print("\t");
    }
    Serial.println();
  }
}

void loop()
{
}


very nice Rob, im gonna have to start paying you lol thats twice you rescued me from math  smiley-grin. this is sweet and this is the format im gonna use. thank you.
12  Using Arduino / Programming Questions / Re: windchill formula uses exponents, how do we do that? on: July 01, 2013, 01:18:15 pm
the windchill formula uses exponents

Code:
Windchill  = 35.74 + 0.6215*T - 35.75(V^0.16) + 0.4275*T(V^0.16);

where T is temperature
V is wind speed
^0.16 is an exponent.
this is the layout from the nws site but ofcourse the ^0.16 is giving errors on compile, can someone help me please?

As 35.74 and 35.75 are very nearly equal, this formula could be rewritten as
Windchill  = 35.74(1 - (V^0.16)) + T((0.4275(V^0.16)) + 0.6215) with very little error.


much appreciated henry, thank you kindly. i will certainly experiment with this info  smiley-lol
13  Using Arduino / Programming Questions / Re: windchill formula uses exponents, how do we do that? on: June 30, 2013, 03:40:46 pm
most awesome of you. thank you  very much JarkkoL.  

for reference, works fine tested with nws windchill calculator
the 2 float values temperature and windspeed are just test numbers, i dont have an anemometer? yet.

Code:
void setup(){
Serial.begin(9600);
float T=49;
float V=10;

float Windchill  = 35.74 + 0.6215*T - 35.75*pow(V,0.16) + 0.4275*T*pow(V,0.16);
Serial.print(Windchill);

}

void loop(){}
14  Using Arduino / Programming Questions / windchill formula uses exponents, how do we do that? on: June 30, 2013, 03:18:55 pm
the windchill formula uses exponents

Code:
Windchill  = 35.74 + 0.6215*T - 35.75(V^0.16) + 0.4275*T(V^0.16);

where T is temperature
V is wind speed
^0.16 is an exponent.
this is the layout from the nws site but ofcourse the ^0.16 is giving errors on compile, can someone help me please?
15  Community / Exhibition / Gallery / Re: weatherstation v1.0 on: June 30, 2013, 12:05:47 pm
heat index function.

seems to be working

NOTE. variable is labeled celcius. i made a mistake for this example, it should be farenheit .

Code:
double HI;
float celcius=75.14; //test value
float humidity=49.23; //test value
void setup(){
  Serial.begin(9600);
}

void loop(){
HI=heatIndex(celcius, humidity);
Serial.println(HI);
delay(2000);
}

 
 //heat index function
  //reference http://www.hpc.ncep.noaa.gov/html/heatindex_equation.shtml
 double heatIndex(double celcius, double humidity)
{
  double result;
 result= -42.379 + 2.04901523*celcius + 10.14333127*humidity - .22475541*celcius*humidity -
 .00683783*celcius*celcius - .05481717*humidity*humidity + .00122874*celcius*celcius*humidity + .00085282*celcius*humidity*humidity -
 .00000199*celcius*celcius*humidity*humidity;
return result;
}
Pages: [1] 2 3 ... 11