COLOUR SENSOR – SO MANY TALENTS!

Screen Shot 2017 04 20 at 19.47.20 - COLOUR SENSOR - SO MANY TALENTS!

INTRO AND LEARNING GOALS

We love the EV3 Colour Sensor here at Raising Robots – it does so much more than it says on the label! What a multi-talented sensor this is! Here, we will look at how you can attach the sensor easily (for the different things it can sense) and get it up and running quickly…
  • Understand how to attach the Colour Sensor to the robot – depending on its use
  • Explore how to use LEGO® MINDSTORMS® Education software
  • Create a program using the Colour Sensor block to start the robot when it is fed yellow ‘sweetcorn’
  • Create a program using the Colour Sensor block to start the robot when it senses an increase in ambient light
  • Create a program using the Colour Sensor block to stop the robot when it senses a decrease in reflected light – stopping at a black line

HOW IT WORKS – THE BASICS

The Colour Sensor will, as the name suggests, detect colour – seven ‘colours’ in fact. These are black, blue, green, yellow, red, white and brown. It can also detect when there is no colour – in other words it doesn’t sense any of the other seven colours. Screen Shot 2017 09 24 at 19.42.46 188x400 - COLOUR SENSOR - SO MANY TALENTS! It can tell the difference between black, blue, green, yellow, red, white and brown BUT it can also measure ambient light and reflected light.

LET’S ATTACH THE SENSOR…

When using the Colour sensor to detect colour on a surface or the reflected light from a surface, the position of the sensor is very important. The sensor generates the light that it needs so limiting the amount of external light that gets into the sensor is key. So a height of about 3 coins (5mm) seems to work really well. You could further adapt your sensor by fitting a ‘shield’ to minimise external light.
IMG 0794 - COLOUR SENSOR - SO MANY TALENTS!
IMG 0797 - COLOUR SENSOR - SO MANY TALENTS!

LET’S GET PROGRAMMING…

We are focusing on stopping and starting our robot – using colour, then ambient light and then reflected light.
Shows the Colour Sensor, sensing colour…
Shows the Colour Sensor, sensing ambient light…
Shows the Colour Sensor, sensing reflected light…
john - COLOUR SENSOR - SO MANY TALENTS!

SOME TEACHING THOUGHTS… from John

  • Always check that the Colour Sensor is set to the right mode – Colour, Ambient or Reflected. You can check this in the Port View in the bottom right hand corner when you are connected to the robot.
  • Having the robot connected when programming is useful, as you get live readings that you can then use as the basis for your statements. These statements will trigger your sensor.
  • You can calibrate your sensor for reflected light. This can be useful when doing such tasks as follow a line. I have highlighted the calibration task in the ‘GREAT SUPPORT FROM LEGO EDUCATION’ below.
Robot5 04 - COLOUR SENSOR - SO MANY TALENTS!

ROBOT WORKOUT (WHERE NEXT?)

  • Experiment with stopping at different colours (using coloured electrical tape on the floor is ideal). Are some colours better than others?
  • Get the robot to follow a line – it is a Mindstorms classic! There is a really nice tutorial on it so see the GREAT SUPPORT FROM LEGO EDUCATION section below.
legoev3logo - COLOUR SENSOR - SO MANY TALENTS!

GREAT SUPPORT FROM LEGO EDUCATION

DESKTOP: From the LOBBY (the starting page), go to ROBOT EDUCATOR – BASICS – and choose STOP AT A LINE – just like we did above. From the LOBBY (the starting page), go to ROBOT EDUCATOR – BEYOND BASICS – and choose SWITCH – don’t be put off by the fact that it is in BEYOND BASICS! There is a really nice Sample Program within it – so you can change the settings and deconstruct how the program works. I mention calibration above – from the LOBBY (the starting page), go to ROBOT EDUCATOR – BEYOND BASICS – and choose COLOUR SENSOR – CALIBRATE. TABLET: On the front screen, click on the ROBOT EDUCATOR tab and (hidden on the second page!) choose FOLLOW A LINE. There is a great Sample Program within it – so you can change the settings and deconstruct how the program works.