Arduino PWM Signal and PCB Trace

Thread Starter

roarkhabegger

Joined Jul 18, 2017
3
Hello all!
I am working on getting a linear actuator to work, and when I have all the wiring going directly into the Arduino UNO R3 board everything works fine. However, I have a PCB (Printed Circuit Board) that I designed to help organize the excessive amount of wires going into the Arduino. Once I plug the PCB into the Arduino and start using it, the pin sending a PWM signal just gives a continuous output of high voltage, so the linear actuator never stops moving until hitting a hard limit. I am curious if I need to do something different about the trace on the PCB or some other part of the PCB specifically for the pin that is outputting the PWM. A wider trace? I did some reading on these forums about a 'base resistor' and if I need this, should it be a part of the PCB?

Thanks in advance
 

ebeowulf17

Joined Aug 12, 2014
3,307
Please share a schematic of how you're hooking everything up, image(s) of the pcb layout, and part number (or better yet, datasheet) for the linear actuator. Without knowing how you've got this all set up, it's hard for any of us to help you.

If I had to guess though, I'd check for mistakes in the pcb layout. If it works with wires, but not with a pcb, something's probably laid out wrong on the pcb... or perhaps soldered wrong (solder bridge between two pins, etc.)
 

Thread Starter

roarkhabegger

Joined Jul 18, 2017
3
Alright so I couldn't find datasheets on the linear actuator, but here is a link that has a specifications tab that should have all the information:
https://www.firgelliauto.com/products/mini-track-actuator
This linear actuator is connected to a Pololu Motor Driver (https://www.pololu.com/product/2992/specs) which is then connected to the PCB/Arduino. I've attached a jpeg of the PCB, where the top row of holes has pins soldered to them that plug into the Arduino, and the row of holes on the left of the board has headers soldered to them for the motor driver to be plugged in to.

@ebeowulf17 I looked over the soldering of each pin/header and that doesn't appear to be a problem (No bridges or cold joints, only thing is a couple of pins have more solder than I'd like). However you are right that the PCB might be completely laid out wrong, it's my first time making one from scratch.
 

Attachments

ebeowulf17

Joined Aug 12, 2014
3,307
Alright so I couldn't find datasheets on the linear actuator, but here is a link that has a specifications tab that should have all the information:
https://www.firgelliauto.com/products/mini-track-actuator
This linear actuator is connected to a Pololu Motor Driver (https://www.pololu.com/product/2992/specs) which is then connected to the PCB/Arduino. I've attached a jpeg of the PCB, where the top row of holes has pins soldered to them that plug into the Arduino, and the row of holes on the left of the board has headers soldered to them for the motor driver to be plugged in to.

@ebeowulf17 I looked over the soldering of each pin/header and that doesn't appear to be a problem (No bridges or cold joints, only thing is a couple of pins have more solder than I'd like). However you are right that the PCB might be completely laid out wrong, it's my first time making one from scratch.
There's nothing that jumps out at me as an obvious explanation for your problem. There are some general pcb layout guidelines that you should consider for future designs:
  1. Fat traces for anything moving significant current. If all of these traces are signal only, no power, then maybe a non-issue.
  2. Avoid acute angles where traces intersect. Use 90° tees where traces split. This has to do with manufacturing processes. I've heard it's less of an issue than it used to be, but that it's still good practice anyway.
  3. Keep top and bottom layer traces perpendicular to each other wherever feasible, particularly where they cross. Don't run traces directly on top of each other in the same direction. I believe this has to do with capacitive coupling.
To be honest, I don't see where any of these issues would effect your pwm output pin state. I'm at a loss.

Just to double check a few more things:
  • You didn't share pin assignments. I assume you've double (and triple) checked that each pin goes where it should?
  • Have you tried going back to the wired (non-pcb) configuration since the problem appeared? Any chance the problem is unrelated to the pcb and just coincidentally presented itself around the same time?
  • Are you sure the pwm pin is high all the time and that there isn't some other error driving the actuator? Have you measured (or better yet scoped) that pin, or just assuming it's at fault?
  • What are all those other connectors on your board?
Sorry for so many questions. I'm intrigued by your problem, but I'm at a total loss, so I'm just throwing out a variety of trouble shooting ideas.

As for a base resistor, I could be wrong, but I don't think that applies to your setup. If you were making your own motor driver circuit you'd need to consider such things, but I think the pololu part handles all that in your case.
 

dendad

Joined Feb 20, 2016
4,476
It is best not to branch traces if you can help it. When I do a board and have to branch the traces I always add a pad or feedthru at the joint. It looks better and reinforces it too. Sharp corners can cause problems with the PCB manufacturing and their cleaning off the etchant.
And there could be a potential problem under "IHWP" as the traces are very close together. I'd check there for a short.

