📘 CodingMarble Learn

Making, Testing and Sharing a Hardware Project: Implementation, Testing, Sharing and IP

To make a hardware project, build one module at a time and check it before adding the next (implementation). Then test the whole project with test cases, including real conditions such as a dark room or very fast presses. When a test fails you have found a bug: find the cause, fix it and test again. Finally share your work: code, circuit diagram, parts list and a README in an online repository, with a licence that tells others what they may do. Intellectual property (IP) means the rights of the creator; open-source licences let others use and improve the work while giving credit.

🎬 Step-by-step story

  1. Start making: add one module at a time and check after each one. First power, then input, then output.
  2. Building slowly catches mistakes early. The board grew as each module joined, and each one was checked.
  3. Testing: run the tests one by one. Test 2 failed, so we found a bug (the red shape). Fix it and run again.
  4. Test in real conditions: a dark room, heat, very fast presses. A good project works in all of them.
  5. Sharing: put the code, circuit diagram, parts list and README into an online repository and choose a licence.
  6. Free play: pick a licence and read what other people may do with your work.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why not build the whole thing and then test it?

If it fails you will not know which part is wrong. Adding one module at a time finds the faulty part at once. Watch the modules join one by one.

Why do I test after every module?

A small test is quick and a mistake is easy to find. The board grows only when the last piece works.

What does a failing test tell me?

That the real result is different from the expected result. The red shape is the bug. Press 'Fix the bug' and run the test again.

Why test in dark rooms or with fast presses when it works normally?

Real users and places are not perfect. Extreme tests find hidden bugs. Run all three tests in step 3.

Why do I need a README and parts list?

Without them nobody can build your project. The four files in the 3D travel together to the repository.

What can others do under each licence?

Click each licence button: the green one allows free use with credit, the blue keeps changes open, and the red needs your permission.

Implementation: build one module at a time

Implementation means turning the design into a working device.

  1. Collect the parts from your parts list and check each one.
  2. Build on a breadboard first (no soldering), then on a permanent board.
  3. Add one module at a time: power → input → output. After each, run a tiny test program.
  4. Use colour for wires (red = power, black = ground) and label them.
  5. Keep your code in small functions and write comments.
  6. Save versions of your code, so you can go back if a change breaks things.

Safety: check the wiring before powering on, keep water away from the board, and use a power source with the right voltage.

Testing: test cases, bugs and fixing

A test case is one planned check: what you do, and what you expect to happen.

TestActionExpected result
1Press the buttonLED turns on
2Cover the light sensorLamp turns on
3Press the button 10 times fastNo wrong signal

When the real result is different from the expected result, you have found a bug. Debugging steps:

  1. Repeat the failure and write down when it happens.
  2. Print values with Serial.println to see what the board sees.
  3. Check wiring and power first, then code.
  4. Change one thing at a time, then run the test again.

Also test in real conditions (dark, hot, noisy, a weak battery) and with a real user. A project is finished only after all the planned tests pass.

Sharing your project

Sharing helps others learn, and others will find bugs you missed. A good project package has:

Put them in an online repository (for example GitHub or GitLab), which also keeps the full history of changes. Never share private data such as passwords, Wi-Fi keys or personal photos inside the code.

Intellectual property (IP) and licences

Intellectual property is the creator's right over what they made: code, designs, text and pictures. By default, if you add no licence, nobody else may copy or change your work.

Open-source does not mean “no rules”. Always give credit to the original authors. A patent protects an invention for a limited time, a copyright protects the expression (code, drawings, text) and a trademark protects a name or logo. Do not copy the code or pictures of others without checking their licence.

Try it: break it, fix it, share it

In the 3D go to step 3. Press Run test twice. Test 2 fails. Predict: after pressing Fix the bug and Run test again, what will test 3 show? In the last step, click each licence and read what others may do.

At home: write three test cases for any small gadget you have, such as a torch: what you do and what you expect.

Key formulas and definitions

Worked examples

1. A team ran 12 test cases. 9 passed and 3 failed. What is the pass rate?

Pass rate = 9 ÷ 12 × 100 = 75%. The 3 failed tests show bugs to fix.

2. A buzzer rings all night even when the water tank is full. List three debugging steps.

1) Print the sensor reading with Serial.println. 2) Check the wiring and ground of the sensor. 3) Check the rule in the code, for example if the limit is too low. Change one thing at a time.

3. You use a friend's code that has an MIT-style licence. What must you do?

You may use and change it, but you must keep the original author's name and the licence text.

4. A school wants others to improve its design, but any improved version must also be shared openly. Which kind of licence?

A share-alike licence (GPL-style or CERN-OHL-S or Creative Commons ShareAlike).

5. Write two test cases for a night lamp.

Test 1: cover the sensor, expect the lamp ON. Test 2: shine a torch on the sensor, expect the lamp OFF.

Common mistakes

Practice quiz

1. Why do we add one module at a time?
2. A bug is found when:
3. Which file explains how to build and use the project?
4. A share-alike licence means:
5. If you give no licence at all, by default:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

How do I test a hardware project?

Write test cases (action and expected result), test each module, then the whole project, and also in real conditions. Fix every failed test and run again.

What is an open-source licence?

A licence that allows others to use, study and often change and share your work, with conditions such as giving credit or keeping changes open.

What is intellectual property?

The legal right of a creator over what they made, such as code, designs, text, pictures, inventions and names.

Where this is taught

China高三Sel.6 Open-source hardware projects

Learn first

Related lessons

All Computer Science lessons