Tuesday, July 30, 2013

Lumino - an arduino input device

Hi readers!

I'm here to share with you an experiment I've been having fun these days.

While I was playing DOTuino, I found out that I could use a light sensor to make my personal and unique "joystick".

Using my hand to change the light intensity over the sensors I could create some kind of interesting input.

Once I came up with the idea, developing a circuit to achieve it was really simple. All I needed was 2 light sensors (LDR), a couple of wires and an arduino.

For a while, I winged it with some pasta box. Anyone there with a 3d printer? =P

Just before making the little holes (for the sensors)

Usb connection

In order to test its responsiveness in a real application, I made a simple game with python + pygame.

Below, a video recorded with my brother.


Actually, while the hand comes closer to the sensor, the light variation is smoother than the presented in this game, which I deliberately made it detect just 3 states.

If you liked the idea and wanna try this at home or contribute, it's all open source.
Below, links with code:

  • lumino (arduino code + experimental python driver);
  • lumino-projects (sample code using the above python driver, including the game featured in the video).

Hope you liked it!

Feel free to leave comments to this post!

Ronald Kaiser

Saturday, July 27, 2013

DOTuino - an arduino game


Hello readers!
Today I finished DOTuino, a minimalist space game for arduino. It was a wonderful experience -- making a minimalist console by myself. I recommend it for you 2!

In order to accomplish the job I gathered the following components:
  • an lcd display (16 columns x 2 lines);
  • a potentiometer (to adjust the lcd contrast);
  • a push button (a minimalist joystick);
  • a bunch of wires;
  • 2 resistors (1 for the push button and 1 for the lcd backlight);
  • of course, an arduino.
The low level connections are relatively straightforward for those already initiated in arduino projects. No eletronics gotchas. Nevertheless, if you decided to try this at home and got any problems, do not hesitate in contacting me. 

Below, the game running!


Source code is available at github, use at your own peril, =P
And feel free to contribute!

Till the next post!

Cheers,
Ronald Kaiser

Saturday, June 22, 2013

A gota d'água

Um belo dia saí para comprar uma garrafa de água.


Corri, sedento, esperando que ao chegar em casa, pudesse abrir aquela garrafa e ter o prazer de experimentar o elemento da vida: insípido, inodoro e incolor.

Para minha surpresa, percebi que o líquido que adentrava meu estômago continha não apenas moléculas de Hidrogênio e Oxigênio. A sombrancelha franzia ao sentir o gosto amargo do alimento. Não era insípido.

Após deixar registrado meu devido descontentamento com a situação, acompanhei outra garrafa ao meu lar. Novamente, a sensação se repetiu. Por anos.

Passei a acreditar que os livros de ciência precisavam se atualizar. A água tinha cansado de não ter gosto.

Passados muitos anos, não aguentei, tive que contar para alguém. Já não conseguia mais sonhar, apenas "pesadelar" aquela frustração velada. Tinha medo do que aquela revelação pudesse causar ao mundo.

De repente, percebi que a muitos o segredo já tinha se revelado. A maioria das pessoas daquela região já estava ciente do que estava acontecendo. A minoria era tida como louca e alienada. Mas todos sabiam.

Não teria sido elegante esboçar a ideia de que a água tivesse opinião e vontades a Bertrand Russell.

Todos sabiam que a água estava sendo adulterada, não tinha ninguém calado.
Eu permanecia fixo na ideia de um "antropolíquido" porque a voz dos outros não tinha o meu respeito. Não queria ouvir.

Cansados de tanta pressão da consciência, resolvemos sair às ruas para reinvindicar uma água de qualidade. Queriamos demonstrar nosso descontentamento com aquela situação.

Ao fim do dia, o dono da Empresa de Água subiu ao palco pra dizer que estava do lado de todos, mas tinha adulterado a água porque era mais barato não investir na qualidade. Sobrava mais recursos para os gerentes.

Sabendo que a qualidade da água não parecia ser uma prioridade de todos, a Empresa de Água não se sentiu na obrigação de cumprir com o contrato implícito de entrega da água insípida até então. Prometeu tornar mais urgente a necessidade.

Após o sono do microfone e promessas de melhoria, todos resolveram acreditar novamente em mais uma adulteração, ligar a TV e assistir ao jogo.



Ronald Kaiser

Saturday, May 11, 2013

Should you keep that book?

Hello readers!
Today I was thinking about why we keep books at home. This post is about the development of this idea.



Motivation
Looking at my bookshelf I realized that there are books and books. Books that we actually read regularly and others we accumulate just as trophies of accomplishments.

It seems that it is common to have an affection upon our books. But is it rational? Is it wise to keep a lot of books at home when someone outside of our little world could be making a better use of it? Why not get rid of some? Why not give one to a child, a student or a friend?

I decided I was willing to give some books, keep my shelf cleaner and share knowledge.

The problem
But which books?
What is going to be the criteria to evaluate if a book is ready to be given or not?

It seems rational to choose the books I'm not going to need again. But this carries a bit of uncertainty and subjectiveness. It may deal with emotions. When we look at an old book a lot of memories may come into our minds. And this is an understandable argument to keep a big shelf. The invisible potential to recover memories.

But it doesn't happen with all of our books...




Developing a formula
Then, I started to think in a formula to evaluate if it's time to get rid of a book or not.

I think it is reasonable to suppose that if I didn't pick up a book for 10 years, it is very unlikely that I'm going to pick it up again in the future. So, the chances of needing a book again is inversely proportional to how many days passed since the last day I used it until today. Technically speaking,

 1/L

where N = chance of needing a book again and L = number of days since my last usage.

The frequency of times I took a book to read is strikingly relevant too. If I picked it up many times, it should be the case that it is still very relevant for me. Thus, the number of days I took a book to read must contribute in a directly proportional way to its usefulness. Hence,

 F

where F = number of days I read it.

Finally, a subjective metric must be taken into account. There are books we read a lot recently that we are very unlikely to read again. This is the case of text books used in a course that we didn't like and have no plan to read again. But the chances would be high with the 2 variables above only. Then, a rating to the book may be used to deal with these cases. Thus,

∝ R

where R = personal rating from 0 to 10.

The formula
Gathering all those considerations, we can devise a formula to determine the chances of needing a book again, which is:

N(L, R, F) = (kFR)/L

where k is a constant that is personal to the reader.

In order to find the value of k, I took a book that I'm very confident in needing again. It is a book about time, not so popular, but I like it.

I read it, approximately, during 60 days, so F = 60.
I think it is a nice book, so I gave it a rating of 9, then R = 9.
I didn't take it for about a month, so L = 30.
I want to obtain N = 1 when the chances are high of getting a book again. Given that, replacing F, R and L for N = 1, I obtained my k as 0.055.



Conclusion
If you tried to use the formula, you could see that the value of N can be sometimes greater than 1. It is not perfect, but it worked well for some books I tried.

Maybe I should use other units to define the values of F and L. Sometimes it's hard to remember how many days we read a book. The same to remember how many days passed since the last reading.

But it is a beginning.
You may be asking yourself, why all this?

Well, because it's fun! =)



Thanks for reading!
Till the next post,
Ronald Kaiser


If you have any point or critics to my model, please feel free to leave a comment!

Thursday, May 9, 2013

The intern

Hello readers!

This is a joke with interns.
Hope you like it!


Till the next post!
Ronald Kaiser