Categories: Funny, Geek, Personal, Random, Technology

I thought about it. Then, I implemented it. It’s here.

 

Wikipedia:

On October 16, 2011, Marconi Union created an eight minute track, titled “Weightless”, in collaboration with the British Academy of Sound Therapy.
According to scientists at the Mindlab institution (a commercial ‘neuromarketing’ company) it induced a 65% reduction in overall anxiety and brought test subjects’ resting pulse rates to 35% of their usual resting rates. The song features guitar, piano and manipulated field recordings. It is punctuated throughout by low tones that supposedly induce a trance-like state.

Is this the most relaxing song in the world? You’ll be the judge:

Seen here.

Published by António Lopes on June 28, 2012

Since I need to do some serious work on the Arduino platform in the near future, I decided to have a look at all the material I had lying around to make sure I have everything I need for my next project. However, I discovered a particular object that I didn’t know what it was.

Light-depended resistor

A light-dependent resistor

I quickly took a picture of it and shared on Twitter (which is actually much better than Google for this kind of stuff) and, right away, several people replied pointing out that the mysterious object was in fact a photoresistor, or a light-dependent resistor.

Basically, this small sensor outputs its sensitivity to light and in this case, it produces a value between 0 (in very dark places) and 1023 (close to the sun) that can be read by an Arduino board through one of the analog input pins.

Since I also had a small buzzer that I could connect to the Arduino, the next step became obvious: to build a cheap-ass theremin. Before lunch, preferably… And it was indeed quite easy to build and program. Here’s the schematic for the whole thing:

Theremin schematic

The schematic for the cheap-ass home-made theremin

Basically, you need: a buzzer, a photoresistor, an Arduino board (pictured here is the Ethernet shield since the Arduino I used was the Ethernet variant), a couple of resistors, a mini-breadboard and some wires for the connections. In case you’re wondering how to do this kind of schematics, I used Fritzing.

As for the code, it’s also quite simple: you just need to get the photoresistor sensor value from the chosen analog input pin (in this case, A0) – a value between 0 and 1023 (awesome tutorial here) – and convert it to a frequency, ranging from 0 to 2500Hz (I chose this particular frequency because it sounded loud enough but I’m not sure how high it can go) and send it to the digital output pin (in this case, 4). The buzzing part is a bit trickier but this tutorial explains it quite well.

Here’s the complete code:


int prPin = 0; // Pin where the photo resistor is connected to
int prReading; // The analog reading from the photoresistor
int buzzerPin = 4; // Connect Buzzer to Pin 4
long buzzerFreq; // The frequency to buzz the buzzer
// You can experiment with these values: long BUZZ_FREQ_MAX = 2500; // Maximum frequency for the buzzer
long PR_MAX = 1023; // Maximum value for the photoresistor

void setup() {     pinMode(buzzerPin, OUTPUT); // set a pin for buzzer output
}

void loop() {
    prReading = analogRead(prPin); // Values 0-1023
    buzzerFreq = (prReading * BUZZ_FREQ_MAX) / PR_MAX;
    buzz(buzzerPin, buzzerFreq, 10);
}

void buzz(int targetPin, long frequency, long length) {
    long delayValue = 1000000/frequency/2;
    long numCycles = frequency * length/ 1000;
    for (long i=0; i < numCycles; i++){
        digitalWrite(targetPin,HIGH);
        delayMicroseconds(delayValue);
        digitalWrite(targetPin,LOW);
        delayMicroseconds(delayValue);
    }
}

And here’s the video with a small demo:

