Archive for the ‘Bercianity’ Category

A couple of weeks ago I showed you how to include WiFi communications in your Arduino using the Adafruit CC3000 WiFi board. Now it’s turn for the server side. In this case, my server is going to be the computer, so this work will be done in Java, as my project uses Java in the computer side (and that’s how I did it!). If you want to use C/C++, there is a good tutorial on sockets in C that will teach you how to set up a server using sockets. There is also the choice of using another Arduino with an Adafruit CC3000 WiFi board as the server, but I have not implemented. However, the library for this board includes examples that will help you do that. In case anyone is interested in doing it and cannot make it work, I can take a look. But as I said, Java will be used this time (also we will see how to implement this in another language, since the client implementation is very similar to the server one).

Sin título

Arduino – Computer WiFi communication

First of all, I will explain what I did to establish the communication with my Arduino and then I will point out some details that require some moments to think about.

(more…)

So recently I decided to recover an old project that I started a couple of years ago: Bercianity, a small rover vehicle made out of Lego pieces and controlled by an Arduino. The system was simple: Arduino is the brain of the rover and had a communication with a Java program on my computer. This communication was over USB, so the Serial library was used in the Arduino side. An XBee module was used to perform the wireless communication but the code was still the same.

adafruit_products_2013_09_02_IMG_2118-1024

Adafruit WiFi breakout board

Now I decided to move it so computer and Arduino communicates over WiFi. I wanted to explore the WiFi connection and I believed that the range could be larger than XBee’s. I am going to review here the easy steps that I took to port from Serial to WiFi communication, first on the Arduino side and then on the computer (which will be explained on the next post).

(more…)

Bercianity demonstration

Posted: 04/11/2015 in Bercianity

IMAG0197Yesterday I found this picture of the Bercianity with my old cell phone (Samsung Galaxy 3 i5800) which, as I said previously, worked for this project as an IP camera sending data to my computer. Here it does not have the LED lights, specially the white one which worked as a flash. In order to make the cell phone work as an IP camera, I only had to install an app from the Play Store (Android Market at that time). Once you run the app on the phone, it will tell you the IP address of your phone and the port that the IP camera is using. You only have to access it on your computer with a conventional web explorer and that’s all! I have been talking about projects here but so far I didn’t show any successful results. So I would like to show a video. It shows the Bercianity going around the house as I am recording everything that I am seeing on the computer. It’s 6 minute long in which it only goes around the house and comes back, all controlled from the keyboard of the computer. I hope you enjoy it.

I have uploaded a few days ago the code for both Bercianity and BXDrone projects on GitHub. In each of the repositories you can find both the Arduino and the Java (which is run on the computer) codes. These are the latest versions that I have. As I said in some other posts, Bercianity project is finished, but BXD project is still active, therefore I will be uploading modifications to the code, plus some other repositories for other tests that I am planning to do.

Link to GitHub: https://github.com/JGHawk

PS: Sorry for the parts which are not commented. Any questions can be posted as a comment here or sent by email to me

bercianity1This is one of the first projects I have been working into, and for the record, it’s already finished! The beginning of this little guy comes from both the motivation of being in possession of a (by the way, amazing) LEGO Mindstorms Kit and the need of going beyond what the kit itself offers you. I managed to build some kind of rover with the LEGO Mindstorms Kit with the basics functions it offers but while  looking at some extremely-high-level projects as NASA’s Curiosity (after which this rover has been named) the feature of controlling the movement of the rover and receive live images, all by wireless communication, was very tempting.

 The microcontroller chosen is Arduino Uno. To control the LEGO motors from the Arduino there is this Mindstorms Multiplexer: NXT-MMX, which allows by I2C communication to control up to 2 motors and one additional NXT device. There was also a library available for Arduino to control the NXT-MMX. In wireless terms, the devices used were XBee S2 Modules, with 2mW of signal power, an XBee Shield for Arduino and a USB XBee Shield to connect to the computer. The Arduino was powered by six 1.5V batteries, and as a special feature, it has a white LED working as a flashlight. In order to send live images to the computer, a simple smartphone was used (particularly, the Samsung i5800 Galaxy 3) working as an IP camera. In terms of programming, as some of you may know, Arduino is programmed in C/C++, but for the computer software, JAVA was used as the programming language, not for any special reason but only for knowing how to work with it.

The last feature it had was a light sensor that was measured by the analog inputs on the Arduino and sent as a telemetry to the computer. It has no special application, but it’s an example of some additional telemetry data being sent by the XBee connection.

——–

Les presento al Bercianity

Este es uno de los primeros proyectos en los que he estado trabajando, y por cierto, está terminado! El comienzo de este pequeño viene de la motivación de estar en posesión de un (increíble, por cierto) LEGO Mindstorms Kit y la necesidad de ir más allá de lo que el propio kit te ofrece. Conseguí construir una especie de rover con el LEGO Mindstorms Kit con las funciones básicas que ofrece pero mirando a algún proyecto de un nivel extremadamente alto como el Curiosity de la NASA (por el cual este robot recibe el nombre), la característica de controlar el movimiento del rover y recibir imagen en vivo, todo por comunicación inalámbrica, era bastante tentadora.

El microcontrolador elegido es el Arduino Uno. Para controlar los motores de LEGO desde el Arduino existe este multiplexor de Mindstorms: NXT-MMX, el cual permite por comunicación I2C controlar hasta 2 motores y un dispositivo NXT adicional. Existe además una librería disponible para Arduino para controlar el NXT-MMX. En el plano de comunicación inalámbrica, los dispositivos usados fueron los XBee S2 Modules, con 2mW de potencia de señal, un XBee Shield para Arduino y un USB XBee Shield para conectarlo al ordenador. El Arduino estaba alimentado por 6 pilas de 1.5V, y como función especial, tenía un pequeño LED blanco funcionando como linterna. Para enviar imágenes en vivo al ordenador se usaba un simple smartphone (en concreto el Samsung i5800 Galaxy 3) funcionando como cámara IP. En cuestión de programación, como algunos de vosotros sabréis, Arduino está programado en C/C++, pero para el software del ordenador se ha utilizado JAVA como lenguaje de programación, no por ninguna razón especial, sino por el hecho de que conocía cómo trabajar con él.

La última característica que tenía era un sensor de luz cuyo valor era medido por las entradas analógicas del Arduino y enviadas como telemetría al ordeandor. No tiene una aplicación especial, pero es un ejemplo de envío de telemetría adicional por la conexion XBee.