Power problem using ethernet shield + motor

Hi all,

Here is my problem: I have an arduino duemillanove board + an arduino ethernet shield. If I'm using a 9V battery to power on everything is ok. The ethernet board is attached to a router and i can run the Hello Word example in a web browser.

I'm made a simple shield to control a DC motor using L298N (H Bridge) when attaching this shield to arduino board everything works ok. The Arduino board is powered from a 9v battery and the IC l298N from 4x1.5v and it's ok.

Now came the problem if am stacking both shields(ethernet+motor) when all are connected to computer using usb cable everything is ok, i can control the motor using the web interface. If I'm using the 9v external power for Arduino board is not working (from router i see there is no activity on the ethernet plug). I've increase the input power using an external AC-DC adaptor of 12v 1000mA, still not working.

Any clues why this happening?

It's probably something obvious.

A couple obvious things: - Are you using a good 9V battery? - Are you taking into account the lower current available from a regular 9V battery? A 9V isn't likely to provide as many mA as a USB port

Hi,

I've also try to power the arduino board from a 220V AC adaptor to 9-15V DC with 1000mA and is the same.

If i don't stack the shield it's working ok without computer, if i'm stuck them works only when usb cable is plugged in.

Maybe you have some sugestion on how to debug? I was thinking to connect a led and to power it on different stages of the program to see where is the stuck.

I'd bet it has something to do with current.

One more obvious thing: - Does the Arduino run off batteries at all? The 7805 is supposed to be good to 750mA, and peak at 1.5A, but maybe you have a bum 7805 regulator on your Duemillanove.

The next thing I'd try is another 5V-power source, bypassing the regulator on the Duemillanove. If you have a PC, you could use the 5V rail inside it.

Do you have an ammeter? Putting an ammeter in-line with USB power would be tricky, but if you could manage it, that would be helpful in knowing how much power is being used when everything is working. This could rule out undercurrent as the problem.

Most multimeters have an ammeter, but to measure a full Amp you normally have to plug the leads into the "10A" plugs.

One more obvious thing:

  • Does the Arduino run off batteries at all? Yes run perfectly but not with both shield used in the same time, even they are both stuck.

I'll make more test and I'll update then this thread

I have a couple kits from Solarbotics with 298s which are great for the price. The weird pin-spacing on the 298 make them a bit of a pain to use directly. I got them from http://www.robotshop.us/solarbotics-l298-motor-driver-kit-3.html

What boards are you using with 298s? Something completely original or something you bought?

It's one made by myself. Actualy it's a board with the exact size of arduino containing only the L298 integrate, without any other components. Works ok with Tamiya twin gearbox.

I've made the following connection from L298: - PIN1 (Current Sensing A) + PIN15 (Current Sensing B) + PIN8(GND) --> power - - PIN4 (Supply Voltage Vs) --> power + - PIN2 (Output 1) --> motor1 wire 1 - PIN3 (Output 2) --> motor1 wire 2 - PIN13 (Output 3) --> motor2 wire 1 - PIN14 (Output 4) --> motor2 wire 2 - PIN9 (Logic Supply Voltage Vss) –->arduino 5V - PIN8 (GND) –-> arduino GND - PIN5 (Input 1) –-> arduino digital output 2 - PIN7 (Input 2) –-> arduino digital output 4 - PIN6 (Enable A) –-> arduino digital output 3(PWM) - PIN10 (Input 3) –-> arduino digital output 7 - PIN12 (Input 4) –-> arduino digital output 8 - PIN11 (Enable B) –-> arduino digital output 6(PWM)

Nice, but you really should have diodes to shunt back-EMF from the motors. I don't know how long a 298 will last without diodes.

I have a bunch of L293D chips because they have built-in diodes and are easier to use with breadboards, but they can only handle a couple hundred mA.

http://www.modularcircuits.com/h-bridge_secrets1.htm gives a good explanation of why diodes probably shouldn't be left out. The L298 is a BJT/bipolar type h-bridge.

There’s your problem, you’re trying to use the Ethernet pins for driving motors!

Arduino uses digital pins 10, 11, 12, and 13 (SPI) to communicate with the W5100 on the ethernet shield. These pins cannot be used for general i/o.

http://arduino.cc/en/Main/ArduinoEthernetShield

I'm not using any of those pins from arduino check my post.

PINxx means pins from L298D arduino pin xx means digital pin from arduino

Please note the circuit works perfect with both shields when power from usb cable, the problem is after disconnecting that cable, even i plug a AC-DC adaptor with 9-12v DC and 1000mA.

I'll make more test and let you know the results...

Opps, you're right, guess I didn't look close enough!

Did you try adding the LED yet to find where in your program it is stopping?

Hi all,

I've found out an interesting thing:

CASE #1 Arduino board connected to a 9v battery and also to usb cable Ethernet shield stack over and connected to a router My own motor shield with L298N + 5v voltage regulator connected to a 9v battey I'm uploading the program, everything is ok, the Ethernet shield is connected to router. I'm unplugging the USB cable, let the arduino board run just on battery and surprise: IT WORKS very well

CASE #2 The same as case #1, but when unplug the battery from arduino and plug it back it doesn't work, seems that the Ethernet shield is doesn't connect anymore

Seems that as soon as i don't have power on Arduino the program erase from memory. but If I'm using the boards separate it works very well.

So my question is has anyone else found something similar? I have to mention the problem is even i don't use batteries and I'm using a AC-DC convertor with 12v 1000mA

could be a brown-out problem http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1218505929, brown-outs can do a lot of damage.

The Arduino fuses set a default brown-out level of 2.7V, but there is a 4.3V setting.


I really don't know, brown-outs don't explain everything, but it's still something that may fix the program erase/corruption.

Its worth checking to see if the regulator is running too hot when using the external power source (either the battery or the external regulator) with everything connected up . Can you touch the regulator (the three legged chip next to the external power jack) with the shield on to see if it feels very hot when using the battery or external power. You should be able to comfortably hold your finger on it.

If you haven't already, you really should add the extra circuitry needed by the L298. http://letsmakerobots.com/node/7005

Still not working.

I have the following in boards.txt:

atmega328.bootloader.low_fuses=0xFF atmega328.bootloader.high_fuses=0xDA

so i've change the high_fuses to 0xDC but the same result, even if i've uploaded again the program

Except the diodes i have the rest on the L298N circuit. The problem is with ethernet shield

I've made extra check and seems that the Arduino Ethernet Shield is not connected to router when running from 9v battery. So this is the problem, i've try with the helloworld example from ehternet, and when arduino is battery powered it doesn't work. The power led from Ethernet Shield is on, but network leds (RX, TX, COLL, 100M, LINK and FULLD are all off)

Setting fuses must be done with a real AVR programmer (at least as far as I know).

The official Atmel way is to use a AVR-ISP mkII and AVR Studio.

If you have two arduinos, you can use MegaISP to make one arduino emulate a mkII. http://www.arduino.cc/playground/Code/MegaISP

You can use the x3 port and some special software for the FTDI chip. http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

I'm on a Mac, so I use avrdude, megaisp, and an arduino with it's auto-reset feature disabled.

Well, i'm on mac too, but i prefer first to find out if others successfully used an arduino ethernet shield by powering the arduino board from battery, without modifying anything in the boards.txt

Finally i solve it.

The solution was to press the reset button from arduino ethernet shield everytime i plug the battery.

Everything works ok now from battery, i'm just curious if others found the same issue.