DIGITAL INPUT

  • In sake to detect the obstacles we have to equip the robot with the "touch sensor". This sensor is basically a switch or a key, which toggles it's output between GND and +5 V voltage potentials.
  • Follow video instructions to construct bumper in front of the robot.

Questions:

  1. Do you hear "clicking" sound when you push the bumper?
  2. Name the mechanical mechanism where smaller force on one end can cause greater force on the other end of the mechanism.

Tasks: CONNECT THE SWITCH

The key has three connecting terminals. Each of one is marked with the number 1, 2 or 3. Connect them in right order. Connect the key terminals in order that are specified in presentation and listed as:

  1. connect to RobDuino C0 terminal.
  2. connect to RobDuino voltage terminal GND.
  3. connect to RobDuino voltage terminal +5V.

Questions:

  1. What is the output voltage (measure it) of the sensor when the robot is (or is NOT) touching the obstacle?
  2. How many different states can we measure at the output of the sensor?
  3. Name several more examples where digital sensor can take place.

Summary:

Digital sensors

The output of a digital sensor can be just in two states:

  • logical "0" - presented in voltage as 0 V.
  • logical "1" - presented in voltage as +5V.

Issues:

Robot has no power since I connected the key as a sensor.

Probably the key or switch is connected wrong and there is short connection between the GND and +5V voltage terminals. Unconnect the key or switch and verify if the power is back.

Tasks: READING DIGITAL INPUT

  1. Write the program shown in the presentation to test the readings of the digital sensor.
  2. Then … complete the program to turn OFF the LED when the bumper is not touching anything.
  3. Next … Change IF statements into single one IF-THEN-ELSE statement.
  4. Advanced … Solve the problem without IF statement.

Questions:

  1. Check if the LED on the output terminal D3 is turend ON when the bummper is pressed.

Summary:

<++>

<++>

Issues:

<++>

<++>