Show Posts
Pages: 1 2 [3] 4 5 ... 11
31  Using Arduino / Sensors / lm34 on a breadboard, strange stuff on: June 03, 2013, 12:04:45 pm
i know alot of posts exist about taking 2 samples, ignoring the first and using the second, and which ground to use etc. im experimenting with just an atmega328p on a breadboard, powered by usb, and an lm34. its still reading 4-5 degrees higher than hooked up to an uno (the uno is reading correctly). lm34 is powered from avcc and gnd pin 22. i have .01uf across pins 20 and 22. i cant for the life of me figure this out. the breadboard has crystal and caps and pullup on rst, nothing else. the usb is an ftdi clone, but even with other power sources (another uno, batteries etc) using an lcd, its still reading consistently wrong. also, when i leave the lm34 on the breadboard and wire it to the uno, im getting correct values, and ive tried 2 different atmega328p's on the breadboard. if i wasnt already bald id be pulling alot of hair out. this is the only thing holding me up on completion of my weatherstation, i could use other sensors reading correctly, but im just so curious as to whats causing this.


edit. i got my dmm on the supply to the sensor (on the breadboard) its 4.94, after adjusting the sketch to relfect this, its right on the numbers. how/why am i losing this lil bit of voltage? any way around this other than what i did? i mean if it works its all good, but im not understanding why im not at 5 volts on the breadboard.
32  Using Arduino / Programming Questions / Re: Controler hang up then Error:avrdude: stk500_recv(): programmer is not respondin on: June 01, 2013, 10:50:04 am
i had the same issue with uno, i dont have a nano, but heres how i fixed. i changed the reset resistors back and forth from 10k to 1k, only changing them out when it stopped working, restart the software worked once or twice, finally had to re-burn bootloader, but that wouldnt work either until i bent the pins slightly out a lil bit. its black magic im tellin ya. i checked the registers prior to burning bootloader and there were alot of errors. after burn im running fine.
33  Using Arduino / Programming Questions / for loop assistance reading an eeprom please. [SOLVED] on: June 01, 2013, 10:40:11 am
since its taking 3 samples, i had to divide by 3, correct for call at the bottom. sorry for not thinking this morning. peace all.

im trying to read an eeprom thats sampling, from zero to the address pointer at its current place in the sampling routine, and then return to sampling where i left off. im confused a bit, any guidance appreciated thank you guys/gals. for loop below, complete code below that. thanks. (breadboard atmega328p w/ crystal, 1307, atmel 2 wire eeprom, lm34, rht03)

Code:
void eepromDump(){
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("dumping eeprom");
  display.display();
  unsigned int eepointer=0;
  for (int i=0;i<pointer;i++){
    Wire.beginTransmission(addr);
    Wire.write(eepointer>>8);
    Wire.write(eepointer & 0xFF);
    Wire.endTransmission();
    Wire.requestFrom(addr,3);
    time1=Wire.read();
    time2=Wire.read();
    temp=Wire.read();
    //    eepointer=eepointer+3;
    Serial.print(time1,DEC);
    Serial.print(":");
    Serial.print(time2,DEC);
    Serial.print(",");
    Serial.println(temp,DEC);
  }
  gettime();
}

