f

8bitfuture:

Video: ‘tractor beam’ created in water.

Physicists at The Australian National University have created a tractor beam on water, providing a radical new technique that could confine oil spills, manipulate floating objects or explain rips at the beach.

Using a ping-pong ball in a wave tank, the group worked out the size and frequency of the waves required to move the ball in whichever direction they want.

Advanced particle tracking tools, developed by team members Dr Nicolas Francois and Dr Hua Xia, revealed that the waves generate currents on the surface of the water.

“We found that above a certain height, these complex three-dimensional waves generate flow patterns on the surface of the water,” Professor Shats said. “The tractor beam is just one of the patterns, they can be inward flows, outward flows or vortices.”

The team also experimented with different shaped plungers to generate different swirling flow patterns.

As yet no mathematical theory can explain these experiments, Dr Punzmann said.

“It’s one of the great unresolved problems, yet anyone in the bathtub can reproduce it. We were very surprised no one had described it before.”

“…enlightenment leads to benightedness, science entails nescience.”
Philippe Verdoux
“As our circle of knowledge expands, so does the circumference of darkness surrounding it.”
— Albert Einstein
“You were born with wings, why prefer to crawl through life?”
— Rumi
“Popular culture is the test-bed of our futurity.”
— William Gibson - Idoru
“Self-education, I firmly believe, is the only kind of education there is.”
— Isaac Asimov
“When there are miles to go before we sleep, altered traits are more important than altered states.”
— Rumi

Portal’s Still Alive melody on Arduino UNO

I was browsing through the internet and found a tutorial on playing melody on Arduino which would incorporate PWM signals to generate sounds. Naturally, I enjoy video games and Portal being one of my favorite. I search for videos and found a video which featured Still Alive on Arduino. The author of the script did some painstaking work on writing a directory of sounds that would make up the music that we are familiar with. 

I will simply show you the step by step process of implementing the code on to the Arduino.

The first step is to get the hardware necessary for implementing the circuit. This is a simple and straight forward tutorial. You only require:

- An Arduino Board (I am using UNO)

- An audio jack or a speaker with 2 wires (one for power and other for ground)

- And a 1K resistor to protect the circuit

You can connect the circuit as shown here

The Arduino pin 8 is used to output the data which goes directly in to the speaker or audio jack.

Here is my setup:

image

Once the hardware is all setup. Open the Arduino Software>File>Examples>Digital>toneMelody. Once the sketch is opened. copy this code over the existing code. Do not touch the Pitches.h file. That is a library used to generate tones.

/*
Still Alive

Plays a the song Still Alive


circuit:
* 8-ohm speaker on digital pin 8

created 21 Jan 2010
modified 14 Oct 2010
by Tom Igoe

This example code is in the public domain.

http://arduino.cc/en/Tutorial/Tone

*/
#include “pitches.h”
#define REST 0

