Mastering Arduino
上QQ阅读APP看书,第一时间看更新

Four building blocks of an electronic project

In Chapter 2Basic Electronics, we discussed the four building blocks of an electronic project. The following diagram shows these four blocks:

It is really easy to break a simple prototype, like a circuit to turn an LED on and off, into the individual blocks but for more complex projects it becomes harder because of the different components.

By separating the components into the different blocks, it becomes easier to see how to break a larger project into separate prototypes. For example, if we wanted to create an autonomous robot we could see that one of the inputs is a sonic rangefinder that will detect obstacles in front of the robot, while the output that will be affected by the input from the rangefinder would be the motors that move the robot. In this example, we would probably want to change the direction of the motors if the rangefinders detect an obstacle in front. We could then create a prototype to test how this particular system worked.

In this step, we are defining what the inputs and outputs are and what outputs are trigger based on these inputs. This is also where we define most of the logic for the project, so we can set up the prototypes.

When you first start building these projects, you will want to create a diagram for each project. Once you gain experience, for most smaller to medium projects, you will not need to write anything down at this step. This step will become just breaking the project down in your heads and figuring out what the inputs and outputs are. For larger projects, we may want to create flowcharts and even diagrams that show how we want everything to work together. Once we get into the projects in this book, we will see different ways to separate the components into their individual blocks and how to define the logic for the inputs and outputs.

After we have broken our project down into the individual prototypes with the separate inputs and output circuits, we would then want to create circuit diagrams for each of these prototypes.