Skip to content

Scratch for Arduino (S4A) Setup Instructions

Complete Installation and Configuration Guide

What is S4A?

Scratch for Arduino (S4A) is a modified version of Scratch that allows you to control Arduino hardware using visual programming blocks. It's perfect for beginners who want to do physical computing without learning text-based programming.

Key Features: - Visual, block-based programming (like Scratch) - Direct Arduino control - Real-time sensor reading - Easy to learn, powerful to use


System Requirements

Windows

  • Windows 7 or later
  • USB port
  • Internet connection (for download)

Mac

  • macOS 10.9 or later
  • USB port
  • Internet connection (for download)

Linux

  • Most distributions supported
  • USB port
  • Internet connection (for download)

Step-by-Step Installation

Step 1: Download S4A

  1. Go to: http://s4a.cat
  2. Click: "Download" button
  3. Select: Your operating system
  4. Download: The installer file
  5. Save: To your Downloads folder

Alternative Download: - Direct link: http://s4a.cat/downloads/S4A16.zip (Windows) - Check website for latest version

Step 2: Install Arduino Drivers

Why: Your computer needs to recognize the Arduino board.

Windows

Automatic Installation (Recommended): 1. Connect Arduino to computer via USB 2. Windows should automatically detect and install drivers 3. Wait for "Device ready" notification

Manual Installation (If Needed): 1. Download Arduino IDE from: https://www.arduino.cc/en/software 2. Install Arduino IDE (includes drivers) 3. Or download drivers separately from Arduino website

Verify Installation: 1. Open Device Manager (Windows Key + X, then select Device Manager) 2. Look for "Arduino Uno" under "Ports (COM & LPT)" 3. Note the COM port number (e.g., COM3, COM4)

Mac

Automatic Installation: 1. Connect Arduino to computer via USB 2. Mac should automatically recognize device 3. No additional drivers needed for most Macs

Verify Installation: 1. Open System Information 2. Go to USB section 3. Look for "Arduino Uno"

Linux

Installation:

# Ubuntu/Debian
sudo apt-get install arduino

# Or add user to dialout group
sudo usermod -a -G dialout $USER
# Log out and back in

Verify Installation:

ls /dev/ttyACM*  # or /dev/ttyUSB*

Step 3: Install S4A

Windows

  1. Extract ZIP file:
  2. Right-click downloaded file
  3. Select "Extract All"
  4. Choose extraction location

  5. Run S4A:

  6. Navigate to extracted folder
  7. Double-click "S4A.exe"
  8. No installation needed (portable version)

  9. Create Shortcut (Optional):

  10. Right-click S4A.exe
  11. Select "Create Shortcut"
  12. Move shortcut to Desktop

Mac

  1. Extract ZIP file:
  2. Double-click downloaded .zip file
  3. It will extract automatically

  4. Move to Applications:

  5. Drag S4A folder to Applications folder

  6. Run S4A:

  7. Open Applications folder
  8. Double-click S4A application
  9. If security warning appears:
    • Go to System Preferences → Security & Privacy
    • Click "Open Anyway"

Linux

  1. Extract:

    unzip S4A16.zip
    cd S4A16
    

  2. Make Executable:

    chmod +x S4A
    

  3. Run:

    ./S4A
    


Step 4: Upload Firmware to Arduino

Important: This step is required once per Arduino board.

Why Firmware?

  • S4A needs special firmware on Arduino to communicate
  • Firmware allows Scratch blocks to control Arduino
  • Must be uploaded before first use

Upload Process

  1. Connect Arduino:
  2. Connect Arduino to computer via USB
  3. Wait for computer to recognize it
  4. Note the COM port (Windows) or device name (Mac/Linux)

  5. Open S4A:

  6. Launch S4A application
  7. Wait for interface to load

  8. Upload Firmware:

  9. In S4A, go to "Board" menu
  10. Select "Upload Firmware"
  11. Wait for upload process
  12. Look for "Firmware uploaded successfully" message

  13. Verify Connection:

  14. In S4A, you should see "Arduino found on [port]"
  15. Green indicator shows connection status

Troubleshooting Firmware Upload

Problem: "Arduino not found" - Solution: Check USB connection, try different USB port - Solution: Verify drivers are installed - Solution: Close other programs using Arduino (Arduino IDE)

Problem: "Upload failed" - Solution: Disconnect and reconnect Arduino - Solution: Try different USB cable - Solution: Restart S4A

Problem: "Permission denied" (Linux) - Solution: Add user to dialout group:

sudo usermod -a -G dialout $USER
- Solution: Log out and back in


Step 5: Test Your Setup

  1. Open S4A

  2. Create Simple Script:

  3. From Events, drag when green flag clicked
  4. From Control, drag forever block
  5. From S4A category (special blocks), drag:

    • digital pin 13 on
    • wait 1 secs
    • digital pin 13 off
    • wait 1 secs
  6. Connect Blocks:

    when green flag clicked
    forever
        digital pin 13 on
        wait 1 secs
        digital pin 13 off
        wait 1 secs
    end
    

  7. Click Green Flag:

  8. LED on Arduino board should blink
  9. If it works, setup is successful!

