Lego Wedo Forklift

Project of the Week – Lego Wedo Forklift (with instructions)

Share this!

This week, Liam made a forklift with Lego Wedo. This was completely designed from scratch, and took a few versions to get right. But it was very definitely worth it, and we’re so impressed with the result. The arms are controlled by the Lego Wedo tilt sensor, which is really clever!

What is Lego Wedo?

Lego Wedo 2.0 is Lego’s entry-level robotics & coding kit, designed for the education space. The core kit comes with a smarthub, motor, tilt sensor and motion sensor, plus a range of gears, wheels, axles and bricks to create a wide range of projects. As you would expect, it’s compatible with all the standard Lego and Technic components.

Alongside the kit comes the Lego Wedo 2.0 app. The app contains instructions for heaps of Wedo projects, and an image-based coding platform that communicates with the smarthub via bluetooth. For us, a big benefit of having the project instructions within the app is that they’re all in one place, and they can’t get lost or damaged. The app is a very big download, just under 500MB, but once you’ve got it installed, it’s very easy to set up and get started.

How to build Liam’s Lego Wedo forklift

To build the Lego Wedo forklift, you’ll be using the smarthub, motor and tilt sensor. We’ve put together a full set of instructions for you, so you can follow along step-by-step to build your own.

Lego WeDo Forklift

Get the instructions here!

Liam loves sharing his projects! Build your own Lego Wedo forklift with a full set of instructions.

Using the Ledo Wedo 2.0 app vs Scratch for coding

The Lego Wedo 2.0 kit comes with an app for pictorial coding, which lets you get your projects up and running quickly. The platform is very simple to use, with blocks aligned side-by-side in the sequence you want your project to execute the instructions. A range of inputs can be used, including from the tilt sensor, motion sensor, noise sensor (from your devices microphone), or from the ‘go’ button. In terms of outputs, the motor can activate, a display can show on your devices screen, or the colour of the light on the smarthub can change.

There is limited complexity that can be achieved within the Wedo app, as it’s designed for simple instructions and getting started. If you want to start coding more complex actions, consider using Scratch instead.

Scratch is a block-based coding platform, which has the ability to integrate with a wide range of hardware options including Lego Wedo, Mindstorms and Boost, BBC microbit, and Makey Makey. Importing the custom blocks for Lego Wedo lets you combine them with standard Scratch blocks to extend what you can do.

Coding the Lego Wedo Forklift using the Wedo app

For this project, we decided to use the Lego Wedo app. There are two reasons for this. The first is that Liam is an absolute whiz on this app, and is good at pushing the limits of the app. The second reason is that there seems to be a problem with Scratch Link at the moment. While we’re fixing that, we didn’t want to hold up this project.

Most code sequences in the app start with the green arrow. Often, that’s the best way to get started, but pressing the arrow will only activate that particular sequence. For the forklift, Liam needed to get three sequences all starting at the same time.

The way to do this is with the keypress option. It’s a very clever block that can activate multiple code sequences at once.

Keypress option in the Lego Wedo app to start code
Keypress option in the Lego Wedo app to start code

The whole step-by-step for the code is shown in the video at the top of this post, so you can follow along with us. But, if videos aren’t your thing, we’re explaining it all here as well.

Set up your code sequences

To start, drag and drop three of these keypress blocks onto your Wedo work area. The first sequence we’ll do is for lifting the forklift arms. First, put in a ‘wait’ command, so that the rest of the sequence won’t work unless the tilt sensor is in this position. To change the angle of the tilt sensor, click on the orange block to scroll through the options. Then, set the motor speed and direction. Wrap it all in a forever loop, and this one is done.

Code to raise the forklift arms
Code to raise the forklift arms

Now you’re ready for the second sequence, which stops the motor when the tilt sensor is level. Add this sequence to your second keypress block. Use the ‘wait’ command again, and click the orange block until the tilt sensor lies flat. Add a block to stop the motor, and wrap it in a forever loop just like the first sequence.

Code to stop all movement
Stop the motor when the tilt sensor is level

And finally, you need a piece of code to make the arms of your Wedo forklift move down. This last piece of code is very similar to the first one. Beneath the ‘wait’ command, click the tilt sensor until it’s tilting forwards. Set your motor speed the same as the upwards movement, and the motor direction to the opposite of the first sequence.

Code to lower the arms of the forklift
Lower the arms of the forklift when the sensor is tilted forwards

If you prefer to code your forklift using Scratch

Just because we’re using the Lego Wedo app for this project, doesn’t mean you have to. If you prefer to code your forklift using Scratch, go ahead. To allow for the three different actions (up, down and stop), use ‘if/else’ statements. This is similar to the code for the tilt sensor in Liam’s Racing Car game.

Scratch code for the Lego Wedo forklift
Scratch code for the Lego Wedo forklift

By using the ‘if/else’ statement, you only need two of these. If we read the first statement like a sentence, it would go something like this:

“If the tilt sensor is tilted upwards more than 20 degrees, set the motor direction to [x] and turn the motor on. Else, turn the motor off”. So that means when the tilt sensor is between level and 20 degrees, it won’t activate the motor. When it gets more tilted, that’s when the motor will start.

Then, the second statement does the same for the downwards tilt.

More Lego Wedo projects you might like

Liam loves making projects using Lego Wedo. Here are a few of his other projects you might like to try:

Share this!

Similar Posts

2 Comments

  1. It iѕ really a nice аnd useful piece of info.
    I am happy that you simply shared this һelpful info with us.

    Please stay us up to date like this. Thanks for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *