This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-10-27 13:58:41

scratch-citilab
New Scratcher
Registered: 2010-09-02
Posts: 9

Scratch for Arduino (S4A)

After a long work, we've released a mod of Scratch which allows controlling sensors and actuators through an Arduino board.

More info: http://seaside.citilab.eu/scratch/arduino

We hope your feedback and suggestions  smile

Offline

 

#2 2010-10-28 21:12:23

iwansuryo
Scratcher
Registered: 2008-05-16
Posts: 29

Re: Scratch for Arduino (S4A)

Thank you very much! I hope that you can give sample programming and schematics to use this for XBee remote controller like what you have shown on the video.

This is a big leap on the education of robotic programming. This is my dream come true. Can it run smoothly with ArduinoBT which has bluetooth interface? Can it detect ArduinoBT without any modification?

Now the next part is to make it just like Modkit. My arduino code from scratch should be able to run without any connection to my computer. I think S4A will be perfect if it culd be run in two mode: tethered and untethered!

Once again, thank you very muuuuuuuuuuuuuuuch. Warm greetings from Indonesia.

Iwan Suryolaksono

Offline

 

#3 2010-10-29 14:36:56

scratch-citilab
New Scratcher
Registered: 2010-09-02
Posts: 9

Re: Scratch for Arduino (S4A)

Thank you for your post and for giving a chance to this project, iwansuryo!

We didn't tested it with ArduinoBT (not yet), but we guess that should not be a problem... the only requirement is the connection bitrate, which is 38400 (we used it mainly for compatibility with XBee, higuer values didn't work right). If you need help setting up a XBee module just ask us!

About the other point, unfortunately it can't be used in a "unthetered" mode, because it works similarly as a "client-server" framework. Basically this is the process:

1. Board (Arduino) receives data from sensors and report it to the PC (S4A).
2. PC receives sensor data and send instructions to board.
3. Board receives instructions and execute them.

We hope make it self-sufficient in a future, but at this moment this is what we have  smile

PS: We've just uploaded some basic examples, please check our downloads section!

Offline

 

#4 2010-11-19 00:11:29

joelpg
New Scratcher
Registered: 2010-11-18
Posts: 2

Re: Scratch for Arduino (S4A)

Does anyone know if S4A source code is available?  I REALLY like what CitiLab group has developed, but it does not quite do what i require for my student project (but i'm not complaining because i can see they've already done quite a lot of work - thanks!). 

Maybe i'm missing something, but i don't see how i can control a standard RC servo motor with S4A.  I'd like to be able command the servo to go to a particular angle, but that capability does not seem to exist (?) - just continuous rotation servo capability.

Also, does anyone know if there exists a 'write serial port' / 'read serial port' block in scratch?  This might help to make a scratch-to-hardware interface a bit more flexible.

thanks
joel

Offline

 

#5 2010-11-19 15:38:35

joelpg
New Scratcher
Registered: 2010-11-18
Posts: 2

Re: Scratch for Arduino (S4A)

Never mind on the source.  My ignorance about Squeak is obvious. 
Jordi from CitiLab.eu helped straighten me out:

"The source code is available in the image you already have. Just press shift and click the 'File' menu. You will see a new option 'Exit user mode'.
And that's it! The S4A presentation shrinks and you have access to a menu clicking on the background. Choose 'open' -> 'browser' and there you are, a Smalltalk browser ready to code.
You will end up in a Squeak image. Let me warn you. Scratch and S4A are implemented in Smalltalk, more precisely in Squeak 2.8 (a very old Squeak version, indeed).
So, you need to know how to work in a Squeak image and, of course, Smalltalk."

thanks Jordi.

-joel

Offline

 

#6 2010-11-25 03:51:24

mherma
New Scratcher
Registered: 2010-07-14
Posts: 8

Re: Scratch for Arduino (S4A)

Thank you very much! That’s great.

I want to test your program in my class (12 years old boys and girls). We tried to build a robot like yours in your video.

We have three problems:

