Intel Galileo Gen 2 Development Board

INTRODUCTION

_DSC0756-450x300

What will you make?
The Intel® Galileo Gen 2 board is the first in a family of Arduino*-certified development and
prototyping boards based on Intel® architecture and specifically designed for makers, students,
educators, and DIY electronics enthusiasts. Providing users with a fully open source hardware
and software development environment, the Intel Galileo Gen 2 board complements and extends
the Arduino line of products to deliver more advanced compute functionality to those already
familiar with Arduino prototyping tools. The Intel Galileo Gen 2 development board is designed
to be hardware-, software-, and pin-compatible with a wide range of Arduino Uno* R3 shields
and additionally allows users to incorporate Linux* firmware calls in their Arduino sketch
programming.

Whats new with the Intel® Galileo Gen 2 board?

  • 6‐pin 3.3V USB TTL UART header replaces 3.5 mm jack RS‐232 console port for Linux debug. New 6‐pin connector mates with standard FTDI* USB serial cable (TTL‐232R‐3V3) and popular USB‐to‐Serial breakout boards. 12 GPIOs now fully native for greater speed and improved drive strength.
  • 12‐bit pulse‐width modulation (PWM) for more precise control of servos and smoother response.
  • Console UART1 can be redirected to Arduino headers in sketches, eliminating the need for soft‐serial in many cases.
  • 12V power‐over‐Ethernet (PoE) capable (PoE module installation required)
  • Power regulation system changed to accept power supplies from 7V to 15V.

FEATURES

  • Intel® Quark™ SoC X1000 application processor, a 32‐bit, single‐core, single‐thread, Intel®Pentium® processor instruction set architecture (ISA)‐compatible, operating at speeds up to 400MHz.
  • Support for a wide range of industry standard I/O interfaces, including a full‐sized mini‐PCI Express* slot, 100 Mb Ethernet port, microSD* slot, USB host port, and USB client port.
  • 256 MB DDR3, 512 kb embedded SRAM, 8 MB NOR Flash, and 8 kb EEPROM standard on the board, plus support for microSD card up to 32 GB.
  • Hardware and pin compatibility with a wide range of Arduino Uno R3 shields.
  • Programmable through the Arduino integrated development environment (IDE) that is supported on Microsoft Windows*, Mac OS*, and Linux host operating systems.
  • Support for Yocto 1.4 Poky* Linux release.

SPECIFICATION

SAMPLE CODE
https://github.com/MakersTeam/galileo

DOCUMENTS

Getting Started With the Intel® Galileo Gen2 Development Board

FRR283IIE4ZUPNY.MEDIUM

This tutorial explains on how to get started with the Intel®Galileo Gen2 board.
The Intel® Galileo Gen 2 development board is a microcontroller board based on the Intel® Quark™SoC X1000 application processor, a 32-bit Intel® Pentium® brand system on a chip (SoC). It is the first board based on Intel® architecture designed to be hardware and software pin-compatible with shields designed for the Arduino Uno* R3.
This platform provides the ease of Intel architecture development through support for the Microsoft Windows*, Mac OS*, and Linux* host operating systems. It also brings the simplicity of the Arduino integrated development environment (IDE) software. The Intel Galileo Gen 2 board is also software-compatible with the Arduino software development environment, which makes usability and introduction a snap. In addition to Arduino hardware and software compatibility, the Intel Galileo Gen 2 board has several PC industry standard I/O ports and features to expand native usage and capabilities beyond the Arduino shield ecosystem. A full-sized mini-PCI Express* slot, 100 Mb Ethernet port, Micro-SD slot, 6-pin 3.3V USB TTL UART header, USB host port, USB client port, and 8 Mbyte NOR Flash* come standard on the board. Intel Galileo Gen 2 improves on Gen 1 by replacing the RS-232 console port with a 6-pin 3.3V USB TTL UART header. New additions to the Intel Galileo Gen 2 board include 12-bit pulse-width modulation (PWM), console UART1 redirection to Arduino* headers, 12V Power-over-Ethernet (PoE) capability, and a power regulation system that accepts power supplies from 7V to 15V. The genuine Intel® processor and surrounding native I/O capabilities of the SoC provides for a fully featured offering for both the maker community and students alike. It will also be useful to professional developers who are looking for a simple and cost effective development environment to the more complex Intel® Atom™ processor and Intel® Core™ processor-based designs.

