“Scratch” is programming language designed for elementary and middle school students. Instead of using difficult English code, students can easily write programs by attaching blocks together, allowing them to create animations and games in an intuitive manner. In addition, by using the extension function, you can experience electrical control of real-life objects in combination with “Arduino,” which is often used for electrical engineering.
This page describes electrical control and programming in combination with models distributed on this site. You can download programs for “Scrattino” for each content.
Microcomputers, LEDs and other electrical components
Arduino UNO can be substituted with “compatible” in addition to the original Arduino UNO. Compatibles are often sold in sets that include LEDs, jumpers (wires), and other items necessary for electrical construction, so you can buy a set and have everything you need in no time!。
This software allows you to use Scratch offline, and includes an extension function to work with Arduino, so you can write programs more easily than with the Arduino IDE below.
This is editor for writing programs to the Arduino. As we will describe later, you cannot write Scratch programs directly to the Arduino, so you will need this software to write intermediary programs. Once you are on the site, go to “DOWNLOAD OPTIONS” and download the latest version of the Arduino IDE for your operating system.
Arduino Editor Download Site
2.Preparation before programing
Arduino cannot directly write programs created in Scratch. Therefore, you need to write an intermediary program between Scratch and Arduino. The intermediary program is prepared in the Arduino IDE, so we will use it. As shown in the figure below, select “File → Exsamples → Firmata → StandardFirmata” with the cursor in that order to open the intermediary program.
To select the Arduino destination to write to, move the cursor to Tools→Port→Serial Port. The port name depends on where you plugged in the USB, and if it is a genuine Arduino, the type name will also be displayed.
Finally, press the upload button to write the program to the Arduino. If the program is written correctly, the message “Done Uploading” will appear and you can use the Arduino with Scrattino. If the writing does not work and an error message appears, try unplugging and plugging in the USB port again, or try a different USB port.
3.Light up “My Platform”!
My Platform is a pedestal on which the “3Dino Puzzle” can be displayed, and LEDs can be used as spotlights to light it up.
Choose your favorite 3dinos and create your own museum.
3-1.Wiring for LEDs
Insert the LED into the spotlight on My platform. The spotlight on the platform should be put through a nearby hole before inserting the LED.
The spotlight on the light stand side can be easily turned down by inserting the LED and then passing it through the ceiling bracket from below.
Next, we will connect the electrical circuit. Insert resistors into the breadboard as shown below. The breadboard has the body facing horizontally so that electricity can pass through the electronic components inserted in each vertical row. You can easily enjoy electrical construction without direct soldering.
Next, wire the LED by plugging the + side (anode) of the LED into one of the Arduino’s digital pins 2 to 13. In this case, we will plug it into D2 to D5 for simplicity. After inserting all the pins, insert the – side (cathode) into the same row as one side of the resistor that was inserted separately.
Finally, plug the resistors into the pins marked “GND” on the Arduino. (There are several GND pins, but you can connect to any of them.)
Once the wiring is done, place the puzzle on the platform. The assembly instruction include a nameplate for attaching to the sign, so cut it out with scissors and attach it. When you have finished placing the puzzle, connect the Arduino to the computer.
3-2.Light up with Scrattino
STAG.B has a program for Scratch that allows you to operate the light-up as soon as you connect the LEDs to the Arduino. Press the button on the Scrattino screen and the LEDs will light up in conjunction with the animation. Click the button below to download the program!。
After launching Scrattino, open the Scratch program downloaded above by selecting “File→ Load from your computer” with the cursor over it.
Once opened, press the “Add Extension” button in the lower left corner and select “Scrattino”.
If the Arduino is correctly recognized, it will appear in the list. When it appears, select “Connect” and when it is connected, select “Go to Editor” to return.
Now everything is connected. Now it’s time to light up My Platform with Scrattino!
When a button on the Scratch screen is pressed, the LED connected to the corresponding pin will light up.
Darken the room and light it up and you have mini museum!
4.Let’s make pumpkin lantern!
The pumpkin-shaped “Roll Pumpkin” can be decorated on a special pedestal and turned into a lantern by inserting LEDs. There are two types of pedestals, one for one pumpkin and one for seven pumpkins, so choose the one you prefer.
4-1.Wiring for LEDs
There are two holes on the bottom of the pumpkin, one for the LED and the other for fixing it to the base. The hole in the front is for the LED and the hole in the back is for the joint. After fixing the pumpkin to the pedestal, insert the LED from the back of the pedestal to the back of the pumpkin.
After inserting the LEDs, run the wires to the groove on the back of the base, and wire them as you did for “My Platform”: for a single LED, connect the “+” side of the LED to “D3” on the Arduino.
The pedestal for 7 pieces has the same construction. When matching the program for Scrattino below, wire the pins so that they are the same as those assigned in the diagram.
4-2.Light up with Scrattino
We have prepared a special Scrattino program for the Roll Pumpkin as well, which allows you to press a button on the Scrattino screen to light up an LED in conjunction with the animation. Click the button below to download the program.。
Once you have darkened the room, you can start lighting it up by pressing the buttons on the Scrattino screen, each of which will light up in a different way. Try it!
The one for 7 pieces will be more Halloweeny and colorful!