NILE EGYPTIAN SCHOOLS
Grade 8 worksheet 6
What is the Pico Board?
• The PicoBoard is a piece of hardware called a sensor board that can be combined with
Scratch programming environment to allow your Scratch programs to react (and even
respond) to events happening outside of the computer.
• The PicoBoard has several sensors that can be used directly with the Scratch
programming environment:
Slider: Changes values from 0 to 100 based on the position of the slider.
Light Sensor: Changes values from 0 to 100 based on the amount of light on this sensor.
Button: The position or state of the button controls the button pressed value (true or
false).
Sound Sensor: Changes values from 0 to 100 based on the amount of sound it detects.
Auxiliary Connections (A,B,C,& D): Alligator Clips: These are generic connections to any
resistive sensor. As the resistance changes, so does the input value. This sensor can also
be setup as a digital detector to detect whether the alligator clips are connected.
Example
Traditionally, a motor is an output device, but when
connected to the PicoBoard, you can use the motor as a
generator. Spin the motor and see what happens to your
input values. Simply connect the two wires of the motor to
the two alligator clips.
The sensor table describes each sensor, how you can use it, and the Scratch blocks
that you could use to capture and use the sensor information (Click the image for a
larger view).
Page 2 of 5
How to build a simple data logging program (Scratch)?
1. You will need to make sure that you have successfully loaded the Scratch software and
drivers before starting.
2. Connect the Picoboard to the computer.
Page 3 of 5
3. Connect the temperature sensor to the Picoboard using the crocodile clips.
4. The script involves no movement, so should be written for the Stage (on which a graph
will eventually be plotted).
5. Select
sensing from the list of options in the top left of the screen.
6. You can monitor the sensor inputs on the Stage, by right-clicking on:
7. Select “show ScratchBoard watcher”.
8. Change
Slider to
resistance A (make sure your sensor is connected to port A).
9. Click on Control.
10. Drag a when clicked block to the script.
11.Drag a Repeat block into the Script area under
the when clicked block.
12. Change the 10 to the number of readings you want.
13. Drag a wait block inside the repeat loop.
14. Set it to an interval you want.
Page 4 of 5
15. Click on Variables.
16. There is no means of writing to a file within a script, so:
17. use a list (Click on Make a list and call it temp)
18. Drag add thing to temp inside the Repeat loop
19. drag Resistance A to the word ‘thing’.
20.Click on the green flag to run the script.
21.When the script has run, right-click on the list monitor on the Stage.
22.Export the list as a text file to a folder you have already set up.
23.The contents of the list need to be deleted near the beginning of your script, otherwise
data is simply added to the end of the previous list.
24.The number of measurements and the interval can be set in repeat and wait blocks.
Page 5 of 5