Implementation: build one module at a time
Implementation means turning the design into a working device.
- Collect the parts from your parts list and check each one.
- Build on a breadboard first (no soldering), then on a permanent board.
- Add one module at a time: power → input → output. After each, run a tiny test program.
- Use colour for wires (red = power, black = ground) and label them.
- Keep your code in small functions and write comments.
- 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.
| Test | Action | Expected result |
|---|---|---|
| 1 | Press the button | LED turns on |
| 2 | Cover the light sensor | Lamp turns on |
| 3 | Press the button 10 times fast | No wrong signal |
When the real result is different from the expected result, you have found a bug. Debugging steps:
- Repeat the failure and write down when it happens.
- Print values with
Serial.printlnto see what the board sees. - Check wiring and power first, then code.
- 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:
- Code with comments
- Circuit diagram and photos
- Parts list (bill of materials) with quantities
- README: what it does, how to build it, how to use it, known problems
- Licence file
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.
- Permissive licence (MIT-style): anyone may use, change and even sell it, but must keep your name and the licence.
- Share-alike licence (GPL-style, CERN-OHL-S, Creative Commons ShareAlike): anyone may change it, but the changed version must stay open under the same rules.
- All rights reserved: no copying or changes without permission.
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
- Test case = action + expected result (compare with real result)
- Pass rate (%) = tests passed ÷ tests run × 100
- Key terms: breadboard, module, test case, bug, debug, repository, licence, IP
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
- Building everything at once and testing only at the end. It is very hard to find which part is wrong.
- Changing many things at one time when fixing a bug.
- Sharing a project with no licence or no README, so nobody knows if they may use it or how.
- Copying someone's code or design without checking the licence or giving credit.