Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Using hardware post and replies

Return to the Using hardware thread
Login to post to this thread

Using Arduino boards with EJS - Feb 2, 2013 at 11:55AM
Francisco Esquembre
165 Posts

EJS has now new a Model Elements to control Arduino boards.

The best way to learn how to use it is to inspect an examples. See attached zip with an example.

Before you start, you need to download and install Arduino standard software from This allows you to install the drivers for your computers AND install in your Arduino board the script StandardFirmata. Both things are a must before using the example attached. You install the script by running the Arduino software and selecting "File->Examples->Firmata->StandardFirmata. Then, click the "Upload" icon (looks like a small right arrow) in the task bar of the Arduino software. This step needs to be done only once (per board).

Now, open the attached Arduino example in the latest EJS and inspect the example (in particular, the Model -> Elements tab).

You need additional hardware for making things work. The boards just act as I/O boards. Whatever software you attach to them makes the real work. But if you are playing with these boards, you know this already.

Good luck!


Attached File:

Replies to Using Arduino boards with EJS

Re: Using Arduino boards with EJS - Mar 25 2013 8:03PM
Diego Racero
11 Posts

Hi Franciso, I`m now experimenting wiht Arduino Leonardo and I have a question.
In your example you're using linux and the following sentence


Should ¡ld I replace It for


Because I'm using windows and my Arduino board was installed in COM6 and connected through USB port.

Thank in advance for your help.

Re: Re: Using Arduino boards with EJS - Mar 26 2013 3:45AM
Francisco Esquembre
165 Posts

Yes, that should be it. Remember to install the Arduino drivers.
I don't think we have tested the Leonardo board, though...


Re: Re: Re: Using Arduino boards with EJS - Mar 27 2013 8:48AM
Diego Racero
11 Posts

Paco, thank you for your help. I replaced the line you suggested and It works perfectly well.
I used the temperture example but with some modifications because I´m tryin to perform a remote laboratory turning on and turning off a laser diode and illuminate a difraction slit.
Now I´m moving to work in the Moodle integration.

Surely I´ll be requesting for your help again.

Thank you very much in advance for that.

Re: Re: Re: Re: Using Arduino boards with EJS - Mar 02 5:35AM
Daniel Romero
1 Posts

Hello Paco,

I'm trying to do an easy control application with EJS to arduirno. I downloaded your example LedTempServo and I read it carefully. My application is easier than your example. I try to put high some digital arduino outputs, but in your example, when i want to put the output led1on (digital output 8 in aerduino board) and I put to true the checkbox, the digital output 8 remains in a low level.

Could yoy say me why I can't change the value of the digital output in you example with the checkbox?

The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics