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.

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.

Click to expand...

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.

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.

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.

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?

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.

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

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).