If Test Fails

Check: - Arduino is connected via USB - Firmware is uploaded - Correct COM port selected (if multiple ports) - S4A shows "Arduino found"

Try: - Re-upload firmware - Restart S4A - Reconnect Arduino - Check USB cable


S4A Interface Overview

Main Window

┌─────────────────────────────────────────┐
│  File  Edit  Share  [Menu Bar]        │
├──────────┬──────────────┬──────────────┤
│          │              │              │
│  Stage   │  Scripts    │  Blocks     │
│  Area    │  Area        │  Palette    │
│          │              │              │
│          │              │              │
│          ├──────────────┤              │
│          │  Sprite List │              │
│          └──────────────┘              │
└─────────────────────────────────────────┘

S4A-Specific Blocks

S4A Category (Special Blocks):

Digital Output: - digital pin [X] on - Turn pin HIGH - digital pin [X] off - Turn pin LOW

Analog Output (PWM): - analog pin [X] to [value] - Set PWM value (0-255)

Digital Input: - digital pin [X] - Read digital value (0 or 1)

Analog Input: - analog pin [X] - Read analog value (0-1023)

Servo Control: - servo pin [X] to [angle] - Set servo angle (0-180)

Special: - board connected? - Check if Arduino is connected - reset all digital pins - Reset all pins to LOW


Configuration Settings

Selecting COM Port (Windows)

  1. In S4A:
  2. Go to "Board" menu
  3. Select "Select Serial Port"
  4. Choose correct COM port (e.g., COM3, COM4)

  5. Finding COM Port:

  6. Open Device Manager
  7. Look under "Ports (COM & LPT)"
  8. Find "Arduino Uno" and note COM number

Selecting Device (Mac/Linux)

  1. In S4A:
  2. Go to "Board" menu
  3. Select "Select Serial Port"
  4. Choose device (e.g., /dev/tty.usbmodem...)

  5. Finding Device:

  6. Mac: System Information → USB
  7. Linux: ls /dev/ttyACM* or /dev/ttyUSB*

Common Issues and Solutions

Issue 1: S4A Won't Start

Windows: - Check if .NET Framework is installed - Try running as Administrator - Check antivirus isn't blocking it

Mac: - Check security settings - Allow in System Preferences → Security

Linux: - Check permissions - Install required libraries

Issue 2: Arduino Not Found

Solutions: - Verify USB connection - Check COM port selection - Re-upload firmware - Try different USB port - Restart S4A

Issue 3: Blocks Don't Work

Solutions: - Verify firmware is uploaded - Check Arduino is connected - Verify correct pin numbers - Check wiring connections

Issue 4: Connection Drops

Solutions: - Check USB cable quality - Try different USB port - Avoid USB hubs (use direct connection) - Check power supply


Best Practices

  1. Always Upload Firmware First
  2. Required for each new Arduino
  3. Re-upload if having connection issues

  4. Check Connection Status

  5. Look for "Arduino found" message
  6. Green indicator shows connection

  7. Save Your Projects

  8. S4A projects save as .sb files
  9. Save frequently
  10. Use descriptive names

  11. Test Incrementally

  12. Test simple code first
  13. Add complexity gradually
  14. Verify each step works

  15. Keep S4A Updated

  16. Check website for updates
  17. New versions may have bug fixes

Alternative: Arduino IDE

If S4A doesn't work, you can use Arduino IDE: - Download from: https://www.arduino.cc/en/software - More complex but more powerful - Text-based programming (C++) - Can upload S4A firmware manually

Uploading S4A Firmware via Arduino IDE: 1. Download S4A firmware from S4A website 2. Open in Arduino IDE 3. Select correct board and port 4. Upload to Arduino


Quick Reference

Installation Checklist

  • [ ] Downloaded S4A
  • [ ] Installed Arduino drivers
  • [ ] Extracted/installed S4A
  • [ ] Connected Arduino via USB
  • [ ] Uploaded firmware to Arduino
  • [ ] Tested with simple blink program
  • [ ] Verified connection status

First Project Checklist

  • [ ] Arduino connected and recognized
  • [ ] Firmware uploaded
  • [ ] Correct COM port selected
  • [ ] Simple test program works
  • [ ] Ready for Day 3 projects!

Support Resources

Official Resources

  • S4A Website: http://s4a.cat
  • S4A Documentation: http://s4a.cat/docs
  • S4A Forum: Check website for community links

Troubleshooting

  • Check S4A website FAQ
  • Search online forums
  • Ask workshop facilitators
  • Check Arduino official documentation

Next Steps

After successful setup: 1. Practice with simple projects 2. Explore S4A blocks 3. Try Day 3 projects 4. Experiment with sensors 5. Design your own projects

Remember: If you encounter issues, don't hesitate to ask for help. Setup problems are common and usually easy to fix!