7
\$\begingroup\$

I don't know whether this is the correct forum to ask this question. And knowing Stackexchange I know that this question might be downvoted and closed for being too broad. I just want to make sure I tried everything and sometimes someone in this group has done something similar and might be able to help.

My background : I am a developer and during my free time I used to dabble in electronics. I have created many circuits with Arduino and Raspberry. Recently I created an IoT setup with some 9 sensors, all of them sending data to a server where lot of visualizations and analytics are done on the data.

After the IoT project, my employer asked me to replace the Arduino I have used with a custom built board(By custom built, they want a board which I have designed and not replacing arduino with a beaglebone). The board should have a microcontroller, battery, Wifi module and some sensors.

Since microcontroller is the main component in a circuit, I thought I will start with finalizing the microcontroller. Following are the steps I have followed :

  1. Read wiki page of Arduino's ATMega328P I didn't understand a single word of the specifications in the wiki page
  2. Tried to read the datasheet of ATMega328P I didn't understand a single word of this document either.
  3. Check the schematic diagram of Arduino Uno I could understand some of the connections and co-relate it with the datasheet. But I still couldn't understand why there would be a 1K resistor instead of a 2K resistor. I think that knowledge is required for designing a board.
  4. Google how to select a microcontroller. This did give me some ideas. But I could not even complete the first step of this link. I could not complete because I don't know what I2C or SPI etc are.
  5. I asked my colleagues. They don't know.

  6. Finally I decided to start learning electronics from the basics and came across a suggestion to read the book "The Art of Electronics" in this forum

Asked by @Transistor in the comments

Can you edit your post to explain what the advantage is for the employer? Is it, for example, that the prototype is a bit messy and amateurish looking and a PCB would tidy it up? Are you going to sell many devices, etc. Is cost an issue? Does it need a case? Domestic / commercial / industrial application?

The advantages for the employer

  • The current design is messy(because of the breadboard) and the pin connection might come off

  • No built in battery for arduino. So power cables had to be provided for each arduino. So new design should have built in battery.

  • The board, breadboard together take some space. They want a compact item.

  • No professional support for arduino boards.

Cost is not an issue.The design won't be sold mostly, but will be used within the organisation. The design should have a case. And it will be used for industrial purposes.

tl;dr -> Is there a way a dummy in electronics can create a microcontroller circuit board? Any suggestions are welcome.

\$\endgroup\$

closed as too broad by DoxyLover, Leon Heller, Dmitry Grigoryev, PlasmaHH, Daniel Grillo Sep 22 '16 at 11:21

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 8
    \$\begingroup\$ Your employer is asking you to produce a board, knowing that you have no significant electronics experience? That is asking for trouble. There are so many things involved in creating a good functioning board. You might get lucky and produce a board that works, but not reliably. Your first board might work but the next 3 might not because the design is marginal. In addition, if the board doesn't work, how are you going to debug it at your level of knowledge? This whole thing is a bad idea. \$\endgroup\$ – DoxyLover Sep 22 '16 at 6:06
  • \$\begingroup\$ Yes, a "dummy" can easily clone an Arduino board. The schematics are out there. Art of Electronics is a great book - nothing in it is required to copy an ATMega328P example circuit. \$\endgroup\$ – pipe Sep 22 '16 at 6:11
  • \$\begingroup\$ @DoxyLover Ya I know it is a bad idea. I tried to make sure the idea of creating a custom board was dropped. But that didn't happen. So I am stuck with this. \$\endgroup\$ – Jitin Kodian Sep 22 '16 at 6:12
  • 1
    \$\begingroup\$ Can you edit your post to explain what the advantage is for the employer? Is it, for example, that the prototype is a bit messy and amateurish looking and a PCB would tidy it up? Are you going to sell many devices, etc. Is cost an issue? Does it need a case? Domestic / commercial / industrial application? \$\endgroup\$ – Transistor Sep 22 '16 at 6:49
  • 1
    \$\begingroup\$ @JitinKodian: OK. Better. But what I said still applies. Create a motherboard (replicate your breadboard) first. Arduinos (or compatible modules) are cheap when you buy them in bulk. Doing it will give you the experience to be more confident when designing future PCBs. Use modules first. When you are shipping volume (think 10k units) then it makes sense to start designing those modules yourself. Even if it never actually goes into production at least you'll get a clear idea of the process. Like writing code, do one small thing at a time to be confident you're not debugging the wrong thing. \$\endgroup\$ – slebetman Sep 22 '16 at 10:20
7
\$\begingroup\$