Step 1: Download the Arduino IDE
Please download the Arduino IDE from the following link below.
https://www.arduino.cc/en/main/software

Step 2: Install the Intel I586 Core

F1DB63AIE4ZUPOU.MEDIUM
F28C50BIE4ZUPOO.MEDIUM

You need to install the core that supports the Galileo board in the Arduino IDE before you proceed.

Click on Tools->Board->Boards Manager
The Boards Manager will open. Select the Intel i586 core and click on Install.
Wait until the Arduino IDE completes the installation.

Step 3: Connect the Board to Your PC
To avoid damage to your Galileo, always apply power to the board via the included power supply before connecting to your computer via USB. Once the Galileo is connected to power, connect the Galileo to your computer with the micro-USB cable.

Step 4: Open the Blink Example
Open the LED blink example sketch: File > Examples > 1.Basics > Blink.

Step 5: Select Your Board

F38SUANIE4ZUPP4.MEDIUM

You'll need to select the Intel® Galileo Gen 2 in the Tools > Board menu as shown

Step 6: Select Your Serial Port

FBCLALXIE4ZUPPY.MEDIUM
We are assuming you're running windows.

Select the serial device of the board from the Tools > Serial Port menu. The easiest way to find what port the board is using is by disconnecting your board, restarting the IDE, and re-opening the menu; the entry that disappears should be the Intel® Galielo Gen 2 board. Reconnect the board, restart the IDE, and select that serial port.

The port is likely to be COM3 or higher and is called "Intel Galileo Gen 2 Virtual Com Port" in the Device Manager. It is NOT "USB Serial Port". COM1 and COM2 are usually reserved for hardware serial ports:

Step 7: Upload and Run the Program

FBUKFCGIE4ZUPPX.MEDIUM

F82FLYHIE4ZUPPM.MEDIUM

Click the Upload button in the upper left to load and run the sketch on your board:

You should see a Transfer complete message when it has uploaded. Now your built-in led should blink.

Sketches and Code Examples for Intel® Galileo Development Boards
Below you can find a list of several Arduino* sketches that we show running on an Intel® Galileo Development Board. The documented examples below are based on Arduino* IDE 1.5.3. The examples include a list of hardware required, step-by-step instructions, and a circuit diagram.

Analog

Basic

Communication

Control

Digital
BlinkWithoutDelay (Blinks LED using time interval)
Debounce(Using push button to debounce LED)
DigitalInputPull-up (Demonstrates the use of INPUT_PULLUP)
PushButton (Turns off and on an LED with a Push Button)
StateChangeDetection (Prints state of button to Serial Monitor)

LCD Display

  • Autoscroll(Demonstrates the use of autoscrool method)
  • Blink (makes the cursor block blink)
  • Cursor (Demonstrates the use of cursor method)
  • Display (Demonstrates the use of display and noDisplay methods)
  • HelloWorld (Prints Hello World! to LCD)
  • Scroll (Demonstrates the use of scrollDisplayLeft and scrollDisplayright method)
  • SerialDisplay (Displays text from user input)
  • SetCursor (Demonstrates the use of setCursor method)
  • TextDirection (Demonstrates the use of LeftToRight and RightToLeft methods)

EEPROM

Starter Kit

Strings

Wi-Fi

Tutorial 1 and Step 1 for Input Output Basics and Sound for Intel® Galileo Boards

header1

It's all around you, but can you see it? Sound is a wave of pressure that is composed of frequencies which get transmitted through a medium such as air and water. We as humans have the ability to hear, feel, and experience sound. Machines have a unique and fascinating way of interpreting sound as well.

In this lesson, you'll explore how a microphone sensor interprets sound as measurable numbers. In order to interact with your module, you have to connect it correctly. You'll learn how breadboards work and how to properly connect wires to it for completing a circuit. You will also learn how to calculate resistor values based on the components of your circuit.

Tutorial 1 and Step 2 on Required Equipment for Intel® Galileo Boards

header2

Intel® Galileo Board
Intel Galileo power supply (included in the box)
microUSB cable (Type B)
This lesson uses the following products that are available for purchase separately:

LED (any color)
Breadboard
Jumper wire
Resistors
Analog Sound Sensor

Tutorial 1 and Step 3 on Breadboard for Intel® Galileo Boards
A solderless breadboard can be used for prototyping your next big idea. The great thing about a breadboard is that it's reusable. It's a must have for all of your DIY projects.

header3

