Show Posts
Pages: 1 ... 123 124 [125] 126 127 ... 281
1861  Using Arduino / General Electronics / Re: Mosfet gate voltage on: February 23, 2013, 03:12:49 pm
Interesting ... agree it seems to be pointing to breadboard or wiring or something similar.

How many miles on that breadboard? I'm pretty surprised that I don't have more breadboard issues than I do, they're really quite rare, but most of mine are relatively new.
1862  Using Arduino / General Electronics / Re: Mosfet gate voltage on: February 23, 2013, 02:43:38 pm
Yet when driving a pure resistive load, the voltage looked steady, correct? Does the motor spin at a constant speed or does it act as though it's getting variable voltage?
1863  Using Arduino / General Electronics / Re: Mosfet gate voltage on: February 23, 2013, 01:48:48 pm
You want me to take the motor out of the circuit or leave it in?

Leave it in please
1864  Using Arduino / General Electronics / Re: Mosfet gate voltage on: February 23, 2013, 01:31:12 pm
Thanks for the pics, nothing is jumping out at me I'm afraid. I would disconnect AREF from Vcc, and I would add two 0.1µF caps, one from AREF to ground, and one from AVCC to ground. I'd be surprised if that was causing the problem though.

The motor is just spinning free, and the 7805 is not getting hot. In fact I can't find any part of the circuit getting hot. I tried connecting the 220-ohm resistor and read 4.74V when driven high from output to ground. It measures 0.47V when driven low from output to +5V.

Those voltage readings are good. So if we use a 220-ohm resistor between the MCU and MOSFET gate, and just drive the pin with digitalWrite() rather than PWM, when the pin is driven high, what are the voltages on either side of the 220-ohm resistor?
1865  Using Arduino / Networking, Protocols, and Devices / Re: Xbee Series 2 Boot Time on: February 23, 2013, 09:41:06 am
Talking through my hat, but actual "boot time", i.e. time for the firmware to be running in steady state, should be less than a second.

Even if the module isn't associated with a network, it should only take a very few seconds after power up (just a SWAG judging from experience, I haven't actually measured it, but 3-4 sec has to be enough, nowhere near 15.)

My experience is with the ZigBee firmware, not sure if ZNET would be different or by how much.

Not as an answer to the issue here, but the product manual does specify that coordinators and routers should be mains-powered. I'd probably try an end device and pin sleep, rather than pulling the rug out by switching the power.

1866  Using Arduino / General Electronics / Re: Mosfet gate voltage on: February 23, 2013, 09:20:21 am
The regulator is going into thermal limit... small dc motors draw in the 100 to 300 mA range and the load on the regulator is about 2 watts of power, more than enough for it to thermal limit.

No-load current for the motor is 200mA per the specs. Assuming 7.2V input (6xNiMH @1.2V each) and 250mA total current, I estimate (7.2 - 5) * .25 = 0.55W ... Even without a heatsink, a 7805 should last quite a bit longer than a few seconds, indeed probably wouldn't need a heatsink to dissipate half a watt or so. The motor's stall current is much higher of course, 2.1A. That might be a problem.

@Tesla, two questions:

1. Is there any mechanical load on the motor, or is it just spinning free?
2. Is the 7805 getting hot?

Something to try, test the drive capability of the MCU. Remove the motor and MOSFET, try to drive a purely resistive load from the ATmega. Connect a 220-ohm resistor from an output pin to ground. Drive the pin high, measure the pin voltage. Now connect the resistor from the pin to +5V and drive it low, again measure the pin voltage.

Be sure to use decoupling caps as described by majenko.

Still would like a picture of the setup if possible.
1867  Using Arduino / General Electronics / Re: Mosfet gate voltage on: February 22, 2013, 10:42:12 pm
When I apply power to my breadboarded ATmega 328 with a small DC motor driven through a logic level mosfet, the voltage measures about 5v then drops to around 2v after 4 or 5 seconds.

