Feeds:
Posts
Comments

Posts Tagged ‘HWProjWeek’

Arduino + Ethernet Shield

Arduino + Ethernet Shield

Some context

So, as I was here today with some residual traces of flu and a cold, I watched a certain (undisclosed) quantity of episodes of TBBT (yeah, yeah, I know, just a couple years later than all the others), and all of a sudden I thought of a very nerdy way of solving a little problem I had here (an idea somewhat similar to this one, at least from a certain point of view).

The problem was the following: I have an Asus Eeebox (one of the first models) that is being used with XBMC as a HTPC, of course without a mouse or a keyboard; I have a little infrared remote for navigating through the menus and stuff. Now, the problem comes when one wants to write something, for example in the search box of the Youtube plugin: neither the smartphone remote controller for XBMC nor the Web page supported those interfaces (at least in pre-11 version of the application), so the only way (besides connecting a keyboard, which I don’t want to use because I don’t want to leave it there hanging around) was to navigate between each key of a virtual keyboard that pops up when going into any search field, using navigation keys or a little surface of the remote control that simulates a mouse. Neither a good solution, would you agree.

A few months back I played with the possibility of changing the firmware of the USB part of the Arduino Uno models, and as I had an Ethernet Shield lying there, along with the Uno already with the resistor in place for placing it in DFU mode, and I had the idea that I could use the Arduino as a remote keyboard… ready for the journey?

The journey

So, the first thing has been to search if someone already modified the LUFA project for allowing an Arduino board to be recognized as a generic keyboard… and (of course) it turned out someone already did it. I downloaded the code from that Web page, installed it and tried the examples: they just work™.

Next move: I put together some code for allowing the Arduino to act as a Web server, showing just a single page with a little form with a text line; each string insterted there is then sent back from the browser to the server, which gets the parameter and sends it through the serial port, using the protocol developed for the keyboard firmware linked above. With this, if the Arduino is connected to a local network and to a computer (through USB), it receives characters from the Web and sends them to the computer as they were typed into a (USB) keyboard. The only difficulty here was that the current binary version of the Arduino IDE seems not to work at all with DHCP, I don’t know for what reason (maybe some voodoo compatibility with my avr compiler), but the git version works just fine (for me, at least).

And, dulcis in fundo: using the Web page was fine, but of course I want to send commands from my Android smartphone, so I wrote some other code packed in a tiny Android application showing basically the same form and directly sending POST requests to the Web server. The entire application does not perform very accurate controls over inputs, it’s a little project in the end and it is supposedly used in a local network (your house’s), where no one should want to crash your Arduino…

Final thoughts

Next week I will get a little enclosure for the Arduino pictured at the beginning of this post; the sketch does not support all possible keybaord symbols, just letters, numbers and a couple of useful punctuation marks, because I think I will just use it for doing searches where I should not need strange things. I also want to add: screw the Eclipse update system, it never works.

As a side note, the Eeebox does not shut down the USB ports when shutted down, so the Arduino remains on and connected even if the computer is not running.

I also took the opportunity to put together some little projects I had on Github in one single repository instead of n repositories: it seems to make more sense.

Read Full Post »

Carambola

Carambola

Habemus Carambola! Non ho ancora avuto tempo di metterci le mani dentro (salvo un boot di test), ma intanto è lì. Ricordo le specifiche:

  • processore MIPS @ 320 MHz (Ralink RT3050)
  • 32 MB RAM
  • 8 MB flash
  • 2 porte Ethernet
  • Wifi
  • 20 GPIO
  • USB host

Read Full Post »

Wave Shield

Wave Shield

Come prima parte di un progettino “da ufficio”, ho passato la serata a saldare il Wave Shield di Adafruit, ed ho testato il tutto con il brano “Europa” di Santana, codificato a 16 bit e 22050 Hz mono (quindi un po’ distorto sugli acuti rispetto all’originale).

Qui sotto, il video con tale test: verso 0:30 si può sentire in lontananza la canzone di cui sopra, col volume piuttosto basso dato che veniva riprodotta tramite auricolari.

Read Full Post »

Netduino

Netduino

Finalmente, dopo alcuni ritardi dovuti a casini vari con UPS, è arrivato il Netduino. Argh!, direte voi: tradire così l’Arduino, passare a Visual Studio… bè, e allora? Sperimentare è giusto! (senza contare il fatto che qui a casa il secondo vince ancora sul primo, per 5 boards a 1)

