Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: Finding a Sensor for Measuring Weight/Mass on: January 26, 2013, 10:33:17 pm
The other components of the project will be a geared-down DC motor to rotate a dispensing tube, and there will be an automatic dump when the correct weight is achieved.

Go to a gun store and buy a powder trickler.
2  General Category / General Discussion / Re: Oh What to Do... on: January 23, 2013, 11:10:04 pm
If you want to mess with people, you could make each switch do something unique, but when one switch is on it could do random things.
3  Using Arduino / Project Guidance / Re: Help with application on: January 22, 2013, 04:07:03 pm
When it senses +5v the program needs to begin monitoring and look for a series of events.....

More than 4 hours of constant water flow
Any Water flow after normal hours (ability to set the hours)


What do you want the program to do when it detects those events?
4  Using Arduino / General Electronics / Re: Datasheet site on: January 22, 2013, 10:26:09 am
I found this datasheet site the other day; well worth bookmarking.

Thanks Jimbo!
5  Using Arduino / Sensors / Re: HR202 Humidity Sensor on: January 20, 2013, 11:50:09 am
Alternatively, you could generate a function from the values in the table.   Spreadsheets graphs and trend lines are helpful for that.

I plotted the 25C results against the log of the resistance and found that a 4th order polynomial function fits the data quite well, with an R^2 value of 1.    Personally, I'd probably go with the function approach, since I find it more aesthetically pleasing. 
6  Using Arduino / Sensors / Re: HR202 Humidity Sensor on: January 20, 2013, 10:52:15 am
Hello,

I got a HR202 humidity sensor and I have no idea how to convert the analog result to HR%. I haven't found any exemple code at internet.

If someone have a example, please send to me. I apreciate.

the datasheet is here: ftp://imall.iteadstudio.com/Sensor/IM120712018/DS_IM120712018.pdf

The datasheet you provided contains a chart which converts resistance of the sensor to humidity at a given temperature.  You could put that table an array, and then look up and interpolate values based on the value from the temperature sensor which it appears you are missing.
Alternatively, you could generate a function from the values in the table.   Spreadsheets graphs and trend lines are helpful for that.
7  General Category / General Discussion / Re: Oscilloscope Needed? on: January 19, 2013, 04:53:50 pm
On the topic of oscilloscopes for beginners, what do folks think about this type of item?
http://www.seeedstudio.com/depot/dso-quad-4-channel-digital-storage-oscilloscope-p-736.html
8  Using Arduino / Project Guidance / Re: Arduino Mega 2560 R3 vs. Uno R3 for beginners {Raspberry Pi} on: January 05, 2013, 03:42:00 pm
Quote
I can only suspect the china sourced mega is causing problems.

Hardware usually works reliably the way it is wired. On the other hand, 99% of issues like yours are likely to bad code.

Good point, but code runs rock solid on my Uno.  Further my Uno never hangs when I upload code to it, and I've uploaded code to the Uno many more times than to the Mega.  Like I said the Mega hangs frequently when uploading code.  Additionally, code written by others hangs on the Mega as well. 
9  Using Arduino / Project Guidance / Re: Arduino Mega 2560 R3 vs. Uno R3 for beginners {Raspberry Pi} on: January 05, 2013, 02:07:46 pm
Regarding the Italian vs. Chinese made boards, here's my 2 cents. 

I currently have two boards, a Uno bought from a reputable supplier and a mega bought off ebay and shipped from China.  Both say "Made in Italy".

 The reputable source Uno is rock solid, and has clean graphcs.  The china sourced Mega was dirty on arrival, and the graphics were "fuzzy" like a photocopy of an original, which I suspect is close to what it is.  Further, the Mega hangs about 10% of the time I send a program to it.  After a couple days running a program, the Chinese sourced LCD connected to the mega is corrupt, showing characters  not in the program.

All that said, I can't say anything definitive about the mega just voice suspicions.  I have no experience with any other mega, so I don't know personally if they are less stable than the Unos.  Further, I don't know that the Chinese sourced I2C display is causing the corruption issue. 

I can only suspect the china sourced mega is causing problems.  If all you want to do is tinker, stability is likely not an issue.  However, if you want your project to run stable for weeks, then reducing suspicion might be worth a few bucks.  After reading this thread, I think I'll stick with reliable sources, to support them and eliminate unknowns.  It's worth the few bucks. 
10  Using Arduino / Project Guidance / Re: How long can Arduino Uno work without switching it off? on: January 05, 2013, 11:48:40 am
If you use the millis() or micros() functions you will need to consider that they rollover and start again at 0 periodically.  The millis() function is good for about 50 days before a rollover, the micros() function about 70 minutes. 
11  Using Arduino / Project Guidance / Re: Need a Programmer - LED Clock on: January 05, 2013, 11:42:16 am
Ben, I may be able to help you, let me know if you still need help.
12  Using Arduino / Project Guidance / Re: clock (second and minutes) on: January 04, 2013, 02:45:01 pm
Does this help?