The vertical tracks, defined by the + and - symbols, allow current to flow through the entire length of the breadboard.

The horizontal tracks, defined by columns a-j, rows 1-30, allow for current to only flow horizontally.

Most breadboards have the same basic layout. The red and blue vertical lines are commonly used for the Voltage (V) and Ground (GND) power sources. Like most Arduinos, the Intel® Galileo Board is powered by 3.3 V - 5 V volts of electricity. The Intel Galileo Board is powered by 5 V, but supports 3.3 V or 5 V mode. Accessing either voltage is done through the 3.3 V and 5 V pins. There are two pins for ground (GND), and 2 pins for power (PWR).

To get started with some sensors, you'll use 3 wires:

1 for the ground (GND) input
1 for the power (PWR) input
1 to access the module programmatically
Before we start plugging in wires, we need to know how much electricity is required to power the sensor. We can see from the specs of the sound sensor that it uses 3.3 to 5 volts of electricity. When dealing with a sensor you haven't worked with, always read the specification! It is crucial to the success of your circuit that the correct amount of current is distributed. One bad connection, and you can damage your sensor, your Intel Galileo Board, or both.

Tutorial 1 and Step 4 on Basic Input for Intel® Galileo Boards

Step 1: Power up!
Using the red and blue vertical strips on the breadboard, connect any two jumper cables from the breadboard's first or last row to the Galileo; this will free up space on the breadboard for prototyping. Use the set of pins that are below the Intel® Galileo Board logo.
Connect the negative (blue vertical strip) to one of the two 'GND' headers on the board.
Carefully connect the positive (red vertical strip) to the 5 V header pin.

Step 2: Power the sound sensor
Connect two wires from the microphone's PWR and GND pins to the breadboard. Typically on sensors, red wires are for voltage, black is for ground, and the last one is for programmatic communication to and from the sensor.
Connect two other wires from the microphone sensor to the vertical tracks on the breadboard that are associated with PWR and GND.

Step 3: Prepare breadboard for communication with microphone
The middle section of the breadboard distributes an incoming signal horizontally. Connect a jumper cable from the remaining header on the sensor to one of the inner columns of the breadboard.

Using another wire, connect it from the same row to the input pin labeled A0.

pic1

The microphone sensor is powered by the vertical strips. It is programmatically accessible using one of the middle of the breadboard's horizontal track.

Note:
In order to get input values from the microphone, we'll use an analog pin 0, which is referred to in code as A0. Using a function called analogRead, we're able to return a value from 0 to 1023, where 0 is 0 volts and 1023 is 5 volts.

Why a max value of 1023?
Intel Galileo Board's features the AD7298 chip, which is a 10-bit analog-to-digital converter. Using a base-2 numeral system (binary), we get 210 = 1024. In computer science, number sequences begin with zero, hence a max value of 1023.

Step 4: Seeing sound
Once all of the jumper cables are properly connected, carefully plug in the power cable to the Intel Galileo Board. Then connect the microUSB cable to your computer. If it's not already open, open the Arduino program.

Upload the following code to your Intel Galileo Board to run the sketch:

// Declare and assign an integer variable that stores the pin of the microphone sensor
int pin_sound = A0;
// Declare an integer variable that will store the sound sample from the microphone
int sound_sample;
void setup() {
// Begin serial communication at 57600 bits per second.
Serial.begin(57600);
}
void loop() {
// Assign the current sound reading sound_sample
sound_sample = analogRead(pin_sound);
// Print the sound sample to the serial monitor
Serial.println(sound_sample);
}

The word Serial is used to communicate with the microUSB port that is connected to the Intel Galileo Board. It has a function (referred to as a "method" of Serial) called begin. It uses a baud connection of 57600 bits per second.

In order to see what's going on behind the scenes, speak into the microphone, and open up the serial monitor by clicking on the top right of the UI:
pic2
An array of values that represent realtime sound samples coming from the microphone.

As the microphone receives input, you'll notice a change in the output on the Serial Monitor.

The Serial Monitor is used for displaying data between devices. In the setup function, there is a call to a function called Serial.begin. A value of 57600 is passed to this function. This number represents the bits-per-second (baud) that is communicated between the Arduino and the host computer. On the serial monitor, if you're listening to a different baud rate (other than 57600), you may see some funny looking characters that make no sense. Make sure you set it to 57600 baud.

Tutorial 1 and Step 5 on Resistors for Intel® Galileo Boards
Seeing numbers on a screen can get a bit boring. Let's take it a step further and map the microphone data to an LED.

