Major site overhaul: resources hub, content migration, new blog posts, forms
- Redesign /resources as sectioned hub with category pages - Migrate 645 Squarespace CDN images to local /images/content/ - Create 9 new news/blog posts with event photos - Fix blog post slugs (rename gibberish filenames) - Rename Design Blog to Design Blogs across site - Remove education page, replace with Platform in nav - Redesign rover repair request form with dynamic rover entries - Add school search combobox to contact, store, and repair forms - Extract shared KNOWN_SCHOOLS data - Make /rover-expansion-3d-printing dynamically pull from MDX - Add related resources sections to product pages - Fix homepage broken /quote links to /store - Store page: sample kit cards, inline quote builder, mailing list opt-in
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: "The IR Distance Sensors"
|
||||
date: "2021-06-18"
|
||||
categories: ["All", "Guides"]
|
||||
categories: ["All", "Sensor Guides"]
|
||||
tags: []
|
||||
excerpt: "Learn what the IR distance sensors are and how to code them."
|
||||
featuredImage: "/images/resources/ir-sensor.gif"
|
||||
---
|
||||
|
||||

|
||||

|
||||
|
||||
There are two infrared (IR) distance sensors located on the Rover. One on either side.
|
||||
|
||||
@@ -17,21 +17,19 @@ The IR sensors gives data on the distance between the robot the object the senso
|
||||
|
||||
The IR sensors work differently to the front Ultrasonic distance sensor. If you’re curious about how the Ultrasonic sensor works read our [ultrasonic sensor blog post](/resources/ultrasonic-sensor)
|
||||
|
||||
**What is IR?**
|
||||
|
||||
Before we jump into how the IR sensors work, let’s look at what IR actually is. IR stands for infrared. Infrared is a type of light. Human eyes cannot see **infrared light**. The light we see from the sun & light bulbs is called **visible light**. **Visible light** and **infrared light **are different types of light.
|
||||
**What is IR?** Before we jump into how the IR sensors work, let’s look at what IR actually is. IR stands for infrared. Infrared is a type of light. Human eyes cannot see** infrared light**. The light we see from the sun & light bulbs is called** visible light**.** Visible light ** and** infrared light** are different types of light.
|
||||
|
||||
All types of light are made up of something called electromagnetic waves. The science behind electromagnetic waves and how we see them is complicated, for now all we need to know is that they exist and they’re all around us. Electromagnetic waves vary in length, similar to how there are big waves and small waves at the beach. The diagram below shows the entire range of electromagnetic wave lengths.
|
||||
|
||||

|
||||

|
||||
|
||||
**Visible light** is electromagnetic waves with a length of 400–700 nanometres (nm). **Infrared light** is electromagnetic waves with a length of 700nm to 1mm.
|
||||
**Visible light** is electromagnetic waves with a length of 400–700 nanometres (nm).** Infrared light** is electromagnetic waves with a length of 700nm to 1mm.
|
||||
|
||||
You can see in the diagram, there are a bunch of different types of electromagnetic wave ranges like radio, ultraviolet and gamma ray. The human eye can only perceive electromagnetic waves in the **Visible light** range but that doesn’t mean the other electromagnetic waves don’t exist. Lots of cool technology uses electromagnetic waves from all over the spectrum.
|
||||
|
||||
**Who Can See Infrared Light?**
|
||||
|
||||

|
||||

|
||||
|
||||
Howard the snake loves code
|
||||
|
||||
@@ -45,7 +43,7 @@ Ok, now that we know a bit about IR, let’s look at how the IR sensors on the r
|
||||
|
||||
The IR sensor uses a laser to detect how far away objects are. Yes the Rover uses two IR lasers. How do these lasers help the Rover detect distance? It uses the following process:
|
||||
|
||||

|
||||

|
||||
|
||||
- The IR sensor emits an IR laser outwards.
|
||||
|
||||
@@ -79,23 +77,23 @@ In the sensor view dialog, the IR sensor values are located on the sides of the
|
||||
|
||||
255 is the returned value when an IR sensor is unable to determine an accurate value. If you are seeing 255 it means you may be attempting to detect objects further away than 1m.
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
**Using The IR Sensors In Code**
|
||||
|
||||
Let’s write a simple program to print our left IR sensor values every second for 10 seconds.
|
||||
|
||||

|
||||

