LearnOBots Firebot CODI User Manual

Firefighting Manual for CODIBOT
In this activity, we will give CODI the tools and program him in such a way that he will be able to extinguish fires.
STEP 1:
Attach the infrared sensor and the fan to the CODIBOT as shown in the picture.
STEP 2:
STEP 3:
There are two components that we have to connect with the Arduino in this activity.
1. First, connect the infrared sensor to the Arduino, Infrared Sensor has four pins on it, make the connections
as follows:
Infrared Sensor
Arduino
G
GND
+
5V
D0
Digital Pin # 2
2. Second, connect the Actuator with the Arduino. The actuator spins or stops the fan connected to it, make
connections as follows:
Actuator
Arduino
IN1
Digital Pin # 3
GND
GND
STEP 4:
Once the connections have been made startup ArduBlock via Arduino. (for setup and installation see Getting Started Manual). Make the Code as follows:
1. Drag and drop a do loop panel from the control tab.
2. Select a Set Digital Variable panel from the Variables/Constants Tab and snap it as shown.
3. Snap out the High panel from the value slot and insert a digital pin panel from the Pins Tab.
4. Change the digital variable name to Fire and change the digital pin # to 2.
5. Snap a SerialPrintIN panel, replace the message panel with the glue panel, clone the Fire Panel (Right click
and select clone) and snap it as shown in the picture.
6. Snap an if/else loop below the Serial PrintIN panel.
7. Select a “= = “ panel from the Test Tab and snap it in the test slot of the if/else panel.
8. Insert the Fire panel (Clone it by right clicking in it and selecting clone) and the LOW panel as shown.
9. Snap five set digital pin panels and two Analog Pin panels in the then slot and change their values as shown.
10. Select a delay MILLIS milliseconds panel from the control tab, snap it as shown and change its value to 5000.
11. Snap another set of five set digital pin panels and two analog pin panels in the else slot and change their
values as shown in the figure.
12. Upload the code into Arduino.
13. Now your CODIBOT is a firefighter. It will move forward until it encounters a flame, once it finds a fire it will
stop and will turn on its fan to extinguish the fire, once the fire is extinguished the fan will stop and the CODI will move forward.
Loading...