Is this the input voltage to the circuit (i.e. the 7805 output voltage), the voltage at the I/O pin that drives the MOSFET gate, the voltage delivered to the motor, or something else?

Can you provide a good quality picture of the breadboard setup?
1868  Using Arduino / Programming Questions / Re: big int to/from EEPROM on: February 22, 2013, 12:34:24 pm
For the 8-bit AVRs, an int is the same as a word, two bytes. Also uint16_t and int16_t are different names for unsigned int and int.
1869  Using Arduino / Programming Questions / Re: big int to/from EEPROM on: February 22, 2013, 11:41:51 am
that seems equivalent:
http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html#gabeef2e14398b47268f88462b3d7738dc

uint16_t eeprom_read_word   (   const uint16_t *    __p )   
   Read one 16-bit word (little endian) from EEPROM address __p.

eeprom_read_word always read 2 bytes, is it correct?

Correct.

Quote
23.14.3.5 uint16_t eeprom_read_word ( const uint16_t  p )
Read one 16-bit word (little endian) from EEPROM address __p.
1870  Using Arduino / Programming Questions / Re: big int to/from EEPROM on: February 22, 2013, 11:01:15 am
Or one of the functions below, see the avr-libc user manual at http://www.nongnu.org/avr-libc/

Code:
• uint8_t eeprom_read_byte (const uint8_t __p) __ATTR_PURE__
• uint16_t eeprom_read_word (const uint16_t __p) __ATTR_PURE__
• uint32_t eeprom_read_dword (const uint32_t __p) __ATTR_PURE__
• float eeprom_read_float (const float __p) __ATTR_PURE__
• void eeprom_read_block (void __dst, const void __src, size_t __n)
• void eeprom_write_byte (uint8_t __p, uint8_t __value)
• void eeprom_write_word (uint16_t __p, uint16_t __value)
• void eeprom_write_dword (uint32_t __p, uint32_t __value)
• void eeprom_write_float (float __p, float __value)
• void eeprom_write_block (const void __src, void __dst, size_t __n)
1871  Using Arduino / Project Guidance / Re: Need help with Clock Controller and relay contact on: February 20, 2013, 04:02:00 pm
One of my favorites is this library:
http://playground.arduino.cc/Code/Time

It includes a "TimeAlarms" library that I think will do just what you want. Use an external real time clock (RTC) if your particular system clock is not accurate enough.

Quote
Alarms

The Alarm library is a companion to the Time library that makes it easy to
perform tasks at specific times or after specific intervals.

Tasks scheduled at a particular time of day are called Alarms,
tasks scheduled after an interval of time has elapsed are called Timers.
These tasks can be created to continuously repeat or to occur once only. 

Here is how you create an alarm to trigger a task repeatedly at a particular time of day:
  Alarm.alarmRepeat(8,30,0, MorningAlarm); 
This would call the function MorningAlarm()  at 8:30 am every day.

If you want the alarm to trigger only once you can use the alarmOnce  method:
  Alarm.alarmOnce(8,30,0, MorningAlarm); 
This calls a MorningAlarm() function in a sketch once only (when the time is next 8:30am)

Alarms can be specified to trigger a task repeatedly at a particular day of week and time of day:
  Alarm.alarmRepeat(dowMonday, 9,15,0, MondayMorningAlarm); 
This would call the function WeeklyAlarm() at 9:15am every Monday.

If you want the alarm to trigger once only on a particular day and time you can do this:
   Alarm.alarmOnce(dowMonday, 9,15,0, MondayMorningAlarm); 
This would call the function MondayMorning() Alarm on the next Monday at 9:15am.

Timers trigger tasks that occur after a specified interval of time has passed.
The timer interval can be specified in seconds, or in hour, minutes and seconds.
  Alarm.timerRepeat(15, Repeats);            // timer task every 15 seconds   
This calls the Repeats() function in your sketch every 15 seconds.

If you want a timer to trigger once only, you can use the timerOnce method:
  Alarm.timerOnce(10, OnceOnly);             // called once after 10 seconds
