Show Posts
Pages: [1] 2 3 ... 289
1  Using Arduino / Networking, Protocols, and Devices / Re: Xbee sleep mode question on: August 26, 2014, 06:04:14 pm
See attached for an idea of what I had in mind. Most of my XBee applications have not used the XBee's I/O capability, I've maybe played with it once or twice. It seems I always have a sensor or something that the XBee isn't capable of communicating directly with. So I let the MCU do the heavy lifting to produce the data, and then the XBee just does the communication.
2  Using Arduino / Networking, Protocols, and Devices / Re: Setting up X-bee network in API mode on: August 26, 2014, 03:49:29 pm
I saw a video in which network Co-ordinator is set in API mode and router in AT mode?.Can we have different modes in the same network?

It's a common misconception, but indeed, as @djb_rh said, the interfaces API/AT as well as baud rates can be mixed or matched in any way. The key point to understand is that these only affect the local interface to the module, and the RF link between modules is always the same and is unaffected by choice of mode (API or AT) or baud rate.

Quote
I read that there are different AT command frames to carry out different functions like source routing,remote AT commands etc. Now My question is how to set different command frames?. Should I program in arduino to send those corresponding AT command frames serially through xbee to other xbee I wish to communicate?
 eg:If i want a router to send a data, Should I create a command frame and send it serially from co-ordinator through zigbee so that router receives it and responds accordingly?

Source routing can be a bit hairy, I would recommend avoiding it until you have more experience and are sure that you need it. Indeed there is a frame to cause a remote module to execute AT commands, frame type 0x17.

Quote
If so ,can u show me a small program example to request a data from a router?

I don't happen to have one of those.

Quote
since I am using more than one light sensor, I want to address a particular sensor from co-ordinator and ask it to transmit the data only when I need it. Is it possible to do using AT command? If so, how to do it?

There is a command (1S) to force a sample to be taken, I suppose this could be sent via frame type 0x17. I don't operate my nodes this way, however, so I haven't tried it.

At the risk of repeating myself, the best favor you could do yourself is to learn to use Andrew Rapp's library. Otherwise you will be reinventing several large wheels. Of course maybe you want to roll your own API frames and also interpret them on the other end as an exercise, which is fine, but prepare to spend much more time on that than on the actual problem you're trying to solve.

In any event, API mode is the only way to go in order to really take advantage of the XBees' capabilities. AT mode is only good for trivial and non-critical applications, and is terribly cumbersome to use in any advanced scenario.
3  Using Arduino / Project Guidance / Re: Recommendation for a Simple 2 Line Display on: August 26, 2014, 07:26:33 am
Adafruit's library works with the MCP23008 I/O expander (as used in their backpacks) and FMalpartida's library works with the PCF8574 expander (as used in backpacks from electrofunltd.com), so the libraries are not interchangeable in that regard.

I benchmarked several libraries in native and in I2C mode (MCP23008); results and code are here.
4  Using Arduino / Project Guidance / Re: Recommendation for a Simple 2 Line Display on: August 25, 2014, 10:31:17 pm
These work very well for me, good sale price right now:
http://www.dipmicro.com/store/index.php?act=viewProd&productCode=LCD-1602A-B

I've also used these, they're also fine, interchangeable with the one above and a little less expensive:
http://www.dipmicro.com/store/LCD1602B-GEN

Both work fine with the standard LiquidCrystal library, as well as with some improved versions that are out there. To convert them to I2C, these work well:
http://www.adafruit.com/products/292
5  Using Arduino / Networking, Protocols, and Devices / Re: Xbee sleep mode question on: August 25, 2014, 10:24:17 pm
No clue I'm afraid. The way I read it, an I/O sample should be sent immediately after waking up. Is it possible that the XBee is not really going back to sleep all the time? Not sure if that would account for the varied behavior.

If power consumption is the only concern with adding a microcontroller, I sure wouldn't worry about that. Sleeping the MCU should make its power consumption negligible. But that would be the easy way out smiley-grin maybe it can be made to work with just the XBee.