1. We use continuous rotation servos. Unfortunately one servo is slower than the other. So we tried to regulate it with two encoders (We use two Transmissive Optical Sensor with Schmitt-Trigger Logic Output). But I think the reading is too slow (only every 75ms). We only get exact values, if we detect only 1 or 2 interrupts per rotation.

2. We want to control our robots with Xbee remote controllers. Can you send us your sample programm and schematics how to use the xbee.

3. Like joelpg, we want to control a standard RC servo motor with S4A. Is it possible to command the servo to go to a particular angle.

We would be very glad, if you can send us the example code from your robots.
Thank you very much
Michael

Offline

 

#7 2010-12-02 11:21:56

scratch-citilab
New Scratcher
Registered: 2010-09-02
Posts: 9

Re: Scratch for Arduino (S4A)

Hi Michael,

Thanks to you for using S4A, we hope you find it useful for your classes, and don't hesitate to ask for help if needed. Ok let's see:

1. We don't have such problem with our servos, maybe they're of the same type. At this moment we can't change the reading value because it's set by the step process of Scratch, but we'll try to fix it in a future.

2. A S4A project will be the same if you use a XBee or USB connection, so you only have to ensure that XBee is configured correctly. Anyway we can help you if you have any problem on it.

3. Unfortunately at this time we don't have that kind of servos. Until we get one of them we can't work on a new firmware that can handle it.

There are many examples on the web (perhaps too much basic for you) but we can send you the program used on the video demo if you want.

Thanks again for your feedback!

Best regards,

Offline

 

#8 2010-12-02 16:52:49

dbn300100
Scratcher
Registered: 2010-01-10
Posts: 36

Re: Scratch for Arduino (S4A)

This will be great for projects


This Is Dbn!!!!!!!!!!!!!!!!

Offline

 

#9 2011-02-07 11:03:17

jjviton
New Scratcher
Registered: 2011-02-06
Posts: 12

Re: Scratch for Arduino (S4A)

Hi
First of all congratulations for this great project. It going to be very useful for all of us working with young people in programing and robotic.
I would like to comen two points:
Regardig motors, now your system control is all/nothing forward/back... don´t you think it would be interesting to control a real servo (http://www.seattlerobotics.org/guide/servos.html) been able to locate the arm in a concrete position? (reading your aurdino code, it would be easy thanks to pwm.)
.-Second, I don´t see the radio comunication system of your robot, where is the second Bee transciver?
thanks and congratulations again.

Offline

 

#10 2011-04-05 20:55:25

lep007
New Scratcher
Registered: 2011-03-31
Posts: 1

Re: Scratch for Arduino (S4A)

I have to say,there are genius on the Internet.Actually ,i am planning to make a graphical programing  software like S4A.And the source code would be opened.

Offline

 

#11 2011-05-13 20:16:35

mrsrec
Scratcher
Registered: 2010-11-14
Posts: 100+

Re: Scratch for Arduino (S4A)

Ah,I See I'm Not The Only One Who Knows About The Software.   wink


Scratchy Scratcher Scratched Scratch Scratches When He Scratchy Scratches Scratch Projects. These Scratch Projects Were Started From Scratch.
http://internetometer.com/image/37716.png

Offline

 

#12 2011-07-02 18:03:10

siscratch
New Scratcher
Registered: 2011-03-12
Posts: 3

Re: Scratch for Arduino (S4A)

Hey,
So I'm really interested in controlling a robot wirelessly using an xbee but I thought you have to have two xbee transceivers in order to communicate.  The video only shows one: http://www.scratch.mit.edu/ext/youtube/?v=IzGGv9xkkRs   However, I have two xbees just in case and know how to configure them using Putty.exe, but does S4A automatically establish a connection after they have been configured at 38400 baud rate?  Could you help me with how to establish a connection between an xbee and a Mac OS X 10.6 AND/OR two xbee's, where I'm guessing one xbee is on the controller and the other xbee is on the robot.  (controller xbee communicating to robot).  And on the xbee shield do I need to change the jumper pins from "usb" to "xbee".

Offline

 

#13 2011-07-02 18:15:52

siscratch
New Scratcher
Registered: 2011-03-12
Posts: 3

Re: Scratch for Arduino (S4A)

So far i've configured the xbee's at a 9600 baud rate.  I two more xbee's (I have 4 total) and tried to configure them at 38400, which did not work.  Should they be configured at 38400 baud rate?

I used this tutorial video to learn how to configure xbees, which worked for me:
http://www.scratch.mit.edu/ext/youtube/?v=vKVNmA8C6m8

Offline

 

#14 2011-07-02 18:18:53

siscratch
New Scratcher
Registered: 2011-03-12
Posts: 3

Re: Scratch for Arduino (S4A)

lastly I used the xbee explorer to configure the xbees

Offline

 

#15 2011-08-04 13:36:32

scratchisthebest
Scratcher
Registered: 2009-02-08
Posts: 500+

Re: Scratch for Arduino (S4A)

Wow! That's neat! So I can learn about the Arduino without that much Processing!

Now I really want my Arduino to arrive!


bye 1.4, we all loved you. but we all outgrew the site. 2.0 is a welcome change.
http://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.png

Offline

 

#16 2011-08-05 06:21:56

SimpleScratch
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: Scratch for Arduino (S4A)

I got an Arduino Uno starter kit as a birthday present yesterday and have made a simple set of traffic lights using 3 LEDs controlled by S4A  smile

At last - I can use Scratch to control the world!!! :-)