Also, the "I" output looks to be from pin 7 and I don't think that has PWM capability. If that is the one running all the time, move it to pin 3 and change your code to suit.
PWM is on pins 3,5,6,9,10 and 11.
I got stuck on that at one time, trying to PWM a non PWMable pin. It took me ages to work it out!
But if it is just the header in the left "PWM" then I can't see a problem. make sure all your wiring is ok, and check out all the traces for continuity.

Good effort for a first board. This can be such fun.
My "normal" PCB error is to swap the power traces ;)
 
Last edited:

dendad

Joined Feb 20, 2016
4,476
Will the motor run if you do not have the Arduino plugged in? If so, that could be an indication of an open circuit between the motor driver board and the Arduino. The Arduino should keep the motor turned off until it is commanded to run. But if the motor will run with no input to the driver board (that is a bad design if it is so) then the driver board is not getting the control from the Arduino.
And another thought, the traces are very thin. They are easy to damage in production.
If you have etched the board yourself, check there has not been a fine scratch on the photoresist so the trace has a break in it .
That is why I mentioned checking continuity.

As a test, add an LED with series R to the PWM connector and see if that works.
LEDs are always a good idea to put on the boards.
 
Last edited:

Thread Starter

roarkhabegger

Joined Jul 18, 2017
3
Thank you all! I kept moving pins around and even re-soldered some of the connections, and now I'm getting correct readings on the pins. Motor still isn't doing what I want but I think it is probably a coding issue since it now acts the same in both the wired and PCB configuration.

One last question though: The red traces in the layout that all connect together are just the grounds for all the different signals leaving the arduino (each of the yellow rectangular boxes is actually an audio jack that I'm using to connect a switch to the arduino). Is it a problem that I connect them all together on the PCB? With the wired connection they all just end up going into the same ground pin on the arduino, but is there some reason I would not be able to do that, or just should not do that, on the PCB itself?

@ebeowulf17 I'm going to make a second board and adjust my layout accordingly to those rules, I didn't realize the traces running parallel to each other on opposite sides of the board would be a problem. Also, it took a quadruple check but I found I had the fault pin for the Pololu driver in the wrong spot, and while that didn't have anything to do with the PWM pin's output, thanks for making me check.

@dendad Yeah just the pin marked PWM needs a PWM signal, everything else is just a digital Read or Write. I've used an LED in testing before, but what do you mean Series R? Also that was good thinking to check if the motor would keep running with just the motor driver, luckily it doesn't move without the Arduino and that wasn't a problem.
 

dendad

Joined Feb 20, 2016
4,476
I've used an LED in testing before, but what do you mean Series R?
By a series R I mean including a suitable current limiting resistor in line with the LED. Just putting an LED on the port pin is not a good way to go. LEDs should always be used with a series resistor, although you can get away with it in some instances.
And it is ok to run the ground trace around the board from one pin. You could also have them to more than one pin if you like. I'd use more than one ground pi myself, and have bigger traces too, but I've seen a great many boards working ok with thin traces everywhere.
I hope you get it going ok.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Thank you all! I kept moving pins around and even re-soldered some of the connections, and now I'm getting correct readings on the pins. Motor still isn't doing what I want but I think it is probably a coding issue since it now acts the same in both the wired and PCB configuration.

One last question though: The red traces in the layout that all connect together are just the grounds for all the different signals leaving the arduino (each of the yellow rectangular boxes is actually an audio jack that I'm using to connect a switch to the arduino). Is it a problem that I connect them all together on the PCB? With the wired connection they all just end up going into the same ground pin on the arduino, but is there some reason I would not be able to do that, or just should not do that, on the PCB itself?

@ebeowulf17 I'm going to make a second board and adjust my layout accordingly to those rules, I didn't realize the traces running parallel to each other on opposite sides of the board would be a problem. Also, it took a quadruple check but I found I had the fault pin for the Pololu driver in the wrong spot, and while that didn't have anything to do with the PWM pin's output, thanks for making me check.

@dendad Yeah just the pin marked PWM needs a PWM signal, everything else is just a digital Read or Write. I've used an LED in testing before, but what do you mean Series R? Also that was good thinking to check if the motor would keep running with just the motor driver, luckily it doesn't move without the Arduino and that wasn't a problem.
I'm glad to hear it's closer to working now. Good luck with the coding!

As for PCB layout concerns, I should say that I'm still very much a novice, learning all the time. Don't take any of my advice as final or comprehensive without verifying elsewhere. With that out of the way...
  • Shared ground connections on the PCB are great! I would probably go extra wide for good measure. Avoid making ground loops (I think you're fine so far) and maybe even consider a ground plane if you feel like learning a new topic. If not, no worries.
  • Given that you've got negligible current and low voltage in all of your traces, and that only one trace has any high frequency switching, I think you have nothing to worry about in terms of parallel trace coupling. Still, never to early to develop good habits!
Good luck and have fun!
 
Top