So lets say your project consists of Arduino, a power supply, few sensors and the code that you burnt. Right now these are wired up using jumper cables and you want to put them on a PCB.

Start with understanding the circuit of Arduino UNO and then PCB circuit that will give you same functionality as the Arduino UNO board. This page will help you with that: https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

Don't bother about switching to a new micro-controller right now. There are enough items on your plate. Follow that article. You should be done with first two sub-topics: (1) Burning the Bootloader and (2) Uploading using an arduino board. You can go further if you are able to understand what you are reading/doing, otherwise stop there.

Once you have the bootloader burned and you are able to upload the code, its time to figure out the pin mappings between arduino and atmega328p, which is like this:

Arduino Pin Mapping

Now, you can go ahead and try blinky sketch. You need to add an LED to D13 i.e. pin 19 of atmega328 with a current limiting resistor (470 ohms will suffice). If your sketch is uploading and working, then you can go ahead with hooking up sensors and wifi module and program accordingly. Once you have everything working on breadboard, you can convert it to PCB now. you just need to convert wires into traces. At this point you will notice that your circuit is way smaller than what it was with arduino UNO board. The reason being Arduino UNO having a lot of extra circuit which you don't need for all projects.

Once your circuit is working, you need to figure out a way to power it up. You might want to look into voltage regulator circuits because you will not find a 5V battery which you can directly connect to your project.

To convert this to PCB, you need to select any PCB designing software. I have worked with eagle and I think that its easy for beginners. There are many tutorials available online which you can refer to. Here are two nice ones by sparkfun:

https://learn.sparkfun.com/tutorials/using-eagle-schematic

https://learn.sparkfun.com/tutorials/using-eagle-board-layout

\$\endgroup\$
8
\$\begingroup\$

"Is there a way a dummy in electronics can create a microcontroller circuit board?"

  • Not quickly.

I really love your interest and desire to take this on. I seriously do applaud your interest and your desire, as well as your willingness to lay it out and just ask.

I will tell you, having nearly caused my copy of the 2nd edition of "The Art of Electronics" to fall to pieces (and it is a well bound hard copy, too... or was), that as good as the book is (and it is good), it is NOT for you at your level right now. You'd just beat your head in the ground with it. That said, I'd recommend getting a copy anyway. You will want it, someday. (And the authors will not live to produce a 4th edition, so buying the 3rd edition is safe.) If you do buy it, look for the Student Manual for the 2nd edition (and if there is one for the 3rd edition -- you can hope), get it. The Student manual is a BIG HELP and I highly recommend it, if you are going to struggle with the excellent AofE book.

Don Lancaster used to write some excellent tutorials on microcontrollers and memory, but the book pair (two volume set) is a bit dated now. But you could learn from it, for sure, even today.

But let's look at what's in front of you:

  1. Power supply design. You can cheap out on this by just buying power supplies, wall warts, and the like. But nothing is going to protect you from needing to understand the meaning of voltage and current compliance and the possibility of shorting things out if you don't understand what various terms mean and how they are used. And you won't be able to take advantage of some really cheap buck or boost modules from ebay, either, if you can't figure out what the specs mean. You just need to understand the ideas of a shared common, voltage, current, power, ripple, issues related to connecting one system using one power supply to another system using a different power supply, how long it takes a power supply to come up to full operation, and a few other things I'm too lazy to add right now. And it can be very detailed, if you actually try and design a simple, basic one on your own. It's surprising just how much a very simple idea can involve, when you get serious about it.
  2. Power-on reset. One thing I mentioned above is that a power supply can take a while to come to full operation. Some microcontrollers can do some really crazy-minded things if the power supply comes up too slowly. There are ideas you can use to solve it, holding the microcontroller into some fancy "reset mode" until the power supply comes up, properly. But you might have to design one of these. They aren't complicated and there are specialized ICs you can buy, too. But it's just another issue to know about. You can't just always assume everything starts up okay because you applied a power circuit to it.
  3. Clock. You've got power and you've got the micro held at bay until the power is ready. What else? Well, it needs a clock. Some micros have internal clocks. Some micros only support external ones. Some external ones can be handled using a module for the purpose. Others, have to be carefully crafted either for parallel-cut or series-cut crystals. Don't know what those are? You might need to. And if it has an internal clock, it might have several. An MSP430, some of them, will have a VLO, an RC, and a DCO internal clock. Plus the ability to support one or two external crystal clock sources, as well. Do you have any clue how to manage all that?
  4. Program. Okay. By the time you have power, a proper reset, and a clock, you are getting close. If only there was a program in the micro, it might run. But ... how do you get the program in there? A board design may require a method by which you can download programs. And a method, perhaps still different, to allow you to debug those programs, too. JTAG? Heard of it? You might need to. Or various methods to develop sufficient voltages internally (or externally) to program one? There are dozens of ways this happens. Some of them require a fair comfort with electronics. Some don't.

