Show Posts
Pages: 1 2 [3] 4 5
31  Forum 2005-2010 (read only) / Development / Re: What's consuming all the power on Mega board? on: March 04, 2010, 12:22:27 am
Wondering out loud here, what if I put a series of a few 1n4001 diodes ahead of the Vreg input.  Each one would drop a volt or so... and is one less volt the regulator would have to blow off as heat.  I don't think the diodes would heat at all with these currents.
32  Forum 2005-2010 (read only) / Development / Re: What's consuming all the power on Mega board? on: March 02, 2010, 08:10:20 pm
have something here:

is a linear regulator... with some surrounding robustness.

Usually, I put a 150 Ohm resistor (wattage sized to load) in place of that choke, then run in series through a 1n4001 then into the regulator, caps either side.  LM7805 is robust enough to handle the big dumps experienced in the car operations.  No zener shunt required, so long as inrush current is limited - which the 150 resistor does.

I've used lotsa linears in automotive applications like this. LM2931 is a better choice for auto app's tho.
I might have some kicking around, but if I replace the regulator on the Mega board, is the consumption going to drop?

Just wondering what on the Arduino board is so hungry.

It's not so much tolerating the 14.4 charging voltage I'm concerned about, its the off-state 12.6 battery sitting there being drained I'm concerned about.

33  Forum 2005-2010 (read only) / Development / What's consuming all the power on Mega board? on: March 02, 2010, 03:04:23 pm
The digital blink example is loaded on my Mega board.

The board is powered by barrel jack, Vin measuring 12.1v using wall wart, regulated DC style.

My meter (in-line at the jack) shows consumption of the Arduino Mega board to be 60mA when the LED is off and about 65mA when on.    It's not a fast meter... so I might not be catching the extremes well...  

No matter, my question is:  what is sucking the power?

The 1280 shouldn't be... not at 16MHz full tilt.
The power LED has a 1K in series so cannot be more than 5mA contributor.  Similar for pin13 LED.
Is the USB chip that hungry?  
The 358?
Or do the dual voltage regulators really consume that much current...
(I thought they might contribute 1 mA or so of actual current draw).

I was hoping to embed this Arduino board into a car such that it would be powered all the time.   60mA is about three times higher than I'd like to see constant draw for this device.

If I were to cut a trace to lighten the load, and really only need the MCU running in the target... and maybe less support circuitry, where do I best go hunting?

34  Forum 2005-2010 (read only) / Development / safe to upload to externally powered Arduino Mega? on: March 02, 2010, 02:30:29 pm
If I leave a Mega externally powered all the time, connected to its barrel jack.... is it safe to plug the USB into my computer for uploading a new program to it?  Or does this create an unsafe 5V conflict with my computer's USB port, and/or stress the voltage selection circuitry on the Mega?

35  Forum 2005-2010 (read only) / Interfacing / Re: PWM chopped backlight confuses LCD on: March 10, 2010, 07:09:54 pm
OK, I added another flyback diode this time over the mosfet drain and source.  And I changed the the path of the dropping resistor on the module itself.   Still got the duplicates displayed.

I'm becoming pretty sure its ribbon cable related, and I've even found a sweet spot of holding the ribbon behind the LCD module in such a way that it almost guarantees duplicates - depending on the code!   :o  Read on...

Looking at the hello world sample code there are lots of numbers being sent to the LCD, so I'm pretty sure the dups were being generated by the Arduino, not buffered and simply being reprinted by the LCD.  Each one comes from the Arduino.

So what's causing the dup's to appear... it has to be related to the setCursor command not getting through to the LCD.  It's not setting the cursor back to column 0, so a second number follows from where the LCD has last left off with its cursor.   A dup appears!

With this code:

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:

Now, here's the bizarre part.  I changed one line of code, the location of the cursor to column one:

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(1, 1);
  // print the number of seconds since reset:

