Show Posts
Pages: 1 ... 128 129 [130] 131 132 ... 289
1936  Development / Other Hardware Development / Re: Pin A6 and A7 on: March 07, 2013, 05:46:21 pm
I have a project in the pipe that will use them to monitor battery voltage. A few weeks off yet.
1937  Community / Bar Sport / Re: Are you a generalist or specialist? on: March 07, 2013, 09:43:52 am
Contract work is different, there's a deadline and the job just gets done by then...well sometimes.

"I love deadlines. I like the whooshing sound they make as they fly by."
-- Douglas Adams
1938  Community / Bar Sport / Re: Are you a generalist or specialist? on: March 06, 2013, 10:00:10 pm
Generalist through and through. I've always loved that quotation, which is "from the Notebooks of Lazarus Long" in Heinlein's Time Enough For Love. In fact I was just thinking about it the other day, and wondering if I could get or make a copy of it to hang on my office wall. Good book, I should read it again, it's been a long time.
1939  Using Arduino / Sensors / Re: Arduino UNO simple single point water level indicator help! on: March 06, 2013, 06:15:45 pm
i thought of maybe tinning the copper wires beforehand, maybe that would slow corrosion down even more?
even if there is no current, they will corrode eventually, if they last 6 months its good!

I have a high-water alarm where I just used some stainless steel bolts from the hardware store as electrodes. But they're out of the water most of the time, your project would obviously be the opposite.
1940  Using Arduino / General Electronics / Re: What are chips like the MEGA2560 used for in real-world applications? on: March 06, 2013, 04:48:34 pm
I can't figure what I'd do with ~80 I/O pins.  I'm amazed at how powerful the 8-bit MCUs are, but I'd still think the CPU would run out of horsepower running that much stuff.

You just lack imagination grasshopper. A standard and ever popular 8x8x8 LED cube would work very nicely using up 72 of those pins. Who need's shift registers when I have a 80 I/O pin micro in hand?  smiley-grin

Lefty

LOL well the cubes are cool enough but I could never get excited enough about the concept to attempt one myself.
1941  Using Arduino / Sensors / Re: Arduino UNO simple single point water level indicator help! on: March 06, 2013, 02:43:06 pm
Corrosion requires current, yes? How much current flows into a MOSFET gate?
I'd try using two pins rather than sensing to ground.
One pin is a digital output, drive it high to deliver a sense voltage for just a few milliseconds, the rest of the time make it an input pin (i.e. high impedance). The other pin is an analog input as already configured.
Use a resistor in series with each pin, maybe 10K or even 100K.
If the electrodes were stainless steel, I wonder how much corrosion would occur with this setup.
But the electrodes could still be reversed as Rob suggests.

I wouldn't worry about some variation in readings. Just define two thresholds, e.g. 800 or more means there is water, 200 or less means there is no water. Keep a state variable that doesn't change unless one of the thresholds is exceeded. With that amount of hysteresis, it should work well. Mount the electrodes solidly so that the spacing doesn't change.

1942  Using Arduino / General Electronics / Re: What are chips like the MEGA2560 used for in real-world applications? on: March 06, 2013, 02:09:20 pm
I can't figure what I'd do with ~80 I/O pins.  I'm amazed at how powerful the 8-bit MCUs are, but I'd still think the CPU would run out of horsepower running that much stuff.
1943  Using Arduino / Programming Questions / Re: Please help. on: March 05, 2013, 08:47:50 pm
Is it really this hard just to display some temperature?

It's really not that hard, but it can take some time to realize how easy it is.
1944  Development / Other Hardware Development / Re: My first pcb on: March 05, 2013, 02:32:34 pm
Are ground pins 8 and 22 connected? They should be.
1945  Using Arduino / Project Guidance / Re: Atmel 328 chip dead? on: March 05, 2013, 07:30:30 am
I'll check my vendor and part number, I think I may have bought the chip that had a bootloader on it...has a blue sticker stuck to it.

Bootloader should not have mattered at all to an ICSP programmer. Should still be able to read fuses, signature bytes, etc. I've bought a lot of MCUs, 328s and others, many from Mouser, a few from Digikey and a few from other sources. Never a bad one and never any stickers on them, but I've never bought one with a bootloader already installed, I suppose the sticker could be to identify that.

Good luck, let us know the outcome of this mystery!
1946  Using Arduino / Project Guidance / Re: Atmel 328 chip dead? on: March 04, 2013, 10:43:11 pm
What are the odds that the first chip I get is a dud?