|
||||
|
||||
- Start by adding a **Repeat 10 Times **block.
|
||||
- Start by adding a **Repeat 10 Times** block.
|
||||
|
||||
- Inside the loop, place a **Print **statement. You can find this in the **Utilities **category.
|
||||
- Inside the loop, place a **Print** statement. You can find this in the ** Utilities** category.
|
||||
|
||||
- Place the **Read IR Distance** block inside our **Print** statement.
|
||||
- Place the **Read IR Distance** block inside our ** Print** statement.
|
||||
|
||||
You can find the **Read IR Distance** block in the **Sensors **category. The python command is **IR.ReadLeft()**.
|
||||
You can find the **Read IR Distance** block in the ** Sensors** category. The python command is ** IR.ReadLeft()**.
|
||||
|
||||
- Add a **Delay For 1 Second** block so this loop waits 1 second before running again.
|
||||
|
||||
@@ -106,207 +104,3 @@ When we run this; we will see the left IR distance value every second for 10 sec
|
||||
### Wrapping Up
|
||||
|
||||
Now that we’re familiar with what the IR distance sensors are, how they work and how to program them it’s time to start doing some activities. Try these activities that are done best using the IR sensors.
|
||||
|
||||
Resources
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/driving-school-basics)
|
||||
|
||||
Mar 14, 2022
|
||||
|
||||
[Driving School Basics](/resources/driving-school-basics)
|
||||
|
||||
Mar 14, 2022
|
||||
|
||||
Learn the basics of rover motors and sensors while navigating Duck City.
|
||||
|
||||
[Read More →](/resources/driving-school-basics)
|
||||
|
||||
Mar 14, 2022
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/maze)
|
||||
|
||||
Jun 4, 2021
|
||||
|
||||
[Activity: Maze](/resources/maze)
|
||||
|
||||
Jun 4, 2021
|
||||
|
||||
Learn branching, iteration, algorithm design, and how to use the Rover’s motors, ultrasonic, colour, and IR sensors.
|
||||
|
||||
[Read More →](/resources/maze)
|
||||
|
||||
Jun 4, 2021
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/lane-guidance)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
[Activity: Lane Guidance](/resources/lane-guidance)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
Learn iteration, branching, algorithm design, maths, and how to use the motors, ultrasonic, and IR sensors.
|
||||
|
||||
[Read More →](/resources/lane-guidance)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/sumo)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
[Activity: Sumo](/resources/sumo)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
Learn branching, iteration, algorithm design, and how to use the Rover’s motors, colour, ultrasonic, and IR sensors.
|
||||
|
||||
[Read More →](/resources/sumo)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/survey-bot)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
[Activity: Survey Bot](/resources/survey-bot)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
Learn iteration while using the IR sensors.
|
||||
|
||||
[Read More →](/resources/survey-bot)
|
||||
|
||||
Jun 3, 2021
|
||||
|
||||
### Related Posts
|
||||
|
||||
Resources
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/creating-a-sumo-unit)
|
||||
|
||||
[All](/resources?category=All)
|
||||
|
||||
[Creating A Sumo Unit For Your Digital Technologies Class](/resources/creating-a-sumo-unit)
|
||||
|
||||
[All](/resources?category=All)
|
||||
|
||||
How to run a sumo unit in your digital technologies classroom.
|
||||
|
||||
[Read More →](/resources/creating-a-sumo-unit)
|
||||
|
||||
[All](/resources?category=All)
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/ultrasonic-sensor)
|
||||
|
||||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||||
|
||||
[The Ultrasonic Sensor](/resources/ultrasonic-sensor)
|
||||
|
||||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||||
|
||||
Learn all about the ultrasonic sensor!
|
||||
|
||||
[Read More →](/resources/ultrasonic-sensor)
|
||||
|
||||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/year-7-digital-tech-at-st-peters)
|
||||
|
||||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|
||||
|
||||
[Case Study: Year 7 Digital Tech at St Peters Lutheran College](/resources/year-7-digital-tech-at-st-peters)
|
||||
|
||||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|
||||
|
||||
See how Meg Foley at St Peters conducted a challenge for their Year 7s using Micromelon.
|
||||
|
||||
[Read More →](/resources/year-7-digital-tech-at-st-peters)
|
||||
|
||||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/robot-simulator)
|
||||
|
||||
[All](/resources?category=All), [Getting Started](/resources?category=Getting+Started)
|
||||
|
||||
[Getting Started With The Robot Simulator](/resources/robot-simulator)
|
||||
|
||||
[All](/resources?category=All), [Getting Started](/resources?category=Getting+Started)
|
||||
|
||||
How to get started with the Micromelon Robot Simulator.
|
||||
|
||||
[Read More →](/resources/robot-simulator)
|
||||
|
||||
[All](/resources?category=All), [Getting Started](/resources?category=Getting+Started)
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/getting-started-with-the-micromelon-rover)
|
||||
|
||||
[All](/resources?category=All), [Getting Started](/resources?category=Getting+Started)
|
||||
|
||||
[Getting Started With The Micromelon Rover](/resources/getting-started-with-the-micromelon-rover)
|
||||
|
||||
[All](/resources?category=All), [Getting Started](/resources?category=Getting+Started)
|
||||
|
||||
Crash course on basic rover function, how and what to program and starter activities to attempt.
|
||||
|
||||
[Read More →](/resources/getting-started-with-the-micromelon-rover)
|
||||
|
||||
[All](/resources?category=All), [Getting Started](/resources?category=Getting+Started)
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
](/resources/prison-escape)
|
||||
|
||||
[Activities](/resources?category=Activities), [All](/resources?category=All)
|
||||
|
||||
[Activity: Prison Escape](/resources/prison-escape)
|
||||
|
||||
[Activities](/resources?category=Activities), [All](/resources?category=All)
|
||||
|
||||
Learn branching and iteration using the colour sensors and motors.
|
||||
|
||||
[Read More →](/resources/prison-escape)
|
||||
|
||||
[Activities](/resources?category=Activities), [All](/resources?category=All)
|
||||
|
||||
Reference in New Issue
Block a user