Thursday, 26 April 2012

Pimp your arduino with some wifi

In the last few days I was working with Arduino and the Wifly Shield ( http://www.sparkfun.com/products/9954 ), it's pretty easy to use and there is a good library.

You will find the library on the Arduino forum but this will not work on Arduino 1.0, I am so generous to share with you the library that works. Click here to download.

I really suggest you to buy this shield if you want to put a wifi into your project because you can also doing some stuffs like: ad-hoc wifi, sleep mode,etc...
The Ad-hoc wifi is something that I really like it because you will able to switch your Arduino into an access point , just think about if you want to create a car that you can control it by an Android or Iphone, yes you can use a bluetooth device but the range is limited.

Enjoy your wifi and make something cool.
 

Sunday, 1 April 2012

Take a picture with Arduino

Have you ever thought to attach a camera on your Arduino? Well, today it's your lucky day because I can show you an example of you can connect the Linksprite camera to your Arduino.

Items:
  1. Arduino uno
  2. Linksprite Camera JPEG
  3. SD Reader
Library:
  1. SD
  2. Adafruit VC0706 ( download )
 It's time to connect everything together! Connect your SD Reader as usually, I choose the SD Shield because it's simple to have everything in a pile, after that you can connect your camera on the pins 2,3.

2 => TX
3 => RX


When everything is connected, you need to open the Arduino IDE and try the example of Adafruit, make sure that the CS of the SD Reader it's the right one, otherwise you will not able to run the script.

You should see something like that:

When Arduino has finished to write the image on your SD Card, plug it on your computer and check the result.

**** ATTENTION *****
The example works only on Windows ( maybe OSX as well ).


Issue with Linksprite and Linux


Today, I want to create this article because I have been looking for a solution in 3 months.
The problem was with the magic Linksprite Camera JPEG, that you can buy on Sparkfun. This camera is a good solution to  have implement a camera on your project.
I was working on my project and I couldn't finish it because I found a problem with the communication between my Arduino and the Camera.


Basically every time that your turn on the camera you should receiver an INIT STRING:

VC0703 1.00
Ctrl infr exist
User-defined sensor
625
Init end

and in HEX codes is:
56 43 30 37 30 33 20 31 2E 30 30 0D 0A 43 74 72 6C 20 69 6E 66 72 20 65 78 69 73 74 0D 0A 55 73 65 72 2D 64 65 66 69 6E 65 64 20 73 65 6E 73 6F 72 0D 0A 36 32 35 0D 0A 49 6E 69 74 20 65 6E 64 0D 0A 

I was checking to get the same init when I was turning on the camera but I was getting something strange:
096A198136999B2C1C11514DE1E4AC90B457595CA82CAFD5175788AC6AD5E45AA4B2B32D6B455DAD5DCE6AFB98D859B498D21E189B7B45A48294BD5A4FC

How you see the result on Linux isn't right, is totally wrong!

I was looking for a solution on the internet, forum, etc... I found one post where a person was talking about the issue to compile the same code on difference OS, in particular that on Windows works and on Linux doesn't.


In the end I tried to use the same Arduino IDE on Linux and Windows and then I compared the result:


Windows:
056433037303320312E3030DA4374726C20696E6672206578697374DA557365722D646566696E65642073656E736F72DA363235DA496E697420656E64DA

Linux:
096A198136999B2C1C11514DE1E4AC90B457595CA82CAFD5175788AC6AD5E45AA4B2B32D6B455DAD5DCE6AFB98D859B498D21E189B7B45A48294BD5A4FC

Evidently there is something wrong on the Linux's compiler.
So, my solution now is to move the project on Windows and finally complete it.

I hope this article will help someone that has got the same problem.