You mentioned you cannot even begin to read a datasheet. So this means you need some help from someone who can walk you through these things. Or you need to take some time to study and think and let ideas settle in. Best would be to find a local group of people who are interested in helping you get started along your journey. So I'd probably first recommend something like that. A robot society, for example, might be one way. There are meetup groups in many local areas, which may bring talented people close to you. I think that's the best way to start out these days. Perhaps a group focused on making 3D printers (which involve micros) or ... well, something like that.

Do it. Really. You can pick this stuff up and get really good at it. But allow yourself some time and try and make a few contacts, if possible, locally. You need access to the minds of people who can interact with you and hear what you are missing and respond to that with descriptions that address your misconceptions as you go along.

Regardless of any or all of that, DEFINITELY get yourself a decent book on DC electronics -- I'd recommend looking for a textbook, as they will cover DC, AC, mesh and nodal analysis, and a few other basics you really need. And get a good one on bipolar transistors. (Mosfets are almost too easy, so you can pick that up from the people you meet.) And yes, get the 3rd edition of AofE. But just don't expect it to be a cakewalk. It's more a wonderful collage of interesting ideas, which inspire you in various directions, expose you to intriguing ways of doing things, and otherwise just make a lot of sense. But only if you have the basics down.

\$\endgroup\$
  • \$\begingroup\$ Thanks for the answer. Do you have any recommendations for the book? \$\endgroup\$ – Jitin Kodian Sep 22 '16 at 6:39
  • \$\begingroup\$ I will start with @Whiskeyjack's answer and follow it up with your suggestions. Since I am below 10 rep, I can't upvote the answers \$\endgroup\$ – Jitin Kodian Sep 22 '16 at 6:55
  • \$\begingroup\$ @JitinKodian No. Not right now. I do remember that my son took some electronics classes and that their textbook was excellent. Really quite good. But there probably are better, out there. AARL has a handbook that is cheap and does help a lot. Try out this web site, too: arrl.org/first-steps-in-radio \$\endgroup\$ – jonk Sep 22 '16 at 6:55
  • \$\begingroup\$ @JitinKodian I liked his answer and upped him. Good choice. \$\endgroup\$ – jonk Sep 22 '16 at 6:56
  • \$\begingroup\$ @jitin - In long run, you will find use of each and every thing Jonk has written here. What I wrote is a hacky way to get you up and running quickly. However that will take you only to a certain extent. Also, I have not detailed each and every part because it was getting too lengthy so feel free to comment and ask if you are stuck somewhere. \$\endgroup\$ – Whiskeyjack Sep 22 '16 at 9:38
3
\$\begingroup\$

One point not mentioned so far is that in addition to basic electronics knowledge, you'll also need to know how to use PCB CAD programs and get the knowledge of the design flow for hardware. Many beginners start out with Eagle and you'll find lots of tutorials for it. I personally started out with KiCAD, which is, unlike Eagle, free software. Both are available for major operating systems. There's a nice non-overwhelming tutorial series for Eagle on Sparkfun.

In general, the PCB programs are divided into at least two "sections": The schematic, where you place the components and connect them on paper, and the layout, where you actually specify the dimensions of your real PCB, then place the components on the real PCB, route traces, so that components are connected and so on. Both sides come with their own issues. For example, you'll often need to create parts that are not in the software's library. So you'll need to draw the schematic representation, then you'll need to create a footprint for the layout part of the software etc. You'll need to learn about the drill sizes for different types of pins, about the pad types and sizes for different type of SMD components and so on.

You'll need to both learn how to make a clear and easy to read schematic and then how to translate that schematic from paper (or well, computer screen) onto real PCB layout that also works as well.

Fortunately, if you're only working with relatively slow AVR microcontrollers, you most likely won't have much of high-frequency problems that can be encountered in more complicated circuits.

Then there's the mechanical side. You'll need to see what sizes of PCBs you can easily have manufactured, how much board space you need, how much board layers you need. Then, you'll need to find PCB housings that are suitable for PCB sizes that you can find, then make sure that they can all actually fit together properly. You'll also need to find someone willing to manufacture the boards for you (or make your own, if you have enough time), then, when you have the boards, you'll need to populate them with components, or find someone who will do that for you. You'll need to test the boards out, to be sure that they're working and for that, you'll need to make a test plan.

