Lesson video

In progress...

Loading...

Hello, my name is Mrs. Holborow and welcome to Computing.

I'm so pleased you've decided to join me for the lesson today.

In today's lesson, we're going to be looking at how we can make modifications to improve a project, like our robot buggies.

Welcome to today's lesson from the unit, Using physical computing to create a robot buggy.

This lesson is called Adding Additional Features to Your Buggy.

And by the end of today's lesson, you'll be able to describe improvements and modify a system to enhance a product's performance.

Shall we make a start? We will be exploring these keywords in today's lesson.

Should we take a look at them now? Review.

Review to look over something carefully to check, improve, or evaluate it.

Consideration.

Consideration, careful thought about something before making a decision or forming an opinion.

Innovation.

Innovation to create something new or improve something in a fresh, original way.

Look out for these keywords in today's lesson.

Today's lesson is broken down into two sections.

We'll start by describing improvements to a project, and then we'll move on to modify systems to improve a product.

Let's make a start by describing improvements to a product.

Jun says, "I'm really pleased with my physical computing project, Sofia.

It's great to see my buggy move along the line." Sofia says, "It works really well, Jun.

How do you think you'll improve it?" Jun says, "I've got lots of ideas, but I don't know what's most important to work on." It can be hard to decide what to improve, especially if you have lots of ideas.

To help you decide, you can spend some time thinking and reviewing your project.

Reviewing is useful, because it helps you consider the strengths and weaknesses of your work.

See what's good about your work and what could be improved.

Good engineers always review their work before making improvements.

Reviewing helps to solve real world problems with smart, efficient, and thoughtful improvements without wasting time.

You can review your project and find areas to improve by asking yourself some simple questions about it, such as, "Did the buggy follow the line or did it go off course or malfunction?" Improving the function of a project can make it more suitable for its purpose.

Alex says, "Did the buggy move too fast or slow? Did the buggy move smoothly or was it jerky?" Improving the movement of the buggy might help it work more efficiently, saving energy or complete its tasks more quickly.

Izzy says, "Did the LEDs work as expected? Would it be useful to add extra LEDs or even remove some?" Adding extra LEDs could give clearer feedback to the user and make it look better.

Alex says, "Does the buggy look great or could the style and visual appeal be improved?" Improving the looks and style of your buggy might make the project more appealing to others.

Izzy says, "Was your code long and messy? Could you make it easier to read, modify, and debug?" Writing clear and easy to read code is important, because it makes your code easier to understand, fix, and improve, especially if you're gonna give that code to other people.

It can be tempting to try to change or add lots of things at once when improving a project.

It's often better to focus your effort on improving one or two important things rather than trying to improve everything in one go.

Too many changes can be confusing and can actually lead to new problems. Test one idea at a time and keep it simple and useful.

Avoid making vague statements for improvements.

For example, "improve the robot." That's not very helpful and it doesn't tell us any detail.

Vague suggestions don't help you accurately fix the problem or understand what to do to improve the project.

A good suggestion for improvement should be specific, clear, and practical.

For example, "Add an extra ultrasonic sensor to the rear of the buggy to enable it to detect objects when reversing." That's really clear and specific, so we know what we need to do.

Making improvements to a product and trying out new creative ideas can help drive innovation.

But what is innovation? Innovation is when you come up with and apply new ideas or methods to solve real world problems. It's about considering how things can be done differently.

Can you think of any famous products that are innovative? Maybe pause the video whilst you have a think.

Ah, Jun looks a bit worried.

Jun says, "I'm not sure I have enough GPIO pins left on the Pico for all the extra components I want to add.

I think I will keep it simple and focus on the most important features I want to improve." That sounds like a good idea, Jun.

Note that adding new systems and components requires careful consideration.

Careful thinking helps keep your project strong, reliable, and easier to grow.

Whatever you decide to improve in your project, your ideas should be practical and realistic for the time and resources you have.

Time to check your understanding.

I have a true or false statement for you.

Reviewing helps you consider the strengths and weaknesses of your projects.

Is this true or false? Pause the video whilst you have a think.

Did you select true? Well done.

I have a question for you.

Which word means to come up with new ways to solve real world problems? Is it a, innovation, b, review, or c, consideration? Pause the video whilst you have a think.

Did you spot it? Well done.

Innovation means to come up with new ways to solve real world problems. Okay, we're moving on to our first task of today's lesson, Task A.

For part 1a, think about the project that you want to improve and identify two improvements you would like to make to it.

For part 1b, for each improvement you have suggested, write one to two sentences to explain why you think the suggestions would improve the project.

Pause the video here whilst you complete the task.

How did you get on with the questions? Let's have a look at a sample answer together.

So for part 1a, you were asked to think about the project that you want to improve and describe two improvements you would like to make to it.

The first improvement I would like to make is to add orange indicator LEDs to the size of the buggy to give more visual feedback to users.

The second improvement I would like to make is to add a buzzer to the buggy, so that it can give audible feedback to the user.

There two really specific good improvements there.

For part 1b, for each improvement you've suggested, you will asked to write one to two sentences to explain why you think the suggestions would improve the project.