When I run this code.... I don't get duplicates on the LCD.  Numbers count up normally (in column 1 of course).  But no dups.  Even when I hold the ribbon cable in the sweet spot behind the LCD.  

 :-?  There's something more robust about the command that moves a cursor over to position 1 rather than 0?  

Anyway, I need to put focus on the cable, obviously.   I will separate the backlight lines from the LCD/data lines.   I'm also thinking I should do something about removing the wires from unused pins and no run dead lines to the Arduino if not needed.   I think I'll ground RW right at the module, and save a wire there.   Wonder if I should connect pullups or pulldowns for the unused data lines d0-3 at the module?  
36  Forum 2005-2010 (read only) / Interfacing / Re: PWM chopped backlight confuses LCD on: March 10, 2010, 05:59:19 pm
Well, I tried a couple things... and the behaviour changed.

First I added a 47uF and 0.1uF cap at the LCD module power pins.
This got rid of one kind of error... the LCD would occasionally "splat" within a minute and instantly show garbage all over... that doesn't happen any more.   Now it never splats.  So stiffening the power at the module has helped, and removed the problem of power glitching its CPU.

But it still exhibits the other error it was showing: using the hello world LCD example occasionally the "seconds counter" prints twice, it duplicates the number on the same row.  For example, if it's on 42 seconds, it might print 4242 on the second line.  This is hit or miss.. it can count normally for a while incrementing as it should, then boom I get a double.

Sometimes the 2nd number appears almost simultaneously, as if to "roll over together".   Sometimes, the second printing of the number is delayed, so "89" comes and a fraction of a second later I get the second 89 is printed (resulting in "8989" on the display).   The second number sticks in its position while normal counting resumes... until it's overwritten by another duplicate.  

Now, unless the Arduino is sending all that data up twice (I doubt it), there is some signaling combination appearing at the module that is causing it to repeat the last thing it did.   Not just the last digit it got, it's whole last number string getting printed twice.

2nd thing I tried was putting a reverse diode over the LED array, in case there was an inductive spike shooting back up to the module and had nowhere to go.  Now, any such spike is routed back down the cable to Vin rail.

The diode didn't change the duplicate printing thing.

Again, this only happens when PWM is being used to change brightness of backlight LED to something between the extremes.

In case it matters: I am using a 6 wire connection for LCD: data4-7, RS and E connect to Arduino I/O pins.  RW is grounded at the Arduino side of the ribbon.  Data0-3, and pin3 contrast pins are essentially floating at the module.  They have ribbon cable attached all the way down to Arduino but are N/C there .  (The module has its own on-board pot for contrast adjusted just fine.)  The ribbon is about 4 feet long, flat not twisted pair, common2-row header connectors on each end.

..time to try some more things.
37  Forum 2005-2010 (read only) / Interfacing / Re: PWM chopped backlight confuses LCD on: March 10, 2010, 11:44:26 am
Thanks all...

1 kHz is not exactly RF range... but 150mA is a fair whop of juice so I guess it could be inductive coupling in the ribbon cable throwing in false bits on neighboring data lines.  

Separating the backlight lines from the data cable would probably help, maybe run the backlight power up a shielded cable?  There are A & K points to solder right at the backlight instead of running current through the module board traces and ribbon cable.

I like the idea of adding more decoupling caps at the module.   There are already a couple pretty hefty caps on the module, as far as SMT parts go... but adding 47uF to 100uF at the power input points near the DIL connector on the LCD module couldn't hurt.  

I wouldn't have thought to add a flyback diode over the transistor for an LED load, but maybe the cabling / length is acting as an inductor that is creating sharp spikes after the edges of the PWM square wave.