La prima caratteristica che salta all’occhio è il fatto che il microcontrollore qui incluso è più potente rispetto agli altri Atmel: innanzitutto è a 32 bit, ed inoltre ha quantitativi di RAM e ROM superiori (anche se non di molto) rispetto al normale Arduino (e per questo sarà interessante sperimentare con il futuro Arduino Due, quando verrà messo in vendita). L’oggetto inoltre si programma usando .NET Framework Micro Edition, quindi le applicazioni sono scritte in C#.

La cosa che in realtà mi ha incuriosito particolarmente e mi ha spinto a prendere un Netduino ed a provarlo è il supporto al multithreading, ed è su questa caratteristica che ho costruito l’esempio riportato qui sotto: usando un prototipying shield preparato quest’estate, ho mandato in esecuzione due thread che accendevano un LED ciascuno, usando tempistiche differenti; in particolare, in un lasso di tempo di 1.5 secondi, il LED di destra lampeggia 2 volte (idealmente, due crome facendo un paragone musicale), mentre quello di sinistra lampeggia 3 volte (terzina di crome, mantenendo il medesimo paragone). Come potete vedere, la cosa funziona.

Read Full Post »

SooperLooper è un simpatico programmino per Linux, compatibile con Jack, che permette di registrare loop e riprodurli istantaneamente; è piuttosto utile quando volete suonare qualcosa ad esempio con una chitarra, ma ha ovviamente il difetto di aver bisogno di un supporto hardware con cui attivare la registrazione, dato che se state suonando avete probabilmente le mani occupate.

Bè, nulla di più facile: basta avere un pedale “vergine” (come quelli per il sustain delle tastiere), che generalmente ha un’uscita con un jack da 6.3″, da collegare (con un circuito piuttosto semplice, in cui il pedale di fatto funge da interruttore) ad un Arduino. A questo punto, con una decina di righe di codice ed il firmware MIDI, l’Arduino stesso sarà in grado di trasmettere i messaggi CC giusti al looper, che ad ogni pressione del pedale avvierà alternativamente la registrazione di un loop o la sua riproduzione.

Nel video vedete un esempio del circuito e del looper (escludendo un momento di defiance del tutto nella parte centrale, forse dovuto alla poca pressione che si esercita con una mano rispetto ad un piede); non ho una chitarra con me, ma l’insieme nel complesso sta comunque funzionando correttamente.

Read Full Post »

E’ arrivata la strip di LED (3 metri!) da Adafruit, e nel video potete vedere l’esecuzione del programmino di esempio pubblicato tra le istruzioni per l’uso; il circuito è piuttosto semplice, l’unica necessità è avere un alimentatore per Arduino in grado di produrre un’adeguata corrente (quello qui usato può arrivare a 1.5 A). Ora devo solo decidere dove piazzare questi metri di luci in casa…

Read Full Post »

Ho progettato una sorta di “shield” per il Telos B, all’interno di un progetto universitario, obiettivo: misurazione di temperatura tramite termoresistori, precisione di almeno un quarto di grado; non darò molti dettagli per ora (anche perchè manca ancora il lato software della cosa), ma per il momento ho le immagini.

Prototipo breadboard

Prototipo breadboard

Il primo qui in alto è il prototipo sviluppato su breadboard (e mi sto salvando la storia dello sviluppo per un’eventuale talk in conferenza embedded).

Prototipo PCB

Prototipo PCB

Ed ecco il prototipo su PCB, preparato dal gruppo di elettronici, che hanno applicato le giuste correzioni laddove io avevo peccato nello schema 😉

Read Full Post »

ADK DemoKit

ADK DemoKit

Con l’aggiornamento del mio HTC Wildfire S ad Android 2.3.5, finalmente ho la possibilità di sfruttare le possibilità offerte dall’Open Accessory kit (ADK), ed ho quindi testato subito l’applicazione demo (ridotta) supportata dalle librerie ufficiali per l’USB Host Shield per Arduino. Il sistema completo richiederebbe un Arduino Mega ed il kit ufficiale distribuito da Google, ma è possibile effettuare qualche progetto più “in piccolo” anche con il semplice Arduino Uno e lo shield offerto da SparkFun, con qualche leggero aggiustamento hardware per rendere compatibile il tutto.

Nella foto il risultato del primissimo esperimento: l’applicazione Android riconosce l’accessorio collegato via USB, anche se nessuno degli elementi previsti (LED, pulsanti etc) non sono collegati al momento… è stato un test rapido, l’esplorazione più approfondita verrà più avanti (appena ho un po’ di tempo da dedicarci).

Read Full Post »