Why arduino due are so fragile ? Power and pin protection good practice

Hi guys,
Sorry for my karma, still I would like to ask a question. I m builiding a robot for street theater

I can more or less do what I want, move and speak. I can move in the streets but at some moment my arduino due burn (after when I try to reuploading the code, the board is recognized but it says port not connected or simply the led lights a second or two and then go black)
I don't think that comes form the code, but here it is :

I already burned around 10 arduino due, and it start to be a bit costly.

I suspect that I have power peaks from my motor driver, it seems that I already burned so output pins with my led matrix also.

So the question is, what would be the way to protect better power supply and output pins ?

Thanks a lot

How is the Arduino powered in that contraption ?

Properly engineer your project. It looks like a mess that has evolved bit by bit without very deliberate planning or careful engineering. I'm sorry I'm being so blunt about this, but electrical engineering is a profession that requires specialist knowledge and training for a good reason. Arduino c.s. have made things easier for many of us, but this has not changed the laws of physics.

If you want to start solving this, a good start would be to post a full schematic of your project.
Alternatively / parallel to this, isolate different parts of the system and validate them separately and solve any issues you run into. For instance, you're having worries about the motor drivers (with good reason, I suspect), so you'd isolate those and work on them until they don't show any unintended behavior anymore (including the generation of voltage peaks etc.)

It is powered with a 36V battery, converter twice.
First 36V->24V (power the motors) and then 24V -> 12V
The 12V is used for arduino.

HI Koraks, thanks for you fast response.
I m affraid I must disagree with you. I understand that engineering is a profession but when you don't know a domain, you must dig by yourself, and there is little chance that you start with a careful engineering plan.
It is my first project, and before to run, you have to learn to stand and to walk right ?
You can't make a profession of every hobbies right ? or this is the end of DIY.
This said, I understand that is it too messy, it become hard to go forward, that why I started to make pcb plan with a friend :
here is the link : Didier - EasyEDA open source hardware lab
This version is not including the protection that I m looking for in this post

I'm not saying you shouldn't be doing this. You asked why Arduino's are so 'fragile'. They're not, but they won't withstand endless abuse. The reason why they go belly-up on you is because you abuse them. I don't blame you for it, but I simply point out that it happens because you don't know what you're doing. Nothing wrong with that. If you want to solve this, you'll have to learn. I don't think we disagree on this.

Nice work on the PCB, but can you show how you have currently wired everything together in a schematic? Please post a picture here. It's OK if it's drawn by hand. You intend to add protection, but then we need to know first which parts you have connected in which way, which in turn will allow us to spot the possible modes of failure, and then we can advise on how to solve that.

Thanks koraks,
Sorry I react like a child sometimes. Those plan was design with eagle and imported in to easyeda, but I have problem with symbolic net import.
I ll do a simplified schematic for this topic

Yeah, perhaps break the schematic up into different parts, and start with the part that shows how the Arduino is connected with the motor(s) and the power supplies. That should get us started.

Never grow up! Being an adult is boring.

Arduino boards in general have no "real" world protection. The I/O pins are particularly susceptible to voltage spikes in excess of the 3.3V supply.

However the biggest culprit is the lack of a "solid" ground. I suggest your start with your grounds. In the ideal case all DC powered devices should share a single ground "POINT". A shorting busbar like you find in a mains breaker panel for the neutral wire, might be a good method of making sure all the grounds are at the same potential.

1 Like

That 12V (esp. via the barrel jack) is not inconsequential.

Shouldn't be a problem.
The Due has a switching DC/DC (buck) converter.
Leo..

Hi JohnRob, all the card are ground connected.
The future card will be better grounded (surrunded by ground)

Hi, here is a little simply schematic of the current wiring.

schema.pdf

I m not sure if the problems comes from the power because there is also 3 mega and 1 uno that works without problems.

Sorry that’s not a schematic - you need a drawn diagram showing where each wire is connected .

I used to have similar problem, disconnect batteries while uploading

The issue your are experiencing is not due to miswiring but of voltage spikes and pickup on the wires you have. Putting a ground "ring" around you board will not be effective.

Are you taking the power for your uno & mega's from the DUE?

You need to section off the area shown below.

  1. Have one ground point where they exit that area. By ground point I mean a single point like a ground stud or at minimum a terminal strip where all connections are ground.

  2. Have the 12V power input protected by a series diode, 0.1µF to ground (the above ground point.

  3. every input must have a 0.1µF to ground and before that a 5k to 10k resistor.

  4. you PWM & digital outputs need to be protected as well but without knowing what they are driving I cannot make a recommendation.

All the wiring for this section must be contained in that area and not be intermixed with wires from the power stages. They should also enter and leave in one bundle.

Brief look at your code, didn’t have to go beyond .ino You define radio array as

char radio[1]

that’s it ONE element array, but in the code you try to access 2nd and 3rd elements. Maybe there is hope and you just corrupt your DUEs with the horrible code

Hi @hammy ,
Thanks for the replay, I know that it is still not a complete shematic, but would this be better ?

@killzone_kid ,
Whoua, that's a really good one, I changed this value by mistake I guess.
But I hope that bad access memory don't kill board right ?

@JohnRob
Thanks a lot John, that's the kind of advices I m looking for to improve my design.
All the board are connected to each other and to the 12V convertor. Is this bad ?
Would condensor and transistor be a solution to stabilise the current too ?
There are 3 pwm for led matrix, it works like led strip for the face expression. And 2 pwm for the wheels, right and left.

Once you leave the world or automotive, condensers become capacitors :slight_smile:

Having all the Arduino boards on 12V is fine. You should have a series diode 1N4001, 1N4004 which is not critical. Then a 0.1µF capacitor to the common ground.

You will have to be more specific on what the PWM's are powering. Are they directly powering LEDs? If so what are the leds and what series resistor.

If by"....Would condensor and transistor be a solution to stabilise the current too..." you mean would adding a transistor to power the LEDs instead of the output of the DUE then probably.
I would suggest you use a MosFet instead of a transistor (they are just better parts). I suggest you open another thread and ask for which Mosfet to use. There are literally thousands out there and I haven't researched them lately. I suggest a MosFet that will easily handle 10 to 20 amps. Why so high? Future use and the cost vs amperage is very low. I suggest you get some extras as they are always handy to have.

Thanks a lot @JohnRob ,
I push it a little for a last drop, because I think my due are killed because of bad things with output.
I tried to power it with a 9V so I separated for the rest, but it still dies ...

I have 3 pwm for led matrix like that 2 matrix for the eyes and a bolock of 6 for the mouth controled with Adafruit_NeoMatrix.h
The matrix are 5V powered from a converstisor from the 36V battery.

The wheels are controled by 2 pwm and 2 digital output. The 2 pwm for the speed, the 2 digital to control the sense of whell rotation, they are simply controlled with code like :
analogWrite(pwm_left, speedleft);
analogWrite(pwm_right, speedright);
It is a driver from cytron : 60Amp 7V-45V SmartDrive DC Motor Driver (2 Channels)

Thanks for the help