As discussed earlier, the amount of current flowing through a circuit is important to understand. We will use a resistor to limit the flow of current within your circuit to ensure that the LED doesn't get more electricity than it needs to operate.

When taking a closer look at an LED, you'll notice that it only has two points with different lengths, referred to as anode (positive) and cathode (negative). Electricity flows through the anode (long leg, positive charge), into the LED to light it, then back down to the cathode (short leg, negative charge), where it's grounded.

Calculating resistor values

This is Ohm's Law:
(Operating voltage - forward voltage) / current (in amperes) = resistor value

It's used to calculate resistance in a circuit and is represented in “Ohms” using the O symbol.
Operating voltage: the amount of voltage provided by the power supply (5 volts)
Forward voltage: the amount of voltage needed to power the LED (or sensor) you are using (2 volts)
Current: the amount of current needed to operate the LED (or sensor)
Resistance: The amount of resistance needed to regulate current within a circuit
Our LED uses a current of 20mA (milliamps) to be powered enough to not burn out. An amp (ampere) is a unit of measurement used for electric current.

As the specification for basic LEDs states, and like most common LEDs, it has a typical forward voltage of 2.0 V and a rated forward current of 20mA.

20mA = 0.02 amps

TIP: When calculating current where documentation describes the value in milliamps, divide it by 1000 to use it for Ohm's Law.
Like most Arduinos, the Intel® Galileo Board Galileois powered by 5 V (operating voltage). Because an LED only needs 2 V (forward voltage) to be powered, we can get the difference between them and fill in the values to the formula:
(Operating voltage - forward voltage) / current = resistor value

(5 V - 2 V) / 0.02 amps = ?
3 / 0.02 = 150

We need a 150 ohm resistor or greater to complete this circuit.

Choosing the right resistor

In order for our LED to have the right amount of current flowing to them, we need increase the resistance so that less current flows.

It will take 150 ohms or greater to allow for the proper flow of current to occur when the circuit is powered. Since writing the values on a resistor is quite difficult, engineers have created a color code chart that corresponds to resistor values. This makes it easy to select the right resistor.

TIP: The back of the resistor pack we're using has a chart that indicates the colors used for each resistor value. If you're using a different resistor (like a 5 or 6 band), your colors will vary. For later band resistors, please refer to the manufacturer specification.
Each digit in the resistance value corresponds to a different color. We're using a 4-band color code for our resistors.
Since we don't have a resistor for exactly 150 ohms in the resistor pack we're using, we'll use a 220 ohm resistor, which uses the following color code:

  • 2 Red
  • 2 Red
  • 0 Brown

TIP: The third band can be tricky to understand. Since our value is 220 on a 4 band resistor, we use the following formula:
first-band(2) second-band(2) * X = 220
22 * x = 220
Solve for x: 220 / 22 = 10

We see in our 4-band resistor chart (in the back of the resistor package) that 10 = brown, giving us a band of Red, Red, Brown.

Tutorial 1 and Step 6 on Basic Output for Intel® Galileo Boards

Seeing Sound with an LED
In the Basic Input section of this lesson, step 4 describes how to connect the microphone sensor. Using the same circuit, we will expand on it by using an LED.

Step 1: Set up power for the LED
Connect the cathode (short leg) of the LED to the negative (blue vertical strip).
Connect the anode (long leg) of the LED to a section of the middle of the breadboard.

Step 2: Add a resistor
Using the same row as that the anode is connected, connect one side of the resistor.
Using the other half of the breadboard, connect the other end of the resistor in the same row.

Step 3: Connect to pin 9
Connect a wire from the row where the resistor is to pin 9. When this pin is sent a HIGH signal, it will go through the resistor, to the anode, light up the LED, then go to the GND.

6pic1

Here we see the journey of electrical current.

Once you have everything connected properly, run the following sketch:

// Using 'const' we ensure that pin_sound cannot be changed in this sketch
const int pin_sound = A0;
const int led = 9;
int sound_sample;

void setup() {
Serial.begin(57600);
// Set the digital pin 9, the LED, to behave as an output.
pinMode(led, OUTPUT);
}

void loop() {
sound_sample = analogRead(pin_sound);
// Using an if condition, we test to see if the sample is over 100.
if(sound_sample > 100){
// If the sample is over 100, send a high signal to the LED, turing it on
digitalWrite(led, HIGH);
}
else {
// If not, send a LOW signal, turning off the LED
digitalWrite(led, LOW);
}
// Print the sound sample to the serial monitor
Serial.println(sound_sample);
}