[youtube http://www.youtube.com/watch?v=iU0KcMpgIT4]

I know this is nothing like a real theremin, but considering the limited output sound that the buzzer can produce (and the ridiculous amount of time I spent with this – around 20 minutes), this is probably the best I can do with this stuff.

Published by António Lopes on June 25, 2012
Categories: Funny, Images, Personal, Random

Realistic living statue

What makes this differ from other living statues I’ve seen is the details on the painting. It really looked like one of those old bronze statues that you see in most touristic areas. If he just had the patience and will to include some pigeon crap, it would have been flawless.

Spotted yesterday in beautiful Cascais.

Published by António Lopes on May 11, 2012

20120511-193416.jpg

View of Sintra’s palace from my home using my telescope and the iPhone.

Published by António Lopes on April 17, 2012
Categories: Funny, Random, Society

If there’s something I despise is people that use the little power that they have to make everyone else’s life more difficult.

Today I received this joke on my e-mail and I simply have to share it:

Every time that a person goes to a doctor’s appointment, the doctor’s assistant always asks for the reason he or she is there in front of everyone else in the waiting room. And the patient has to politely answer even if the situation is slightly embarrassing.

One of those times, when the doctor’s assistant asked me what was the reason for my visit, I stated: “Well, I have a problem with my penis.”

This obviously caused a bit of an altercation in the waiting room and the assistant replied: “Sir, you shouldn’t say those things out loud in the waiting room.”

Me: “Why not? You asked me the reason why I was here!”

Assistant: “You could try to be a bit more discrete. For example, you could say that you have a problem with your ear and then later discuss the real reason with the doctor.”

So I smiled, got out and went back in: “Good morning!”

Assistant: “Yesss??”

Me: “I have a problem with my ear.”

The assistant smiled, nodded and then asked: “And what seems to be the problem with your… ear?”

Me: “It hurts when I pee.”

Published by António Lopes on April 12, 2012
Categories: News, Personal, Random, Society

Apparently an extension to the Portuguese law that prohibits smoking in enclosed public spaces is being discussed so as to include the situation in which parents smoke inside their cars while transporting their children. I agree with the situation the law intends to include but not necessarily with the fact it should be a law, as in, “you’ll get fined or go to jail if you don’t comply”.

Up in smoke

Up in smoke, by Pedro Moura Pinheiro

People might misinterpret my words so, let me clarify: I fully agree children should not be exposed to their parents’ smoking environment. And I get it that a law is probably the only way to enforce the protection of children whose parents are irresponsible enough to include their children in their smoking environment.

Now imagine that, in the future, the government prohibits parents from taking their children to McDonald’s or any other junk food restaurant because too much of that kind of food can turn your kids into adults with high risk of developing cardiovascular diseases. The argument is still the same: the law exists because there are irresponsible parents that do not protect their children from harmful activities (even if that harm only reveals itself in the distant future). Would your position still be the same as in the smoking law? Or would you find that to be a huge invasion of your freedom?

You’d probably say: “Ah but that’s different!” Well, is it? From a health point of view, the situations are exactly the same. You might think I’m being extreme but actually, junk food might be worse since a lot more people die of cardiovascular diseases than people die of smoke-related diseases. However, a lot more people would oppose to this no-junk-food-for-small-children law than the no-smoking-near-children law. Why is that?

What worries me the most is the precedence that this kind of law opens. Would you like to live in a future in which you’d need to show your most recent cholesterol exams just to prove that you are allowed to eat a Big Mac? Yeah, me neither.

I think people should have the freedom to be idiots.

Published by António Lopes on March 30, 2012
Categories: Funny, Images, Random
Published by António Lopes on March 5, 2012

This video is part of a visually-stunning series of videos based on Carl Sagan‘s texts on the humankind and space exploration. Do yourself a favor and watch these videos. They are surprisingly relaxing and awe-inspiring.

Published by António Lopes on March 2, 2012
Categories: Images, Personal, Random, Society

There has always been a discussion about Agnosticism and Atheism. Are they mutually exclusive or are they supposed to be combined in a two-dimensional scale? It’s a difficult question to tackle but Zach Weiner’s post is one of the best texts I read on this subject.

He makes an interesting point about the question of whether or not you’re agnostic should come before the question of whether or not you’re atheist. Here’s his proposal in graphical terms:

Want to know if you're an agnostic or an atheist? Follow this simple flow chart!

Want to know if you're an agnostic or an atheist? Follow this simple flow chart!

His point is that if a person is agnostic (i.e. a person that believes it is impossible to know if there’s a deity), then there isn’t really a point about discussing whether or not you’re an atheist (i.e. a person that doesn’t believe in the existence of deities) because you’ve already stated that it is impossible to know if there is a God or not.

The other interesting point that he tackles is the absolute certainty with which one can affirm he/she is an Agnostic or Atheist. It all comes down to the knowledge you possess at this point and things can (and most probably will) change in the future.

So, for now, I’d make his words my own:

I like to just call myself “irreligious.” Whether I’m agnostic or gnostic or atheist or whatever is really dependent on what we’re talking about. But I know for a fact that I don’t attend a place of worship, and don’t assume any books are sacred.