complete sketch
Code:
/*breadboard setup*/
#include <avr/pgmspace.h>
#include <avr/sleep.h>
#include <avr/power.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include <Wire.h>
#include <RTClib.h>
#include "DHT.h"
#define addr 0x50
#define OLED_RESET 8
#define DHTPIN 7
#define DHTTYPE DHT22
//=====================================
unsigned int pointer=0;
long previousMillis = 0;        
long interval = 59500;  
float  a=0;
float b=0;
byte time1,time2,temp;
int dumpButton=6;
int dumpVal;
//=====================================
RTC_DS1307 RTC;
Adafruit_SSD1306 display(OLED_RESET);
DHT dht(DHTPIN, DHTTYPE);
//=====================================
void setup () {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  display.clearDisplay();
  Serial.begin(9600);
  Wire.begin();
  RTC.begin();
  dht.begin();
  pinMode(dumpButton,INPUT);
  pinMode(13,OUTPUT);
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.print("Mission in 1 minute");
  display.display();
}
//=======================================
void loop()
{
  dumpVal=digitalRead(dumpButton);
  if (pointer==0xF96){ //addr 3990
    endrun();
  }
  if (dumpVal==HIGH){
    eepromDump();
  }
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;  
    gettime();
  }
}
//=======================================
void gettime(){
  display.clearDisplay();
  a=analogRead(0);
  a=analogRead(0);
  b=(5.0*a*100.0)/1023.0;
  int c=b+0.5;
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.print(c);
  display.println(" TEMPERATURE");
  DateTime now = RTC.now();
  display.print(now.hour(), DEC);
  display.print(':');
  display.print(now.minute(), DEC);
  display.println(" TIME");
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  if (isnan(t) || isnan(h)) {
    display.print("Failed to read from DHT");
  }
  else {
    display.print(h);
    display.println(" HUMIDITY");
    display.print(t*1.8+32);
    display.print(" TEMP2");
    display.display();
  }

  Wire.beginTransmission(addr);
  Wire.write(pointer >> 8); // left-part of pointer address
  Wire.write(pointer & 0xFF); // and the right
  Wire.write(now.hour());
  Wire.write(now.minute());
  Wire.write(c%100);
  Wire.endTransmission();
  pointer=pointer+3;

  //  Serial.print(now.hour(), DEC);
  //  Serial.print(':');
  //  Serial.print(now.minute(), DEC);
  //  Serial.print(',');
  //  Serial.println(c%100);
  digitalWrite(13,HIGH);
  delay(500);
  digitalWrite(13,LOW);

}
//=========================================

void eepromDump(){
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("dumping eeprom");
  display.display();
  unsigned int eepointer=0;
//========================================================
  for (int i=0;i<pointer;i++){                           //<<pointer=eeprom current addr
    Wire.beginTransmission(addr);
    Wire.write(eepointer>>8);
    Wire.write(eepointer & 0xFF);
    Wire.endTransmission();
    Wire.requestFrom(addr,3);
    time1=Wire.read();
    time2=Wire.read();
    temp=Wire.read();
    eepointer=eepointer+3;
    Serial.print(time1,DEC);
    Serial.print(":");
    Serial.print(time2,DEC);
    Serial.print(",");
    Serial.println(temp,DEC);
  }
//===========================================================
  gettime();
}

//=========================================
void endrun(){
  display.clearDisplay();
  display.setCursor(0,0);
  display.println("ENDRUN");
  display.print("entering sleep mode...");
  display.display();
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);

  sleep_enable();

  sleep_mode();  

  //sleep_disable();
}

/*22 hours at 3 samples per minute*/




