zondag 31 augustus 2014

Espruino roadtest - the (not so) useless machine

Espruino roadtest

I received an espruino microcontroller to test and review for element 14.
An espruino is a microcontroller which is runs javascript.



However, when I received the espruino I had limited time and we were soon to go on holidays for three weeks to Italy. Besides that it was also an objective to involve my son in programming the espruino.

So I came up with a simple idea to create a useless machine, not as sophisticated as many do but just a simple device to experience the programming and the hardware.


The idea of a useless machine is that when you flip a switch an arm will appear and switch it off again. In our design the arm is not hidden, but in a 'rest' position.

Just before we went to Italy my son and I made the board on which the switch and servo were mounted and I made a PCB with some connections for the battery, servo and switch. I also soldered a resistor for the pull-down configuration and connection headers on the espruino. The hardware was finished, now only the software needed to be done.

One nice part of the espruino is the IDE. 

You can start with the graphical interface (blockly https://code.google.com/p/blockly/) and when you feel limited you can switch to the textual interface (javascript).
Graphical programming using blockly

A very nice aspect of this interface is that you can enter a command in the terminal interface and this command will be executed immediately. In this way you can test a command easily and when satisfied continue with your coding.

One other very nice aspect is that you can use the IDE on a lot of OS'es (Windows, OSX, Linux, etc.). I use a chromebook and this is the first microcontroller that I can program completely from my chromebook.

I like the espruino very much, it's easy to use and works very well with my chromebook. Also it's great for kids, my son really liked the blockly and coding with it!





After some explanation of servo's, pulses, frequency etc. my son was able to program the espruino so the useless machine worked:
The pulse and the pull-down resistor

the 3 blocks of our program




dinsdag 11 juni 2013

The Lego Technic Elevator - controlled by a Raspberry Pi and a PiFace Digital

The idea of this project was born when we needed to test the PiFace Digital as a roadtest for element 14.

When I proposed the idea of building an elevator my son did not know where to start. So we explored the internet, saw some designs, but no building plan or instructions were found.

Then we stumbled upon Linda Hamilton's site: http://www.marshall.edu/LEGO/lessonplans/Elevator09/Elevator.html

So there was a design we wanted to build!

We contacted Linda, and she was so kind to share her design with us using Lego Digital Designer (very nice tool!).

So with a few tweaks we built the elevator:






And it works!


Now it was time to let the Raspberry Pi control it!

We needed to create some special Lego bricks, like a connector for the motor:



And the microswitches:


So now we hooked it all up. We fitted the switches at the bottom:


And at the top:


Added a relay switch to be able to inverse polarity and direction of the motor:


 Connected the motor:


And then connected it al to the PiFace:


Now it was time to do some programming:



And this is the result:



Thanks for reading, and special thanks to Linda Hamilton for the design!!

--- edit 16 june 2013 ---

As you might have noticed, at the top the engine forces the elevator to tilt a little before the elevator stops. I assumed it was because of the slow perfomance of scratch, so I tried programming in Python. To my surprise, it made no difference.

So I took a closer look at the mechanical construction, and modified the wheels:


Now the elevator cage is moving smoother and when at the top the switch is pressed earlier, resulting in almost no tilting:


The python script:



I noticed that the Raspberry Pi still takes up 100% processor usage, probably caused by the while True loop?




maandag 3 december 2012

Spin-off van Het Arduino - de Lange Programma

The Raspuino Files... waaat?

Als een vervolg/spin-off van Het Arduino - de Lange Programma wordt er ook geĆ«xperimenteerd met de Raspberry Pi gekoppeld aan de Arduino.

Raspberry Pi:

the case

the contents