Show Posts
Pages: 1 ... 5 6 [7] 8 9 ... 26
91  Using Arduino / General Electronics / Re: Can I use 4.7K pullup with DHT22 sensor? on: August 07, 2013, 08:36:42 pm

I have a project (below) where I turn off power to the DHT22 to save power. The resistor is connected to the switched power line, so it also is disconnected.

http://www.gammon.com.au/forum/?id=12106
Wow I'm reading it now, great job on that project! 36 µA that's amazing!!! 
I'm looking to build an outdoor temp/humidity sensor with wireless transmitter. So far it only lasted for 10 days on 2xAA (powered via 3.3V DC up converter). I'm not actually using DHT22 yet, only DS18B20 as proof of concept, but it's part of DHT22. I calculated that 4.7K resistor is possible power hog (at 3.3V 4.7K resistor will draw 0.7mA)  that kills batteries since it's inserted between data VCC line, thus I wanted to power it down via transistor while microprocessor is "watchdog" sleeping (8*8 seconds) between measurements and transmissions...
92  Using Arduino / General Electronics / Re: Can I use 4.7K pullup with DHT22 sensor? on: August 07, 2013, 05:01:53 pm
The device is an 'open drain' device - it can only pull a line low, so you need to supply the HIGH for it to pull down.
Thanks!
So what will happen if I disconnect resistor? Device simply won't work, or it can damage microcontroller connected to it?
93  Using Arduino / General Electronics / Re: Can I use 4.7K pullup with DHT22 sensor? on: August 07, 2013, 09:51:30 am
Great, thank you guys!
One more question. What exactly is purpose of pullup in this device?  What will happen if I disconnect resistor when reading are not being taken (i.e. via transistor to save on power drain)?
94  Using Arduino / General Electronics / Can I use 4.7K pullup with DHT22 sensor? on: August 05, 2013, 01:41:38 pm
I already have board with soldered 4.7K pullup resistor for DS18B20 temp. sensor. I want to replace it with DHT22 temp/humidity sensor. Adafruit recommends 10K pullup, but will it also work with my 4.7K? I really don't want to de-solder it smiley
95  Using Arduino / General Electronics / Re: Best multimeter for DC work? on: August 02, 2013, 12:40:55 pm

A very nice solution is the get a amplified current sensor that any multimeter can then read to obtain such measurements. Adafruit carries a very nice one that David Jones designed.

http://www.adafruit.com/products/882