Code:
for (int i=0;i<pointer/3;i++){  
   //<<solved
34  Using Arduino / Interfacing w/ Software on the Computer / Re: Blueiris and Arduino, anyone got working? on: May 29, 2013, 02:51:55 pm
please do, let me know what you find. ill have to start messing with mine again. sweet im excited now. blueiris really rocks, i use with two cams, so far heh.
35  Using Arduino / Installation & Troubleshooting / Re: Want to hear some experiences with non-original Arduino's.... on: May 27, 2013, 09:15:46 pm
another option is to build your own uno (i cant speak for the mega i havent done that) very cheaply. but even then, for another $10-15 or so you can just buy a real uno. i purchase an uno from amazon for 17 dollars that was real. shop around, but i agree with g.mike, i wouldnt intentionally buy a knock off. good luck  smiley-grin
36  Using Arduino / Installation & Troubleshooting / stk500 disable protocol error expect 0x14 resp 0x50 FIX on: May 27, 2013, 09:07:25 pm
ive been uploading sketches to an atmega328p with optiboot bootloader using arduino ide to my breadboards, using an uno, and having loads of fun with it. i recently purchased a new, shiny breadboard from ebay. kept getting this message - stk500 disable protocol error expect 0x14 resp 0x50. was baffled, spent some time on it, and couldnt really find any answers/solutions to this problem, other than it was a reset issue. this worked for me im hoping it may help someone else, i changed 10k resistor on the reset pin to 1k.

uno      breadboard
pin 10 >> reset pin
11  >> 11
12 >> 12
13 >> 13
just in case someone new is trying this. uno gets usb cable, breadboard gets power jumped over from uno.


just an update, i moved/added stuff to the breadboard, and with the 328 in a different spot im back to 10k ohm on reset, back in the original spot its 1k. very weird lol. but it works like this so idk.
37  Using Arduino / Programming Questions / Re: jumpy analog values on: May 14, 2013, 04:35:36 pm
Try two readings each time you do an analogRead, and chuck the first one away.
ok thx im gnna try this now

this looks like its working the values are more consistent now. thank you guys.

38  Using Arduino / Programming Questions / Re: jumpy analog values on: May 14, 2013, 04:33:42 pm
Your using 0 and 2 in the combined code not 0 and 1!

Mark

yes i was trying it both ways right now the sensors are on 0, 2.
39  Using Arduino / Programming Questions / jumpy analog values [Solved]-thankyou on: May 14, 2013, 02:42:08 pm
hi all,
quick questions, running a sensor on analog0, and a coin cell on analog1, and then on analog2. both sharing the same ground, when run by themselves i get correct values. when i run them in the same sketch i get jumpy and incorrect values? any ideas? serial monitor pics enclosed.

Code:
float battery;
float temperature;
float b;
float a;
void setup(){
  Serial.begin(115200);
}
void loop(){
  b=0;
  a=0;
  battery=0;
  temperature=0;

  battery=analogRead(0);
  b=battery/1023*5.0;
  Serial.println(b);
  delay(100);
  get();
}
void get(){
  temperature=analogRead(2);
  a=(5.0*temperature*100.0)/1023.0;
  Serial.println(a);
  delay(1000);
}
40  Using Arduino / Sensors / Re: DHT11 Temperature and Humidity pull up resistor? on: May 10, 2013, 07:28:11 am
i have the dht-22, which calls for a 1k, and i was under the impression that the pullup is needed because these devices (11 and 22) utilize a one wire bus, not compatible with dallas onewire. also, datasheet says if mounted near any heat producing components will effect temperature output.
41  Using Arduino / Sensors / how to convert tinyrtc from ds18b20 to lm34/35 on: May 10, 2013, 07:04:05 am
I2C RTC AT24C32 DS1307 Real Time Clock Module http://www.ebay.com/itm/121014967852?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

Downloads http://www.icstation.com/ebay/IC/All%20data%20modules/1456.zip

this device does not come with the ds18b20 (some may but not this particular one) so theres an empty spot for a to-92. i dont have a ds18b20 but did have an LM-34 lying around. This will work with any to-92 where the center leg is Vout, you just might have to flip it around to marry up vcc and ground.

R1 is a 3.3k pullup resistor for the onewire bus, remove it, install your new sensor.

on P1 sq is 1307 sqare wave, ds is your temperature sensor, and bat pin goes to analog input to monitor rtc battery. P2 is just to chain other devices if you want to.

42  Using Arduino / Project Guidance / Re: Any Advice for Touch sensitive bowl on: May 09, 2013, 11:19:19 am
ive used this to build similar things http://media.digikey.com/pdf/Data%20Sheets/Quantum%20PDFs/QT110(H).pdf. its pretty easy to use, you build your own probes, works good once its all hooked up. i soldered a wire onto a penny as a probe.
43  Using Arduino / Programming Questions / Re: spi 9bit eeprom address can only see addr 0x00? on: May 09, 2013, 11:13:13 am
leads are about 3 inches, tried everything you said, its only writing the first value (using a for loop to write a few different values) and reading that value back no matter how many address' i cycle through. i really appreciate you guys trying to decipher this but maybe ill order some i2c 256kbit eeproms and just nix the cpu supervisor all together, too bad PaulS or Nick Gammon wont comment i bet you they can figure it out in about 10 seconds  smiley-wink

you know if it wasnt for Nick Gammon's website alot of my projects wouldnt be, he answers just about everything ive ever wondered how to do with my arduino. thanks Nick for sharing the knowledge. today im dumping a bootloader on a blank atmega328p using Mr. Gammon's method/sketch. http://www.gammon.com.au/forum/?id=11635
44  Using Arduino / Programming Questions / Re: spi 9bit eeprom address can only see addr 0x00? on: May 08, 2013, 08:52:05 am
x5045                   Arduino Uno
pin 1                    pin10 cs/ss
pin2                     pin12
pin3                     5v
pin4                     gnd
pin5                     pin11
pin6                     pin13 sclk
pin7                     no connection
pin8                     5v
45  Using Arduino / Programming Questions / Re: spi 9bit eeprom address can only see addr 0x00? on: May 08, 2013, 07:43:44 am
Quote
Where is this comment coming from then?
sorry that comment left over from spi tutorial i just copy/paste it for my spi chips.

same results
Pages: 1 2 [3] 4 5 ... 11