/*
** Arduino sketch to display date, time temperature and humidity.
** Uses LCD2004 display, Tiny RTC and DHT11 temperature and humidity sensor.
** All parts are readily found on eBay
**
** NOTES:
**    I2C pins are A4 SDA, A5 SCL on UNO, 20 SDA and 21 SCL on MEGA 2560.
**    DHT11 data connects to Pin 12. 
**    Displays time in 12 hour format.
**    Only reads DHT11 sensor every x seconds for smooth time updating
**     
**
**
** Written by Kuhntucker
** LICENSE: GNU General Public License, version 3 (GPL-3.0)
*/
unsigned long readint=15; //Read DHT11 every readint seconds.
unsigned long lasttemptime; //Used to restrict reading DHT11 to every readint seconds.
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <RTClib.h>
#include "DHT.h"

#define I2C_ADDR    0x3F  // Define I2C Address where the SainSmart LCD is
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7
LiquidCrystal_I2C   lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

#define DHTPIN 12     // DHT11 Data Pin
#define DHTTYPE DHT11   // For DHT 11 sensor
 
DHT dht(DHTPIN, DHTTYPE);
RTC_DS1307 RTC;

void setup()
{
  lcd.begin (20,4);
  Wire.begin();
  RTC.begin();
 
  //Set the clock to the date & time this sketch was compiled.
  if (! RTC.isrunning()) {
     RTC.adjust(DateTime(__DATE__, __TIME__));
  }
 
  // Switch on the backlight and prep the LCD
  lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
  lcd.setBacklight(HIGH);
  lcd.clear();
  lcd.home ();
 
  writetemphumid(0,2);  //wwrites initial temp and humidity
  lasttemptime=millis(); 
} //End setup

void loop()
{
  writedate(0,0);
  writetime(0,1);
  if(millis()-lasttemptime>1000*readint) //Reads DHT11 every readint seconds
  {
    writetemphumid(0,2);
    lasttemptime=millis();
  }
  if(millis()<lasttemptime) //Resets lasttemptime and reads DHT11 on millis() rollover, ~every 49 days.
  {
    writetemphumid(0,2);
    lasttemptime=millis();
    lcd.print("did it");
  } 
}  //End Loop

//function to write the time
void writetime(int col, int row)
{
  byte timehour;
  DateTime now = RTC.now(); //read the clock
  timehour = byte(now.hour());
  lcd.setCursor (col, row);
  if (timehour>12) timehour=(timehour-12);
  if (timehour==0) timehour=12; 
  lcd.print(timehour, DEC);
  lcd.print(':');
  if (now.minute()<=9) lcd.print("0");
  lcd.print(now.minute(), DEC);
  lcd.print(':');
  if (now.second()<=9) lcd.print("0");
  lcd.print(now.second(), DEC);
  lcd.print(" ");
  if (now.hour()>12) lcd.print("PM  "); else lcd.print("AM  ");
}  //End writetime

//function to write the date
void writedate(int col, int row)
{
  int daynumber;
  char* weekday[]={"Sunday=0 ", "Monday ", "Tuesday ", "Wednesday ",
                  "Thursday ", "Friday ", "Saturday ", "Sunday=1 "};
  DateTime now = RTC.now(); //read the clock
  if (now.hour()==0 && now.minute()==0 && now.second()<2)
  {
    lcd.setCursor(col, row);
    lcd.print("                    ");
  } 
  lcd.setCursor(col, row);
  daynumber = now.dayOfWeek();
  lcd.print(weekday[daynumber]);
  if (now.month()<=9) lcd.print("0");
  lcd.print(now.month(), DEC);
  lcd.print('/');
  if (now.day()<=9) lcd.print("0");
  lcd.print(now.day(), DEC);
  lcd.print('/');
  lcd.print(now.year(), DEC);
}  //End writedate

//function to write temperature and humidity
void writetemphumid (int col, int row)
{
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  // check if returns are valid, if they are NaN (not a number) then something went wrong!
  if (isnan(t) || isnan(h))
  {
    lcd.setCursor(col,row);
    lcd.print("Failed to read from DHT");
  }
   else {
    t=(9.0*t/5.0)+32.0;
    lcd.setCursor (col, row);
    lcd.print("Temp: ");
    lcd.print(int(t));
    lcd.print(" F");
    lcd.setCursor ( 0, (row+1));
    lcd.print("Humidity: ");
    lcd.print(int(h));
    lcd.print("%");
  }   
}  //Endwritetemphumid
Pages: [1]