# Line Following Zumo Robot Using Simulink

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/016/425/medium800thumb/robotics_learn_arduino_Zumobot_Simulink_PID_lineFollowing_400.jpg?1448311637)

This tutorial covers how to use Simulink to program a Zumo Robot powered by an Arduino Uno to follow a line using the reflectance sensors present at the bottom of the Zumo Robot. This guide will explain how the data from the reflectance sensors can be used to control the Zumo Robot motors using a control logic known as PID control.

The specific steps to get there are

1. Install [Simulink Support package](http://www.mathworks.com/hardware-support/arduino-simulink.html) for Arduino
2. Download the [Zumo Robot Library](http://www.mathworks.com/matlabcentral/fileexchange/45886-simulink-library-for-zumo-robot) in Simulink  
3. Create a Simulink Model of a PID Controller for the Zumo Robot  
4. Build and download the model to see the robot in action  

This guide is the third tutorial in a series on using Arduino with Simulink. For a quick introduction to Simulink and Arduino, refer to the [Set up and Blink - Simulink and Arduino Tutorial](https://learn.adafruit.com/how-to-use-simulink-with-arduino). This tutorial builds on the concepts discussed in the previous tutorial titled [How to program a Zumo Robot with Simulink](https://learn.adafruit.com/zumo-robot-control-with-simulink) and adds to the model described in that section. It is highly recommended that you check the previous tutorials before trying this one, if you are new to Simulink.

Even though this tutorial uses the Zumo robot, you can use the concepts discussed here to program any line following robot using Simulink.

- [Next Page](https://learn.adafruit.com/line-following-zumo-robot-programmed-with-simulink/hardware.md)

## Featured Products

### Zumo Robot for Arduino

[Zumo Robot for Arduino](https://www.adafruit.com/product/1639)
The Pololu Zumo robot is an Arduino-controllable tracked robot platform that is less than 10 cm × 10 cm—small enough to qualify for Mini Sumo. It includes two micro metal gearmotors coupled to a pair of silicone tracks, a stainless steel bulldozer-style blade, an array of six...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1639)
[Related Guides to the Product](https://learn.adafruit.com/products/1639/guides)
### Adafruit METRO 328 Fully Assembled - Arduino IDE compatible

[Adafruit METRO 328 Fully Assembled - Arduino IDE compatible](https://www.adafruit.com/product/50)
We sure love the ATmega328 here at Adafruit, and we use them&nbsp;_a lot_&nbsp;for our own projects. The processor has plenty of GPIO, Analog inputs, hardware UART SPI and I2C, timers and PWM galore - just enough for most simple projects. When we need to go small, we use a <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/50)
[Related Guides to the Product](https://learn.adafruit.com/products/50/guides)
### USB Cable - Standard A-B

[USB Cable - Standard A-B](https://www.adafruit.com/product/62)
This here is your standard A-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Arduino, USBtinyISP (among other things).  
  
3 feet / 1 meter long  
  
Color may vary!

In Stock
[Buy Now](https://www.adafruit.com/product/62)
[Related Guides to the Product](https://learn.adafruit.com/products/62/guides)

## Related Guides

- [Trinket Audio Player](https://learn.adafruit.com/trinket-audio-player.md)
- [IR Sensor](https://learn.adafruit.com/ir-sensor.md)
- [Arduino Lesson 1. Blink](https://learn.adafruit.com/adafruit-arduino-lesson-1-blink.md)
- [Ladyada's Learn Arduino - Lesson #0](https://learn.adafruit.com/ladyadas-learn-arduino-lesson-number-0.md)
- [Character LCDs](https://learn.adafruit.com/character-lcds.md)
- [Arduino Lesson 7. Make an RGB LED Fader](https://learn.adafruit.com/adafruit-arduino-lesson-7-make-an-rgb-led-fader.md)
- [Making Adabot: Part 2](https://learn.adafruit.com/making-adabot-part-2.md)
- [Arduino Lesson 10. Making Sounds](https://learn.adafruit.com/adafruit-arduino-lesson-10-making-sounds.md)
- [Sending an SMS with Temboo](https://learn.adafruit.com/sending-an-sms-with-temboo.md)
- [Arduino Lesson 8. Analog Inputs](https://learn.adafruit.com/adafruit-arduino-lesson-8-analog-inputs.md)
- [Adafruit Analog Accelerometer Breakouts](https://learn.adafruit.com/adafruit-analog-accelerometer-breakouts.md)
- [Adafruit 1.14" 240x135 Color TFT Breakout LCD Display](https://learn.adafruit.com/adafruit-1-14-240x135-color-tft-breakout.md)
- [Wireless Game Show Poppers for the Classroom!](https://learn.adafruit.com/wireless-game-show-poppers.md)
- [Arduino Lesson 15. DC Motor Reversing](https://learn.adafruit.com/adafruit-arduino-lesson-15-dc-motor-reversing.md)
- [Collin's Lab: MIDI](https://learn.adafruit.com/collins-lab-midi.md)