I think that adding indicators to the side of the buggy would improve the project, because it would give a visual output to show when buggy is turning in either direction.

It would also improve the looks of the buggy as well.

I think that adding a buzzer to the buggy would give an audio output to alert users when certain things are happening.

I would like to programme it to buzz when an object is detected in front of the buggy.

Okay so, so far, we've described improvements to a product.

Let's now move on to modify systems to improve a product.

June says Sofia, I've decided to add orange LED indicators and a buzzer to my buggy project.

Sofia says, "They sound like useful improvements to the buggy, Jun.

How will you modify the project to add them?" That's a good question, Sofia.

Jun says, "I'll have to modify the code, electronic circuit, and the buggy chassis to add the new improvements." When adding new code or components to a project, it's important to be careful not to break the existing system.

There are many ways to modify systems and the approach you take may be different, depending on the project you are working on.

There are, however, a few tips that might help you, such as plan carefully, code cleanly, and test thoroughly.

Planning carefully helps avoid problems and keeps the project on track.

You will need to give consideration to the components you need, how you will connect them to the electronics, and how you will physically attach them to the project.

If you need to change or add any code, you should modify it cleanly to make sure it's easy to read, maintain, and keep free from unintended bugs.

Clean code is about writing code that is easy for people to understand and work with, not just understandable for computers.

To keep code clean, you should use clear names for variables and functions.

So here, we have temperature_celsius = 25.

We know that the value 25 is a temperature recorded in Celsius.

On the other side, we have a function which is called blink_led.

I can easily tell that that function is turning an LED on and off.

So, we have clear variable names and clear function names.

In clean code, functions should only do one thing.

So, this function only turns the LED on and off and makes it blink.

This function only blinks the LED.

It doesn't control motors, buzzes, or sensors.

To keep your code clean, you should ensure formatting and structure is consistent throughout.

For example, on the left hand side, we have the variable temperature_celsius, which is using the snake_case formatting for variable names.

On the right hand side, motorSpeed is using camelCase.

If we want to be consistent, we should use the same.

So on the right hand side, we've now changed motorSpeed to motor_speed.

You could use snake_case or camelCase in your variable names.

They're both okay, but you should be consistent.

Remember to use four spaces per indentation level with Python and don't mix tabs and spaces.

Testing after each small modification is important, because you can confirm that the changes you have made work.

Testing helps you catch and fix problems early before they grow into bigger problems, which are harder to solve.

As you modify your project, it might make sense to organise and reroute the wires and pins you use to connect components to the microbe controller.

Consider what layout makes most sense for your project.

For example, using a row of GPIO pins for all your LEDs.

This helps keep all the setup neat, easier to debug, and less likely to fail.

Time to check your understanding.

Testing is done a, right at the end after all the modifications are complete, b, after each small modification, or c, only before adding improvements.

Pause the video whilst you have a think.

Did you select b? Well done.

Remember, testing is done after each small modification.

The main purpose of writing clean code is to a, only use integers not floats, b, use as few lines of code as possible, or c, make code easier to read, maintain, and debug.

Pause the video whilst you think about your answer.

Did you select c? Well done.

I knew you'd get that one right.

Okay, we're moving on to our second task of today's lesson, Task B.

And you've done a fantastic job so far, so well done.

For part 1a, if you can, modify your project with the first improvement that you suggested in Task A.

For part 1b, if you can, modify your project with the second improvement that you suggested in Task A.

Pause the video whilst you modify and make your improvements.

How did you get on with your modifications? Did you manage to implement them? Well done.

Let's have a look at some sample answers together.

So if you remember, the modification I suggested in Task A was that I was gonna add some indicators to the buggy.

So, you can see here I've added the additional LED pins and set them up on Pin 6 and 7.

And then, I've added the new left LED function and new right LED function, which are gonna turn the LEDs on and off in a blink like fashion.

As a continuation of this solution, I've added the indicators to the functions, which were turn_right and turn_left, because we want to indicate if we are turning.

So you can see we've got the new functions called inside the turning functions blink_right_ind, which is short for indicator, and blink_left_ind.

The other modification I suggested in Task A was to add a buzzer to make some noise if an obstacle was detected.

So I've set up the buzzer pin, so buzzer = Pin(8, Pin.

OUT).

I've got a function which I've called beep_buzzer, which is going to turn the buzzer on sleep for 0.

5 seconds, and then turn the buzzer off before sleeping for another 0.

5 seconds.

In my main code, I then have if distance < 20, and inside that selection statement, I'm calling the function beep_buzzer.

So buzzer set up on Pin 8.

The new buzzer function and the new function called when the object is detected.

Okay, we've come to the end of today's lesson adding additional features to your buggy and you've done a great job, so well done.

Let's summarise what we've learned in this lesson.

Reviewing is useful, because it helps you consider the strengths and weaknesses of your work and identify areas to improve.

Adding new systems and components requires careful consideration to ensure they integrate smoothly and do not interfere with existing functionality.

Making improvements to a product and trying out new creative ideas can help drive innovation.

I hope you've enjoyed today's lesson, and I hope you'll join me again soon.

Bye.