double song[] = {

// First line
REST, 2.0, NOTE_G3, 0.5, NOTE_FS3, 0.5, NOTE_E3, 0.5, NOTE_E3, 0.5,
NOTE_FS3, 2.0, REST, 2.0,

REST, 1.5, NOTE_A2, 0.5,
NOTE_G3, 0.5, NOTE_FS3, 0.5, NOTE_E3, 0.5, NOTE_E3, 1.0,

NOTE_FS3, 1.5,
NOTE_D3, 1.0, NOTE_E3, 0.5, NOTE_A2, 2.5,

REST, 1.5, NOTE_A2, 0.5,

// Second line
NOTE_E3, 1.0, NOTE_FS3, 0.5, NOTE_G3, 1.5, NOTE_E3, 0.5, NOTE_CS3, 1.0,
NOTE_D3, 1.5, NOTE_E3, 1.0, NOTE_A2, 0.5, NOTE_A2, 1.0,
NOTE_FS3, 1.5, REST, 2.0,

REST, 2.0, NOTE_G3, 0.5, NOTE_FS3, 0.5, NOTE_E3, 0.5, NOTE_E3, 0.5,
NOTE_FS3, 2.0, REST, 2.0,

// Third line
REST, 1.0, REST, 0.5, NOTE_A2, 0.5, NOTE_G3, 0.5, NOTE_FS3, 0.5, NOTE_E3, 0.5, NOTE_E3, 1.5,
NOTE_FS3, 0.5, NOTE_D3, 1.5, NOTE_E3, 0.5, NOTE_A2, 2.5,
REST, 2.0,

NOTE_E3, 1.0, NOTE_FS3, 0.5, NOTE_G3, 1.5, NOTE_E3, 0.5, NOTE_CS3, 1.5,
NOTE_D3, 0.5, NOTE_E3, 1.0, NOTE_A2, 0.5, NOTE_D3, 0.5, NOTE_E3, 0.5,

// Fourth line
NOTE_F3, 0.5, NOTE_E3, 0.5, NOTE_D3, 0.5, NOTE_C3, 0.5, REST, 1.0, NOTE_A2, 0.5, NOTE_AS2, 0.5,
NOTE_C3, 1.0, NOTE_F3, 1.0, NOTE_E3, 0.5, NOTE_D3, 0.5, NOTE_D3, 0.5, NOTE_C3, 0.5,
NOTE_D3, 0.5, NOTE_C3, 0.5, NOTE_C3, 1.0, NOTE_C3, 1.0, NOTE_A2, 0.5, NOTE_AS2, 0.5,
NOTE_C3, 1.0, NOTE_F3, 1.0, NOTE_G3, 0.5, NOTE_F3, 0.5, NOTE_E3, 0.5, NOTE_D3, 0.5,
NOTE_D3, 0.5, NOTE_E3, 0.5, NOTE_F3, 1.0, NOTE_F3, 1.0, NOTE_G3, 0.5, NOTE_A3, 0.5,

// Fifth line
NOTE_AS3, 0.5, NOTE_AS3, 0.5, NOTE_A3, 1.0, NOTE_G3, 1.0, NOTE_F3, 0.5, NOTE_G3, 0.5,
NOTE_A3, 0.5, NOTE_A3, 0.5, NOTE_G3, 1.0, NOTE_F3, 1.0, NOTE_D3, 0.5, NOTE_C3, 0.5,
NOTE_D3, 0.5, NOTE_F3, 0.5, NOTE_F3, 0.5, NOTE_E3, 1.0, NOTE_E3, 0.5, NOTE_FS3, 0.5, NOTE_FS3, 1.5,



// and belive me…
REST, 2.0, NOTE_A3, 0.5, NOTE_A3, 0.5,
NOTE_B3, 0.5, NOTE_A3, 0.5, NOTE_FS3, 0.5, NOTE_D3, 1.0, NOTE_E3, 0.5, NOTE_FS3, 0.5, NOTE_FS3, 1.5,
REST, 1.5, NOTE_A3, 0.5, NOTE_A3, 0.5, NOTE_A3, 0.5,


// science and im still…
NOTE_B3, 0.5, NOTE_A3, 0.5, NOTE_FS3, 0.5, NOTE_D3, 1.0, NOTE_E3, 0.5, NOTE_FS3, 0.5, NOTE_FS3, 1.5,

REST, 1.5, NOTE_A3, 0.5, NOTE_A3, 0.5, NOTE_A3, 0.5,
NOTE_B3, 0.5, NOTE_A3, 0.5, NOTE_FS3, 0.5, NOTE_D3, 1.0, NOTE_E3, 0.5, NOTE_FS3, 0.5, NOTE_FS3, 1.5,

REST, 2.0, NOTE_A3, 0.5, NOTE_A3, 0.5,
NOTE_B3, 0.5, NOTE_A3, 0.5, NOTE_FS3, 0.5, NOTE_D3, 1.0, NOTE_E3, 0.5, NOTE_FS3, 0.5, NOTE_FS3, 1.5,

REST, 1.5, NOTE_A3, 0.5, NOTE_A3, 0.5, NOTE_A3, 0.5,
NOTE_B3, 0.5, NOTE_A3, 0.5, NOTE_FS3, 0.5, NOTE_D3, 1.0, NOTE_E3, 0.5, NOTE_FS3, 0.5, NOTE_FS3, 1.5,

REST, 1.5, NOTE_A3, 0.5, NOTE_A3, 0.5, NOTE_A3, 0.5,
NOTE_B3, 0.5, NOTE_A3, 0.5, NOTE_FS3, 0.5, NOTE_D3, 1.0, NOTE_E3, 0.5, NOTE_FS3, 0.5, NOTE_FS3, 1.5,

// still alive… still alive…
REST, 1.5, NOTE_G3, 0.5, NOTE_A3, 0.5, NOTE_A3, 1.5,
REST, 1.5, NOTE_G3, 0.5, NOTE_FS3, 0.5, NOTE_FS3, 1.5,

// End of song
0.0, 0.0
};