Simon

Offline

 

#17 2011-09-14 14:23:11

scratch-citilab
New Scratcher
Registered: 2010-09-02
Posts: 9

Re: Scratch for Arduino (S4A)

Our apologies for not answering for so long! We're going to answer all questions right now. Thanks all again for your comments!

jjviton wrote:

Hi
First of all congratulations for this great project. It going to be very useful for all of us working with young people in programing and robotic.
I would like to comen two points:
Regardig motors, now your system control is all/nothing forward/back... don´t you think it would be interesting to control a real servo (http://www.seattlerobotics.org/guide/servos.html) been able to locate the arm in a concrete position? (reading your aurdino code, it would be easy thanks to pwm.)
.-Second, I don´t see the radio comunication system of your robot, where is the second Bee transciver?
thanks and congratulations again.

Thanks jjviton! Since version 1.2, S4A it's also compatible with standard servos, please take a look on our website and download it (if you haven't already done so). About the xbee, we supose you mean the demo video right? There is a black wire and a small red object next to the laptop, that's the Xbee explorer with the second Xbee module. Sorry for that fail ;(

siscratch wrote:

Hey,
So I'm really interested in controlling a robot wirelessly using an xbee but I thought you have to have two xbee transceivers in order to communicate.  The video only shows one: http://www.youtuberepeat.com/watch?v=IzGGv9xkkRs   However, I have two xbees just in case and know how to configure them using Putty.exe, but does S4A automatically establish a connection after they have been configured at 38400 baud rate?  Could you help me with how to establish a connection between an xbee and a Mac OS X 10.6 AND/OR two xbee's, where I'm guessing one xbee is on the controller and the other xbee is on the robot.  (controller xbee communicating to robot).  And on the xbee shield do I need to change the jumper pins from "usb" to "xbee".

Sorry again for the "hidden" Xbee, hehe. Yep, once both modules are well configured (at 38400 bauds, yes), S4A will be automatically detect the board. And yes, jumpers need to be changed from "usb" to "xbee" at the Xbee shield.

siscratch wrote:

So far i've configured the xbee's at a 9600 baud rate.  I two more xbee's (I have 4 total) and tried to configure them at 38400, which did not work.  Should they be configured at 38400 baud rate?

I used this tutorial video to learn how to configure xbees, which worked for me:
http://www.youtuberepeat.com/watch?v=vKVNmA8C6m8