Then, on the yet another side of the story is the support equipment you'll need to have all of this running. The AVR microcontrollers you get from a normal parts distributor won't have Arduino bootloader installed, so you'll need a programmer to burn the bootloader. Should you have any issues, you'll need an oscilloscope or a logic analyzer to debug the issues.

All in all, don't underestimate the problem. It can easily take many months until you actually produce a good simple device. Also don't expect everything to work at the first attempt. You'll most likely need to make several PCBs until you fix all the issues. Be sure to plan and expect that.

\$\endgroup\$
1
\$\begingroup\$

Design a custom mainboard, rather than a from the ground up micro controller based design.

A compromise that should hopefully find a middle ground between what the powers that be want and what you can realistically achieve whilst also satisfying most if not all of your goals.

There are advantages in that something like an Arduino is a known quantity. There is strong community support and information available with a well known and widely available design with many compatible off the shelf products.

With a main board in essence, you are transferring what you are doing with breadboard onto a PCB.

Here is an example:

enter image description here

That could be several PCBs and associated wiring on a breadboard.

It has a socketed Arduino Micro for the uC.

Power supply is at the bottom corner with DC barrel and terminal block with various components. There are 2 relays and associated terminals on the left side and a few more ICs and other components with the terminal block on the right.

You have the ability to design for the motherboard to be as custom as you like with built in functionality or make it modular and use off the shelf assembled boards for most if not all functions.

If you socket modular pieces replacement or upgrade is much easier, so too is troubleshooting.

In the image you can also see they have headers both sides of the uC that both allow troubleshooting and expansion or modification of the circuit.

For something like the power supply where such a design may be beyond your current abilities you can get various DC-DC converters on a small board or packaged with the need for no or minimal external components, also that section could be made modular as well as and use off the shelf assemblies which are available with battery management.

Housing wise there are various options, typically extruded metal housings may have slots or other case styles have standoffs or screw holes in the base. You can design your board to fit the case perfectly and have it machined to suit if you go with board mount connectors. Like so:

enter image description here

The hardest part will be PCB layout and making sure everything physically fits correctly, part layouts are correct and suit your case.

Your layout should be done as best practices but for the most part transferring a previously air wired breadboard circuit such as what you have now shouldn't be impossible for a beginner to achieve on a PCB.

A final positive is the board itself should be fairly cheap, there are a wide variety of low volume fabs to use for PCB manufacturing. If kept to through hole and certain packages and larger sizes of SMD it should also be easy enough for yourself or others to populate if required.

Hope this helps.

Edit: Have tried to restructure my answer so have removed some info and ideas for the sake of clarity. Also slebetman came up with the same idea up in the comments.

\$\endgroup\$
  • \$\begingroup\$ This would have been my proposal (I think), but I find your answer really unclear. Wall of text, without any introduction. I think you are proposing a custom motherboard, with modules for the MCU, and any other 'complex' parts. If so, you should say that first (not 'here is a compromise solution') \$\endgroup\$ – Sean Houlihane Sep 22 '16 at 11:05
  • \$\begingroup\$ Need some vague waffling to balance out all the precision and clearness around here. That is essentially it, will try and tidy it up a little. Fair point. \$\endgroup\$ – D-on Sep 22 '16 at 11:16
  • \$\begingroup\$ This hardly makes sense for an Arduino as the procesor is smaller and easier to fit into a custom design than a miniature board version. If the USB-serial functionality is needed and has to be on board rather than as a smart cable that might barely tip the balance. But these modular boards tend to be large and expensive to manufacture (especially a few) compared to just integrating the processor. Their real justification is when circuitry surrounding a processor, fpga, or RF part requires more than 2 layers, lots of passives, and top-notch design skills. \$\endgroup\$ – Chris Stratton Sep 22 '16 at 14:25
  • \$\begingroup\$ An Arduino Micro is $10US, clones are even cheaper. The approach I suggested does have drawbacks however I feel it is the option that fits within his current abilities, whilst being fairly cost effective and flexible. Integrating the uC is beyond him at the minute and there are advantages in being able to remove the whole board such as dropping in a different uC entirely if he so chooses or remove it for prototyping, to use in other projects or even his new board revision. Onboard USB, ICSP, reset button and Tx/Rx leds are added bang for buck he doesn't have to put on his board. \$\endgroup\$ – D-on Sep 23 '16 at 10:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.