void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);

double duration = 1;
for (int i = 0; duration > 0.0; i += 2)
{
int note = song[i];
duration = song[i + 1];

int noteDuration = (1600.0 * (duration / 4));
tone(8, note, noteDuration);

int pauseBetweenNotes = noteDuration * 1.3;
delay(pauseBetweenNotes);
noTone(8);
}
}

void loop() {
// no need to repeat the melody.
}

That’s all you need to do to play Portal’s Still Alive on your Arduino. Enjoy!

Avionic Sensor Measurement

While searching through my hard drive. I stumble upon an old project that I made while I was completing my bachelors. I thought I would put this here so that more people could see it and possibly replicate it.

Introduction:

Avionic Modules are used in airline industries mainly in aircrafts to measure changes in the physical parameter. These modules are used by air traffic controllers to measure the condition for the environment and based on the measured data, they could inform the pilots in order to provide pilots with accurate data and ensure that the plane is landing safely. They modules are also used inside the aircraft’s fuselage to provide pilots or operators with up to date data regarding the changing environment conditions that are important for the pilots to make decision for the safety of the passengers on board the plane. There are different types of modules available in the market. These modules vary depending on the type of the plane. In such modules are the temperature sensor, air velocity sensor, pressure sensor and most of all altitude sensor. Hence, avionic sensor modules are the very heart of the airline industries.

Objective:

The objective of this project is to design an avionic sensor module that could measure, air velocity, temperature, pressure, altitude, 3D orientation and 3d position of the plane. This will be accomplished by using off the shelf sensors that are available in the university laboratories. The goal is to measure the environmental parameter and by using ADC, interface the sensor plus signal conditioning circuits with a microcontroller so that the reading could be obtained instantly on an LCD screen. The microcontroller used for this project is ATMEGA32. If time permits the module will be tested on a kite for measure physical parameter. The module will be lighter enough to be used on a kite to measure the physical parameters on a low altitude. 

Background:

The microcontroller used for this project is ATmega 32 from AVR. The ATmega32 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega32 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed.

image

The temperature sensor used for this project is LM335. The LM335 are precision temperature sensors which can be easily calibrated. They operate as a 2-terminal Zener and the breakdown voltage is directly proportional to the absolute temperature at 10mV/°K. The circuit has a dynamic impedance of less than 1Ω and operates within a range of current from 450μA to 5mA without alteration of its characteristics. Calibrated at +25°C, the LM335 have a typical error of less than 1°C over a 100°C temperature range. Unlike other sensors, LM335 have a linear output.