Yes, S4A is configured by default on 38400 bauds for a serial communication (we tested it with higher values but doesn't work fine) so the Xbee have to be configured at same baud rate.

siscratch wrote:

lastly I used the xbee explorer to configure the xbees

Yes of course, you need it to connect xbee with the computer (don't know other way to do it)

Thanks all again, and if you need help immediately please mail us at scratch@citilab.eu

Offline

 

#18 2011-09-18 18:18:40

SimpleScratch
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: Scratch for Arduino (S4A)

Hi
S4A seems to be having trouble finding my Arduino Uno since I changed its port from COM26 to COM2 - how can I make it "find" it again please

Simon

Offline

 

#19 2011-09-20 10:36:01

scratch-citilab
New Scratcher
Registered: 2010-09-02
Posts: 9

Re: Scratch for Arduino (S4A)

SimpleScratch wrote:

Hi
S4A seems to be having trouble finding my Arduino Uno since I changed its port from COM26 to COM2 - how can I make it "find" it again please

Simon

Hi Simon,

Try right-clicking on the sensor board, click on "select serial/USB port" and select "COM2". If it doesn't work, maybe that port is reserved for other device.

Regards,

Offline

 

#20 2011-10-08 11:05:51

jjviton
New Scratcher
Registered: 2011-02-06
Posts: 12

Re: Scratch for Arduino (S4A)

Hi Comunity,

I'm facing problems installing S4A software in a Ubuntu distribution. Actually is a fatal error, I can not install it. :-(

Any advice??, or it is really incompatible

Offline

 

#21 2011-10-15 10:04:27

jjviton
New Scratcher
Registered: 2011-02-06
Posts: 12

Re: Scratch for Arduino (S4A)

Hi again,
just to inform how I did solve the issue... instead of upgrading Linux OS package to package, I installed a new release of linux completely. Am now s4a works.

bye

Offline

 

#22 2011-11-21 16:37:45

creysiMP
New Scratcher
Registered: 2011-11-21
Posts: 4

Re: Scratch for Arduino (S4A)

Hey community,

I'm facing a problem with my arduino duemilanove and S4A on Mac OS10.7.2. Unfortunately Scratch can't find the board and doesn't show the right port in the selection. Instead of providing me with /dev/tty.usbserial-A400gUZx as the Arduino software does it only has /dev/cu.usbserial-A400gOZx in its list, which doesn't seem to work (even though it does with the arduino software). Any ideas?

Offline

 

#23 2011-11-21 18:47:15

creysiMP
New Scratcher
Registered: 2011-11-21
Posts: 4

Re: Scratch for Arduino (S4A)

creysiMP wrote:

Hey community,

I'm facing a problem with my arduino duemilanove and S4A on Mac OS10.7.2. Unfortunately Scratch can't find the board and doesn't show the right port in the selection. Instead of providing me with /dev/tty.usbserial-A400gUZx as the Arduino software does it only has /dev/cu.usbserial-A400gOZx in its list, which doesn't seem to work (even though it does with the arduino software). Any ideas?

...d'oh. Of course! I should upload the firmware to the board... now my next question is: if I do so, will I be able get the original firmware back if I'd like to use my arduino with the arduino software again?

Offline

 

#24 2011-11-28 07:56:56

hansel90
New Scratcher
Registered: 2011-11-28
Posts: 2

Re: Scratch for Arduino (S4A)

hi.. i am trying to interface S4A with an accelerometer.., i have a firmware for the arduino to be interface with S4A. and i also have a code for the arduino and the accelerometer.., but the problem is how to be able to combine the two codes,,..
badly in need for help.., please  smile ))

Offline

 

#25 2011-12-06 12:17:46

Phydeaux
New Scratcher
Registered: 2011-11-04
Posts: 4

Re: Scratch for Arduino (S4A)

im heading an arduino project for my class, i have s4a installed on the computer. I have issues though, when i open the program, after i connect the arduino uno board of course, i doesnt read the board...i cant do anything with it... does anyone have any advice for me?

Offline

 

Board footer