Once a sound sample over 100 is read, the LED is sent a HIGH signal, turning it on.

6pic2

Tutorial 1 and Step 7 on Wrapping Up for Intel® Galileo Boards
In this lesson, we learn what machines can hear. From simple outputs using the serial monitor, to LEDs that respond to audio input, we just scratched the surface on what's possible.

We learn how breadboards can help us with extending our micro-controller by providing us with an array of options for plugging in sensors.

Using the serial monitor, we are able to output the incoming values of what the microphone picked up. To see that in the physical world, we connected an LED with an accompanying resistor that helped limit the flow of current. By using Ohm's Law, we were able to calculate the correct amount of resistance needed to not blow out our LED.

Challenges

  • How would you adjust the code to turn the LED on at a lower (volume) sound sample?
  • Connect a few more LEDs to your project and light them up based on the incoming data received from the microphone. Try blinking each LED based on a different range of incoming readings.
  • Open up the fade example (File > Examples > 01.Basics > Fade). How can you use this example code to expand on your code?

Note This code is using pin 9 for the LED, so you can use your current circuit to test it out.

  • When the sample rate reaches a certain value, set the brightness of the LED to dim. Otherwise set it fully bright.

  • The incoming sound data is a bit jagged; there's not a smooth transition between values. How can you use a smoothing technique (calculating average incoming readings) to get steady shifting values?
    Arduino Smoothing Tutorial

Interfacing Keypad and LCD With Intel Galileo

Introduction

F95LEH3IH87JJQ7.MEDIUM

In this tutorial we are going to show you how to interface a liquid crystal display and a keypad with Intel Galileo. In this tutorial we will use a 16x2 LCD,which displays 2 rows or character in 16 columns.

Step 1: Components

FU6WDHNIH87JJQA.MEDIUM

  1. Intel Galileo.

  2. 4x4 matrix keypad.

  3. 16x2 Liquid Crystal Display (LCD).

  4. Potentiometer.

Step 2: Setup and Schematic

FOE97NCIH87JJQ3.MEDIUM

-connect pin 1-VSS of the LCD to ground and also end of the
potentiometer to ground.
-connect pin 2-VDD of the LCD to power, to provide power for the LCD.
-connect pin 3-VEE of the LCD to the variable terminal of the potentiometer.
This pin is used to adjust the contrast of the LCD.
-connect pin 4-RS of the LCD to pin 12 of Galileo.
-connect pin 5-RW of the LCD to ground.
-connect pin 6-E of the LCD to pin 11 of Galileo.
-connect pin 11-D4 of the LCD to pin 5 of Galileo.
-connect pin 12-D5 of the LCD to pin 4 of Galileo.
-connect pin 13-D6 of the LCD to pin 3 of Galileo.
-connect pin 14-D7 of the LCD to pin 2 of Galileo.
-connect pin 13 of Galileo to pin 1 of the keypad.
-connect pin 10 of Galileo to pin 2 of the keypad.
-connect pin 9 of Galileo to pin 3 of the keypad.
-connect pin 8 of Galileo to pin 4 of the keypad.
-connect pin 7 of Galileo to pin 5 of the keypad.
-connect pin 6 of Galileo to pin 6 of the keypad.
-connect pin 1 of Galileo to pin 7 of the keypad.

Step 3: Working

  1. When the project is switched on, power is fed to the LCD and
    the back light goes on.
  2. When the keypad is pressed contact is made between two terminals to represent a character.
  3. Each character is represented by a combination of contact between two terminals.
  4. The character pressed on the keypad is read by the pins of the Galileo.
  5. The Galileo sets a position on the LCD as specified in the program where the Character is to be printed.
  6. It then sends the character to the LCD and it is printed on the set position.This whole process prints the specific character pressed on the key pad on to the LCD.

Step 4: Code

#include <liquidCrystal.h>

#include<Keypad.h>

#include<Wire.h>

const byte rows=4;

const byte cols=3;

char keys[rows][cols]={

{'1','2','3'},

{'4','5','6'},

{'7','8','9'},

{'*','0','#'}

};

byte rowPins[rows]={13,10,9,8};

byte colPins[cols]={7,6,1};

Keypad keypad=Keypad(makeKeymap(keys),rowPins,colPins,rows,cols);