This calls the onceOnly() function in a sketch 10 seconds after the timer is created.

If you want to trigger once at a specified date and time you can use the trigger Once() method:
  Alarm. triggerOnce(time_t value,  explicitAlarm); // value specifies a date and time
(See the makeTime() method in the Time library to convert dates and times into time_t)

Your sketch should call the Alarm.delay() function instead of the Arduino delay() function when
using the Alarms library.  The timeliness of triggers depends on sketch delays using this function.
  Alarm.delay( period); // Similar to Arduino delay - pauses the program for the period (in milliseconds).
1872  Using Arduino / Programming Questions / Re: Need assitance with code on: February 20, 2013, 03:48:59 pm
Huge duplications of code as already pointed out. Need to learn some programming techniques; let the machine do the work for you. The forty rawXX arrays account for 8000 bytes alone, they will easily cause the SRAM on even a Mega2560 to be exceeded.

The functions below go on and on and on (I didn't count how many, but just copied the first few) -- these can probably be replaced by a single function. They appear to be identical except for "IR05S", "IR06S", etc. Learn to pass parameters to functions. Pass the argument either as a string "IR05S" or as an integer (5) and build the needed string in the function. So the call would be like IR(5).

Code:
void IR05(){
    cli();
    for (int i = 0; i < 1; i++) {
        irsend.sendRaw(raw1,100,38);
        delay(80);
    }
    sei();
    Udp.beginPacket(iPhoneIP, iPhonePort);
    Udp.write("IR05S");
    Udp.endPacket();
    Serial.write("IR05S");
    irrecv.enableIRIn();
}//sinoteck TV ON/Off
void IR06(){
    cli();
    for (int i = 0; i < 1; i++) {
        irsend.sendRaw(raw1,100,38);
        delay(80);
    }
    sei();
    Udp.beginPacket(iPhoneIP, iPhonePort);
    Udp.write("IR06S");
    Udp.endPacket();
    Serial.write("IR06S");
    irrecv.enableIRIn();
}//sinoteck TV ON/Off
void IR07(){
    cli();
    for (int i = 0; i < 1; i++) {
        irsend.sendRaw(raw1,100,38);
        delay(80);
    }
    sei();
    Udp.beginPacket(iPhoneIP, iPhonePort);
    Udp.write("IR07S");
    Udp.endPacket();
    Serial.write("IR07S");
    irrecv.enableIRIn();
}//sinoteck TV ON/Off
1873  Using Arduino / Programming Questions / Re: How often to write to EEPROM on: February 20, 2013, 03:41:02 pm
I've only seen the mouser pricing.

Yep that's where I was shopping.
1874  Community / Bar Sport / Re: Russia gets hit by meteor and watch a flyby live on: February 20, 2013, 02:31:51 pm
And if the asteroids and meteors don't get us...
http://news.yahoo.com/higgs-boson-particle-may-spell-doom-universe-152236961.html

I'm so depressed. All the diodes on my left side hurt.
1875  Using Arduino / Programming Questions / Re: How often to write to EEPROM on: February 20, 2013, 01:55:08 pm
You can also use a FRAM chip (mouser.com)
Has non-volatilty of EEPROM, but waaay higher unendurance,10^14 write cycles,
and access speed of SRAM.

I was really wanting to try FRAM for a datalogger project I'm designing, but the cost is way out there. I can get 2Mb EEPROMs for about the same price as a 16KB (128Kb) FRAM. 2Mb FRAMs cost about 5.5 times as much as an EEPROM with equivalent capacity. For some reason I thought it was quite a bit more cost-effective than that. The EEPROM I'm looking at has 4M write-cycle endurance and 200-year data retention. Not even close to that of FRAM, but neither will I ever wear it out. Given the low-bandwidth nature of the thing, I doubt that the slower access speed will be a factor, either.

Anyhoo just disappointed in the pricing. If you come across any deals though, be sure and give a holler!
Pages: 1 ... 123 124 [125] 126 127 ... 281