PCB prototype

Discussion in 'General Electronics Chat' started by Rylan, Dec 10, 2012.

  1. Rylan

    Thread Starter New Member

    Dec 10, 2012
    5
    0
    I am an electrician looking to build a prototype PCB for a small machine. I dont have a great deal of experience in electronics. It has about 10 inputs which are switches and buttons. It will need to control 5 motors which only draw a couple of amps at 12v. Three of which will need to operate in forward and reverse. I am looking to run off a 12 volt battery and use a microcontroller to operate it. My questions are what microcontroller would be best to use, what transistors should I use for control of the motors and whats the easiest way to build a pcb?

    If anyone can give me some advise or point me in the right direction your help would be greatly appreciated.
     
  2. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,871
    1,394
    Any microcontroller can be used assuming there are sufficient I/O pins. Most people choose a μC in a family that they are familiar with, and can program. Generally MOSFETs are used to control DC motors; the MOSFETs are chosen based on the μC voltage and the load requirements.

    There is no easy way to build a PCB. The easy way is to buy a PCB, (which still has to be designed.) But PCB's can be "home made;" look in the completed projects section of this forum for a post by Bill Marsden that describes in detail how he makes PCBs.

    I know that this doesn't provide the level of detail you would like, but your project sounds like a somewhat complicated project. There are people here who can and will help, but they will ask for complete details about the switches, the motors, and the environment.
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    I do a lot of PIC based microcontroller projects. I've posted some thoughts about how to get started here. I would strongly suggest you start with a development board for reasons I give in that post (short version: it will protect your sanity while making you more productive).

    The PICkit 3 kit has a very versatile board with enough general purpose pins to make sense all your buttons and switch all your motors.

    Before you make a PCB you should make a breadboard you can change if you do something that doesn't work. Heck, I do this for a living and I always make a breadboard before I make the PCB. The development board I suggest has areas made to add in other circuitry so it makes the core of your breadboard. You mostly just need to add your buttons and motor controls.

    That's one direction to go for the computer portion, it's the one I know best. Other people may have other suggestions.

    We would need more information on the motors before giving an opinion on how to run them.

    You've found a good place to present ideas and get back lots of opinions.

    And welcome to the forums!
     
  4. Rylan

    Thread Starter New Member

    Dec 10, 2012
    5
    0
    Ok thanks for the replies guys. I have a basic stamp discovery kit which I have been playing with but the IO pins are 5 volt and I will need to run 12v for the motors and I wont have quite enough IO pins. I can buy the bigger basic stamp with more IO pins if I have to. How could I connect the mofsets to the controller to get the fwd and reverse working. Or is there a 12v microcontroller I can use to make it simpler.
     
  5. Rylan

    Thread Starter New Member

    Dec 10, 2012
    5
    0
    maybe i should just use double pole double throw relays but I was thinking transistors would last longer
     
  6. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    Do any of the motors need speed control?
    What is the starting/stall current of the motors?
    How frequently do the motors have to start/stop?
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    I have an old Stamp somewhere in one of my junk boxes, it's a pretty good device. Mine was the one with the solderless breadboard on it. Did you know there's a PIC inside those? Anyway...

    There are no 12V micros, in fact the latest trend is to run off lower voltages like 3.3 volts max. Besides, you don't want to limit the motor to whatever (small) current a micro could give it.

    Transistors are probably the way to go, either just a simple driver for one direction, or a full H bridge for both directions.

    Now hopefully someone who's built a bunch of these for motor control will step in and direct you to some nice info. I've never run motors so I don't know what special problems they give.
     
  8. SPQR

    Member

    Nov 4, 2011
    379
    48
    I'll give you a beginner's perspective.
    I happen to like the Arduino system, and it has everything you need to put together a one-off.

    5 motors at 12 volts/2 amps (assume all go forward and reverse)
    10 inputs (switches/buttons)

    Arduino DUE - 54 digital I/O ports, will operate at 12V input
    4x4 driver shield - four dc motors, 5A at 30V for each one
    Another motor driver - again, hi current
    You could debounce your switches with Schmitt triggers.

    You probably would not need a PCB board, just put it together on a breadboard first, them move it over to prototype board.

    Robotics sites would be a good place to start
    Sparkfun
    Pololu Robotics
    Robot Shop
    Adafruit

    There are many different sites that have all the stuff you need to put your project together.

    The things I mentioned here all already "put together" and you just have to connect them to the Arduino.
     
  9. Rylan

    Thread Starter New Member

    Dec 10, 2012
    5
    0
    Ok this stuff is really helpful guys. i will find out the stall current of the motors. SPQR it says the the inputs for the audrino are 3.3v on that page but im assuming that it will handle the 12v? The inputs can be a lower voltage anyway if i can pick up 3.3v supply off the audrino. Will the power input to the audrino or PIC board run off 12V or do I need something to regulate the power supply?
     
  10. SPQR

    Member

    Nov 4, 2011
    379
    48
    NO! Holdup! Wait! Wait!

    The power to the Arduino is 7 to 35V - I tend to use a 9V wallwart only because they are easy to find, but also so I can power the device with a 9V battery if necessary.

    But your digital and analog inputs are voltage limited. The specs say 1-5V but I tend to keep things at TTL levels.

    Also, one of the things I almost always do is make sure that any digital line input comes out of another TTL/CMOS device like another chip, a Schmitt trigger, an AND/NAND/OR/NOR gate, or anything else you might consider useful in your circuit.

    I think I torched one of my early Arduinos by putting too much voltage on an input pin. It died an instantaneous, and painless death. RIP.

    You can run higher voltage stuff from an arduino, but it needs the help of another chip, or a transistor, or a MOSFET or a relay.
     
    Last edited: Dec 15, 2012
  11. Rylan

    Thread Starter New Member

    Dec 10, 2012
    5
    0
    Ok sorry i took so long to get back to you on the stall current of the motors. The biggest motor has a stall current of about 20 amps (a lot more than i thought!). Another 2 motors have a stall current of about 2 amps. These 3 motors need forward and reverse controls. Two more motors have a stall current of about 4 amps but these only need to go in the one direction and can be paralleled up of the one transistor. None of these motors need speed control at this stage. The motors will need to operate constantly for half an hour or more.
    So any diagrams or suggestions on how to hook this up with a microcontroller would be great
     
  12. panic mode

    Senior Member

    Oct 10, 2011
    1,321
    304
    if you don't need to change speed etc. you don't need H-bridge, just use pair of relays to switch polarity. if you do it right way there is no danger of shorting power supply (see attached) regardless what you do to drive the relays (turn on both FWD and REV at the same time). this requires use of C-form contacts.

    you can use automotive relays as they can handle large current. i usually go for DG20 from Durakool for their price and small size (although small they are rated 30A for DC loads).

    btw. your PCB should have heavier Cu or you should increase thickness of tracks by adding solder along the track length.

    and also, it could be good idea to add resistor and LED across each relay coil to know which one is on.

    diodes D1, D2 are flywheel diodes to protect transistors. you can add diodes around motor to reduce arcing on relay contacts (since motor is inductive load).
     
  13. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
Loading...