Lefty
Wow, that's really cool! Exactly what I need, thanks man! Ordering one!
96  Using Arduino / General Electronics / Best multimeter for DC work? on: August 02, 2013, 08:44:09 am
I've run into limitations with my cheapo $30 multimeter when I needed to measure custom Arduino circuit power draw over time (in microAmps) over period of time (developing battery powered sensor).
So I'm shopping for a great multimeter, preferably around $250 smiley
I've read a lot about Fluke 87-V, which seems like a dream, only it's a bit expensive ($330 new, I can get Oscilloscope for that money!) and it seems to be geared mostly to AC work, and I don't give rat's behind about True RMS feature smiley
So I'm thinking to pull trigger on a used Fluke on eBay, but wanted to check here first if there's anything better you might recommend?
Something that would suit better for DC and microprocessor work, can measure microAmps with high precision and also can log stats over time (so I can find out average current of circuit i.e. it sleeps, wakes up, sends signal and goes back to sleep).
97  Using Arduino / Project Guidance / Re: Programming and decoding universal remote IR codes on: August 01, 2013, 08:17:32 pm
Great that you got it working....had look at your clock very cool you should try out a crowdfunding effort!
Thanks! smiley
Yeah I've been thinking about putting it on Kickstarter...
98  Using Arduino / Project Guidance / Re: Programming and decoding universal remote IR codes on: August 01, 2013, 07:13:24 pm
Thanks a lot for your suggestions!
I just tried something and yeah it works. Basically I already programmed my clock to recognize specific set of IR codes (i.e. mute button triggers clock to start talking), so that's what I'm using to program remotes. I just hold Mute until clock responds and from that point remote remembers which code it was. That's what I'll write in manual for users in case they need to reprogram it (although remote seems to keep latest code in EEProm, battery removal doesn't trigger memory loss)
99  Using Arduino / Project Guidance / Re: Programming and decoding universal remote IR codes on: August 01, 2013, 06:19:48 pm
try
Serial.println(results.decode_type);
Thanks. I actually just copied parts of the dump function form IRDump example.
Here's result from holding mute button for about 2 minutes.
100  Using Arduino / Project Guidance / Re: Programming and decoding universal remote IR codes on: July 30, 2013, 01:23:34 pm
Thank you! smiley I will try it and post result tonight!
101  Using Arduino / Microcontrollers / Re: Repurposing main UART for other tasks? on: July 30, 2013, 09:33:45 am

Simple: The UNO and many other Arduino's only have 1 hardware Serial port which is often used for "debugging", so it could be useful if a GPS or GSM shield could connected to the I2C bus instead.

OR, if someone has too many serial devices, i.e. GPS + GSM + Bluetooth + Wifi + RFID reader, etc.
If you are not using ports 10,11 on Uno you can use them as Serial ports with SoftwareSerial. But if you do have more than one Serial device, it could be a problem of course smiley
In theory tho, you can probably use transistor array to switch RX/TX pins between all serial devices, but of course it will be difficult to manage in code and you won't be able to receive communication from all of them at the same time.
102  Using Arduino / Microcontrollers / Re: Repurposing main UART for other tasks? on: July 30, 2013, 09:16:59 am
Quote
there's nothing that should prevent me from sharing UART1 with FTDI and another devices
GPS devices in particular might be "ticky"  because they tend to have text-based command interfaces, and are "somewhat likely" to respond to the traffic that happens during uploading (and thus interfere with it.)  If you can keep the other serial devices disabled or disconnected or silent during uploading, you should be OK.

That's true, but I'm not using RX pin on GPS module (btw its Ultimate GPS from Adafruit), so GPS doesn't receive any data from arduino. Also addition of 1K resistor after FTDI line should make FTDI's TX a priority. In fact Microcontroller completely ignores data coming from GPS until I disconnect TX wire from FTDI (even when nothing is being sent via FTDI). I'm not sure why this happens, but I'm not complaining! smiley

Sorry to hijack this thread, but I've been wondering about a solution for this problem myself for quite some time. Is it even possibly to use a GPS, or GSM modem with I2C, instead of hardware serial ports?
Hijack away! smiley
Here's some suggestion here: http://wyolum.com/gps-over-i2c/
BTW why can't you use Serial ports? Is it hardware limitation or software?
103  Using Arduino / Microcontrollers / Re: Repurposing main UART for other tasks? on: July 29, 2013, 09:30:35 pm
Got it working!
Basically I'm only using Serial0 for everything.
Step 1. Connect TX wire from GPS to ATMega's RX via 1K Resistor.
Step 2. Upload sketch
Step 3. Disconnect TX wire from FTDI. At this point it starts getting data from GSP

Code:
#include <Time.h>
#include <TinyGPS.h>       // http://arduiniana.org/libraries/TinyGPS/
//#include <SoftwareSerial.h>
// TinyGPS and SoftwareSerial libraries are the work of Mikal Hart

//SoftwareSerial SerialGPS = SoftwareSerial(10, 11);  // receive on pin 10
//#define my Serial1
TinyGPS gps;

// To use a hardware serial port, which is far more efficient than
// SoftwareSerial, uncomment this line and remove SoftwareSerial
//#define SerialGPS Serial1

// Offset hours from gps time (UTC)
//const int offset = 1;   // Central European Time
//const int offset = -5;  // Eastern Standard Time (USA)
const int offset = -4;  // Eastern Daylight Time (USA)
//const int offset = -8;  // Pacific Standard Time (USA)
//const int offset = -7;  // Pacific Daylight Time (USA)

// Ideally, it should be possible to learn the time zone
// based on the GPS position data.  However, that would
// require a complex library, probably incorporating some
// sort of database using Eric Muller's time zone shape
// maps, at http://efele.net/maps/tz/

time_t prevDisplay = 0; // when the digital clock was displayed

void setup()
{
  Serial.begin(9600);
  //while (!Serial) ; // Needed for Leonardo only
  //Serial1.begin(9600);
  Serial.println("Waiting for GPS time ... ");
}

void loop()
{
  while (Serial.available()) {
    if (gps.encode(Serial.read())) { // process gps messages
      // when TinyGPS reports new data...
      unsigned long age;
      int Year;
      byte Month, Day, Hour, Minute, Second;
      gps.crack_datetime(&Year, &Month, &Day, &Hour, &Minute, &Second, NULL, &age);
      if (age < 500) {
        // set the Time to the latest GPS reading
        setTime(Hour, Minute, Second, Day, Month, Year);
        adjustTime(offset * SECS_PER_HOUR);
      }
    }
  }
  if (timeStatus()!= timeNotSet) {
    if (now() != prevDisplay) { //update the display only if the time has changed
      prevDisplay = now();
      digitalClockDisplay();  
    }
  }
}

void digitalClockDisplay(){
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year());
  Serial.println();
}

void printDigits(int digits) {
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}
104  Using Arduino / Microcontrollers / Re: Repurposing main UART for other tasks? on: July 29, 2013, 07:56:19 pm

Actually I believe the 1284 has a third user interrupt pin INT2 on chip pin 3. Check the datasheet to verify.

Lefty

Oh cr@p! Been working for 6 months with this chip and believed it only had 2, you are right, there's a 3rd one!!!
Thank you lefty!
Unfortunately I already made 100+ PCBs with that use INT1 for radio module smiley-sad
But as far as my original question, there's nothing that should prevent me from sharing UART1 with FTDI and another devices (i.e. upload sketch via FTDI, disconnect FTDI and connect GPS)? 
105  Using Arduino / Microcontrollers / Repurposing main UART for other tasks? on: July 29, 2013, 07:32:18 pm
I'm using ATMega1284p chip with Mighty bootloader.  It has 2 UARTs for serial communication.  I'm using 1st to program it via FTDI adapter, however is it possible to use this UART for other things, like communicating to GPS?
See the problem is I can't use second UART because it's physically same pins (16,17) as only 2 hardware interrupts (INT0, INT1) and I'm using at least one of them!  I can't believe Atmel did this smiley-sad

Anyway I still want to be able to use 1st UART for programming chip, I just want GPS connected to it as well and for some reason it's not working. I didn't figure out how to debug it since serial port is in use. Is there something, maybe a bootloader that might prevent me from using UART1 w/ GPS?
GPS works fine with UART2 btw.

Using things like SoftwareSerial also won't work, because it doesn't support ATMega1284p...
Pages: 1 ... 5 6 [7] 8 9 ... 26