Exceedingly unlikely, but your description has me scratching my head. From the factory, the chip is set to run from the internal 8MHz RC oscillator divided by 8, so a clock frequency of 1MHz. If an external crystal or resonator is connected, it will not be used to supply the system clock until the fuse bytes are modified appropriately. A valid clock is needed for ICSP programming (e.g. with the AVRISPMKII), which is why the default fuse settings are what they are. Allows the chip to be programmed in pretty much any situation.
1947  Using Arduino / Programming Questions / Re: DS1307 and writing problem into 56 internal ram on: March 04, 2013, 10:01:56 pm
Neat functions. What is the purpose of the isrunning function? Must the RTC clock be stopped to write (or read) into the scratch pad ram locations?

Just quick-and-dirty stuff really, but it gets the job done. I don't think it's an absolute requirement, but yes the usual practice is to stop the RTC while setting the time to avoid any unwanted rollover in the time registers. OTOH, just setting the seconds register first would seem to be safe enough in most cases as this also resets the divider chain.

But in this case I was relying on a library to set the RTC. I use the Time library a lot, and because it syncs with a hardware RTC every 5 minutes (by default), an interesting thing happens. When initially powered up, the RTC's clock is halted. Still, the Time library can read the time from it (usually 1/1/2000 00:00) and then the time as returned by the Time library will advance as normal for the next five minutes. When it syncs with the hardware RTC again, the time snaps back to 1/1/2000 00:00.

I had a sketch where I wanted to ensure the RTC was running so as to avoid this, even if the RTC time was wrong. So in setup() I do
Code:
    if (!dsIsRunning()) RTC.set(RTC.get());
which basically leaves the RTC time set to the same value as before, but ensures its clock is running. (The library function RTC.set() stops the RTC clock, sets the time, then starts the clock again.)
1948  Using Arduino / Programming Questions / Re: DS1307 and writing problem into 56 internal ram on: March 04, 2013, 07:22:57 pm
Here are some simple functions I wrote to read and write the DS1307 RAM.

Code:
#define DS1307_ADDR 0x68
#define RAM_OFFSET 8         //map logical ram addresses (0-55) to physical addresses (8-63)

//write to DS1307 RAM where addr>=0 and addr<56
void dsSramWrite(byte addr, byte *values, byte nBytes)
{
    Wire.beginTransmission(DS1307_ADDR);
    Wire.write(addr + RAM_OFFSET);
    for (byte i=0; i<nBytes; i++) Wire.write(values[i]);
    Wire.endTransmission();   
}

//read from DS1307 RAM where addr>=0 and addr<56
void dsSramRead(byte addr, byte *values, byte nBytes)
{
    Wire.beginTransmission(DS1307_ADDR);
    Wire.write(addr + RAM_OFFSET);
    Wire.endTransmission(); 
    Wire.requestFrom( (uint8_t)DS1307_ADDR, nBytes );
    for (byte i=0; i<nBytes; i++) values[i] = Wire.read();
}

//is the DS1307 oscillator running?
boolean dsIsRunning(void)
{
    byte secRegister;        //seconds register, bit 7 is clock halt (CH) bit
   
    Wire.beginTransmission(DS1307_ADDR);
    Wire.write(0x00);        //seconds register is address zero
    Wire.endTransmission(); 
    Wire.requestFrom( DS1307_ADDR, 1 );
    secRegister = Wire.read();
   
    return !(secRegister & 0x80);
}
1949  General Category / General Discussion / Re: Need help picking a board as a gift on: March 02, 2013, 01:21:26 pm
Can't go far wrong with an Uno, it's the most popular and has more than enough possibilities for interesting projects. Depending on how much you want to spend, consider one of the many starter kits. If your friend doesn't have a collection of electronic parts, those kits can be a good introduction. They usually come with a series of experiments.

https://www.sparkfun.com/products/11227
https://www.adafruit.com/products/1078
https://www.adafruit.com/products/68
https://www.adafruit.com/products/193
1950  Using Arduino / Networking, Protocols, and Devices / Re: How to measure XBee signal strength? on: March 02, 2013, 07:55:11 am
I'm curious why no one recommended just reading the signal strength from the packet?

Because we're masochists here and we want to do it the hard way in transparent mode smiley-grin

BTW the frame you showed is a Series 1 API frame; the OP is using Series 2 modules, which do not include RSS in the API frames. It takes a separate interaction (reply #6 above) to read RSS. Still miles easier and faster in API mode.

</rant> smiley-wink

Quote
just reading the signal strength from the packet?
Cool, thanks for the input. First you have to be smart enough to know about that
[LOL], and then, how would you actually read what's in the packet, not having the
Titus manual here for reference?

It's all in the product manual as well, Series 1 or Series 2.

Trust me, I'm stumbling around here. Took me forever to get a servo to respond to a pot. The Lab Manual is pretty useful, but it's dense. I only go a few pages at a time. Parsing apart the analog data is especially nasty.

Are you aware of this library? Makes things quite a bit easier.
Pages: 1 ... 128 129 [130] 131 132 ... 289