38  Forum 2005-2010 (read only) / Interfacing / Re: PWM chopped backlight confuses LCD on: March 09, 2010, 11:44:41 pm
What is the frequency of standard PWM (analogWrite) on a 16Mhz board?
39  Forum 2005-2010 (read only) / Interfacing / PWM chopped backlight confuses LCD on: March 09, 2010, 10:24:00 pm
To control LCD module backlight (LED) brightness, I use analogWrite on an Arduino pin connected to the gate of a 2n7000 mosfet to switch the LED cathode to ground.   The idea works well to control brightness, but....  the LCD will scramble within a minute whenever brightness is not turned full on, or full off.   It seems the frequency is creating noise and within a minute... the LCD display is taking a trip somewhere I didn't send it!

The module rates the backlight at 150mA, and came with simple dropping resistors for an anticipated 5 volt backlight supply.  I didn't want this 150mA load on the Arduino voltage regulator, so I changed the backlight resistance (increased it) to use Vin (12 volts) instead.  My resistance choice keeps LED current to about 150mA.  

So 12 volts runs up the standard 16 pin ribbon cable to the 2x8 layout connector at the LCD module.  The module drops the current with resistors there, runs through the LED backlight and back down the ribbon to the mosfet mounted back at the Arduino.  

What's a better layout?
40  Forum 2005-2010 (read only) / Interfacing / Re: 4 bit LCD connection only uses half of LCD on: February 03, 2010, 11:28:10 pm
Same issue, using the latest LCD library that comes with 017.

My little 16x1 display shows the first 8 chars of a string in the first 8 columns then characters in positions 41-48 of the string display in the last 8 columns of my display.  

LCD brand name "Truly m161-1a1"
other markings
MTC-C161DPRN-1N D0444
and happily passed QC by no.19

41  Forum 2005-2010 (read only) / Interfacing / Re: Potentiometer Value Reader Help on: April 26, 2010, 02:33:50 pm
What I've done in the past is "chop off" the extremes of the pot where they tend to get less linear, drop or rise in resistance suddenly, or seem flaky (jump up and down rather than progress in the intended direction).  And of course do a little "smoothing" in software - by taking many samples and average.

So, when you do an analog read, do a sum of 4 of them and then divide result by 4, if the value less than say 100, call it 100 and don't offer any more resolution in that direction.  And if it's greater than 900 call it 900.   Your pot can now effectively provide more reliable values but in a more limited sweep range.    

42  Forum 2005-2010 (read only) / Interfacing / Re: Temperature shutoff circuit on: April 29, 2010, 09:59:21 pm
Maybe you could strap a temperature sensitive switch to the side of it, if you can find one with the right trigger point.  Doesn't get simpler than that.
43  Forum 2005-2010 (read only) / Interfacing / Re: how to reinitialize LCD, after cycling its power? on: April 29, 2010, 03:01:03 pm
jrraines thanks, I just solved the problem by putting an extra lcd.begin() in the code for the version of library Ive got.  It works fine.  Whereas I thought I might have to cycle power on the LCD when it garbles, turns out I don't - it can stay powered all the time.  Just sending another lcd.begin() to it clears it up, repaint the display and continue life.
44  Forum 2005-2010 (read only) / Interfacing / Re: how to reinitialize LCD, after cycling its power? on: April 28, 2010, 08:35:50 am

I never knew that lcd.begin() reinit's the LCD module.

I will try cycling power on it, and just using lcd.begin to see if I can reestablish a healthy display.

I can't seem to find the LCDtest sketch example you talk about, there's

I've got the LCD library that comes with 0018.

Is this just a suckie version?  What version of library should I be using?   jrraines I see you are active in LCD land and an improver of libraries... need a recommendation.

45  Forum 2005-2010 (read only) / Interfacing / Re: how to reinitialize LCD, after cycling its power? on: April 27, 2010, 10:45:19 am
I think this is more of a software question than hardware interfacing.  The hardware works.  The LCD library works.  (The LCD module itself is a bit flaky sometimes.. but that's not Arduino's issue).

My situation has more to do with the way Arduino compiles and inserts code related to libraries and the instantiation of variables, and scope.  I'm stretching the limits of LCD library code structure from within setup() and loop()... so I've moved the discussion over to software interfacing.
Pages: 1 2 [3] 4 5