What about pullups on the sleep pin, D0 and D1, buttons to ground on D0 and D1, and rather than a wake button on the sleep pin, use diodes to form an OR gate. So one diode from the sleep pin to D0 and one from the sleep pin to D1, with the anodes connected to the sleep pin. When either button is pressed, it should wake the XBee, and the I/O sample should show which button was pressed. Just thinking out loud.
6  Using Arduino / Sensors / Re: Weather on your Arduino on: August 25, 2014, 03:27:18 pm
Nice work! Good looking control panel. Bookmarked your blog. I hope you'll report back on how it performs over time.
7  Using Arduino / Networking, Protocols, and Devices / Re: Xbee sleep mode question on: August 25, 2014, 03:02:36 pm
Ah, I missed the multiple button requirement. Of course another alternative is adding a microcontroller for more flexibility.
8  Using Arduino / Sensors / Re: How to read DS3231 Internal temperature sensor, example code on: August 25, 2014, 02:57:35 pm
Does it go "negative binary"?

See http://en.wikipedia.org/wiki/Two%27s_complement
9  Using Arduino / Sensors / Re: How to read DS3231 Internal temperature sensor, example code on: August 25, 2014, 02:55:49 pm
This will handle temperatures below zero:

Code:
   const int DS3231_RTC_ADDR = 0x68;
    const int DS3231_TEMP_MSB = 0x11;
    union int16_byte {
        int i;
        byte b[2];
    } rtcTemp;
    
    Wire.beginTransmission(DS3231_RTC_ADDR);
    Wire.write(DS3231_TEMP_MSB);
    Wire.endTransmission();
    Wire.requestFrom(DS3231_RTC_ADDR, 2);
    rtcTemp.b[1] = Wire.read();
    rtcTemp.b[0] = Wire.read();
    long tempC100 = (rtcTemp.i >> 6) * 25;    //degrees celsius times 100
    Serial.print( tempC100 / 100 );
    Serial.print( '.' );
    Serial.println( abs(tempC100 % 100) );
10  Using Arduino / Sensors / Re: How to read DS3231 Internal temperature sensor, example code on: August 25, 2014, 02:13:40 pm
My gripe was with the blog item. The author ( I assume that wasn't you?  smiley-red  smiley-grin) seems to conclude that the two temperature sensors have comparable accuracy, which is what I take exception with. OTOH, if the DS3231 sensor is a good match for a particular application, then by all means use it!
11  Using Arduino / Sensors / Re: How to read DS3231 Internal temperature sensor, example code on: August 25, 2014, 01:51:22 pm

Foo. Anecdotal evidence. A sample size of one means nothing. The guy got lucky. Maxim pays one or more engineers six figures to arrive at the ±3°C spec; ignore the datasheet at your own peril. That blog post should at least have had a prominent YMMV.
12  Using Arduino / Networking, Protocols, and Devices / Re: Xbee sleep mode question on: August 25, 2014, 01:44:33 pm
Haven't looked into all the details, but wouldn't it just be a matter of putting the button on the sleep pin, configuring for pin sleep and cyclic sleep, then setting the sleep time (ST) to be shorter than the I/O sample rate (IR)? One I/O pin does need to be configured for sampling, but we don't care which or what its value is (probably a pullup resistor would be appropriate for minimum power consumption).

So the button should wake the module, send one I/O sample, then go back to sleep. As stated above, we don't care about "data", mere reception of the I/O sample means "the button was pushed".
13  Using Arduino / Sensors / Re: How to read DS3231 Internal temperature sensor, example code on: August 25, 2014, 01:29:57 pm
Here's an idea on how to avoid using float.

The MSB is an int, and the 2 bits of the LSB  represent quarter degrees as follows:

00=.00    01=.25    10=.50   11=.75

You should be able to use an if or switch case to display this value following the integer.

Except for temperatures below zero, 00 = 0.00, 01 = -0.75, 10 = -0.50, 11 = -0.25
14  Using Arduino / Sensors / Re: How to read DS3231 Internal temperature sensor, example code on: August 25, 2014, 01:23:33 pm
I'm curious why you guys want to access this temperature. It's the chip internal temp isn't it, for timing compensation?

Why not, it's a temperature. Not terribly accurate, ±3°C but better than nothing I guess.
15  Using Arduino / Sensors / Re: How to read DS3231 Internal temperature sensor, example code on: August 25, 2014, 11:59:24 am
This is how I do it.
Pages: [1] 2 3 ... 289