LiquidCrystal Lcd(12,11,5,4,3,2);

void setup() {

Lcd.begin(16,2);

Lcd.setCursor(1,0);

Lcd.print("Press a number");

// put your setup code here, to run once:

}

void loop() {

char key=keypad.getKey();

if(int(key)!=0)

{

Lcd.setCursor(5,1);

Lcd.print(key);

}

}

Moisture Sensor With Intel Galileo

image2-1

  • Things Used In This Project

Hardware components:

  1. Intel Galileo Gen 2
  2. Moisture Sensor
  3. LED (generic)
  4. Breadboard (generic)
  5. Jumper wires (generic)

Software apps and online services:

  1. Microsoft Visual Studio 2015
  2. Microsoft Windows 10 IoT Core

Introduction
Basically A soil moisture sensor measures the water content in soil. With it, you can easily tell when the soil needs more water or when it's over-watered. When the soil moisture is deficient the sensor output value will decrease. This sensor uses the two probes to pass current through the soil and then it reads that resistance to get the moisture level. Wet soil causes the soil to conduct electricity better (less resistance), whereas dry soil conducts electricity poorly (more resistance). You can determine whether or not a plant needs water by observing the results that the sensor outputs. Now by the end of this article you will be able to make your own moisture sensor that can track the water needs of the plants in you garden.

This is how a soil moisture sensor looks:

image1

Requirements

  • Moisture sensor module (Arduino Compatible)
  • Intel Galileo Board
  • Jumper wires
  • Breadboard
  • LED

Interface

  • Power supply: 3.3v or 5v
  • Pin definition:
  • Analog output (Yellow wire)
  • GND (Black wire)
  • Power (Red wire)
  • DO: Digital output interface

image2

The code is written in C++ with Visual Studio that will deploy on Intel Galileo running on Windows.

Here we are using a Gen1 board but you can definitely use any.

Depending on the code, the sensor data is received by the A0 pin. However any analog I/O pin can do the task our sensor was showing values above 300 when the soil is moist and above 500 when it is completely dry but when we place it in water the values drops to 100. Here we attached an LED to alert us when the soil becomes dry or you can do something else with your Advanced Gardening System to alert you that the plant needs water. Also we noticed that different sensors give different values. So perhaps the values for Dry, Moist and Wet soil will be different from mine but you can always play with the values and tabulate them. After a few samples you can finally determine the values for each condition of moisture with your sensor.

The following shows the values when the sensor is placed in water:

image4

The following shows the values when the sensor is in air (dry):

image5

CODE

#include "stdafx.h"
#include "arduino.h"

int _tmain(int argc, _TCHAR* argv[])
{
  return RunArduinoSketch();
}

int led = 13;  // This is the pin the LED is attached to.
int moisture_sensor = 0;

void setup()
{
  pinMode(led, OUTPUT);
}

void loop()
{
  int moisture_sensor_reading = analogRead(moisture_sensor);
  Log(L"Moisture: %d\r\n", moisture_sensor_reading);
  delay(1000);

  if (moisture_sensor_reading>=300)
  {
    digitalWrite(led, HIGH);  // Soil is dry
  }
  else
  {
    digitalWrite(led, LOW);  // Soil is Web
  }
}

Light Follower Robot Using Intel Galileo

FINKZTQIH58PQS4.MEDIUM

Components:

  1. Intel Galileo
  2. Ldr
  3. Potentiometer
  4. breadboard
  5. Operational Amplifier
  6. Darlington transistor
  7. Dc motor
  8. resistor

Step 1: Working

F4NDF8XIH58PQS5.MEDIUM

The project is for controlling a robot using Intel Galileo that takes a signal from a light dependent resistor (ldr) .

Power is fed to the ldr,when the brightness increases current passes through the ldr to the Op Amp,then to the

Galileo board, a signal is then sent from the board to the transistor which switches on the motor,the motor in turn rotates the wheels of the robot thus driving it.

The speed of the robot depends on the amount of light on the ldr, when the light is reduced,the robot slows down and stops.

Step 2: Code

int in=13;
int out=12; 
int pinState=0; 
void setup() {
  pinMode(in,INPUT); 
  pinMode(out,OUTPUT);    
}
void loop() {
 
 pinState=digitalRead(in); 
  if(pinState==HIGH)
  {
    digitalWrite(out,HIGH); 
  }
 
 else
  {
 
   digitalWrite(out,LOW); 
  }  
}