To measure orientation Gyroscope was used, the gyro used for this project is a single axis evaluation board that can measure the yew movement. The gyro used is ADXRS150EB from Analog Device. The ADXRS150EB is a simple evaluation board that allows the user to quickly evaluate the performance of the ADXRS150ABG yaw rate gyro. No additional external components are required for operation. The ADXRS150EB has a 20-lead dual-in-line (0.3 inch width by 0.1 inch pin spacing) interface that allows the user to easily prototype products without having to deal with BGA soldering. The 0.4 square inch outline of the ADXRS150EB is still among the smallest gyros available today.

image

The Accelerometer used for this project is ADXL150EB.

Procedure:

 The first step in making this project is to test all the sensors and then make a signal conditioning circuit that would be used to interface with the microcontroller via Analog to digital converter. The analog to digital converter is accompanied inside the microcontroller with a reference voltage of 5V. The signal conditioning is done with 10-bit unipolar ADC. The set-up of the avionic module is first tested on a bread board and later it was transferred to a PCB. The microcontroller used for this project is AVR ATmega32. The code was written in C and can be found in the Appendix section. The testing of each sensor was done and the result was displayed on a multimeter.

image

After testing the circuit The PCB was made using ExpressPCB and the PCB was manufactured. The signal conditioning circuits, 5V power supply and the microcontroller was etched on the PCB. 

image

image

In order to implement the design and map the sensor output in to the microcontroller, we had to find the relationship between the environmental parameter measured by the sensor and the voltage that are generated by the sensor and inputted in to the ADC of the microcontroller. We tested all the sensors and based on the relationship, we entered the result in to the microcontroller.

For the temperature measurement, we used LM335 and connected it to the differential amplifier. By using the sensitivity of the LM335 and using the room temperature value (25.3), we found the voltage value of the temperature output which was around 2.93V. If we increase the temperature of the LM335, the voltage also increases and the change in voltage will be converted in to temperature value by using the following equation in the microcontroller.

Temperature  =  -30 + Voltage(18)

The voltage at the input of the Vadc = 5.5(V-2.4316)          

Similarly, to measure altitude, we also found the relationship between the Altitude and voltage and also with the pressure. As the altitude increases, the pressure decreases which also decreases the voltage of the LM335. By plotting this result on the graph we find that there is an inverse relationship as shown:

image

The formula used to convert the Voltage in to the Altitude:

Altitude =  (-Voltage+1.711)/(2.3423x10-3)

            To find the relationship of the Accelerometer we used the equation that was given in the accelerometer datasheet. It should be kept in mind that accelerator has a DC offset of 2.5V and when it is moved the voltage changes and usually increase more than 2.5V. In order to read from the sensor the relationship between voltage and acceleration is put in to the microcontroller for all 3-axis.

Vo=2.5-200m(Acceleration)

Acceleration = (-V0-2.5)/200m

Finally, for gyroscope we needed a range of 0 – 360o and the sensitivity is 12mV/degree/s

image

Degree  = (Voltage – 4.32)/0.005

After writing the code in C and adding the code in to the microcontroller, the sensors reading was displayed on to a computer screen. By using push-buttons, we could select between , altitude, temperature, orientation and position.

image

The results were displayed on the computer monitor and are as shown:

image

Conclusion & Discussion:

            Avionic sensor module making was a very interesting experience since we learned a lot about microcontrollers especially the programming aspect of the microcontroller which in itself is a very useful task. The use of different sensors made us appreciate the time and efforts engineers spend on designing and manufacturing efficient avionic module that provide accurate readings to the pilots and the flight controller.

            We were able to finish the design of the signals conditioning circuit and were also able to interface the system on the microcontroller. The outputs were seen on the computer in real time. However, some of the sensors like the pressure sensor and the gyro were not giving us large output cause their signal conditioning were not working properly and hence the output we were receive at the microcontroller terminal were very small and hence there was no noticeable output seen. We also couldn’t manufacture the PCB board because the lab was already been used for examination which prevent the manufacturing of the PCB. Therefore, as intended the system couldn’t be used on the kite for data logging.

            This project taught us a lot especially the calibration of the sensors and how to interface these sensors with the micro-controller.