HoCity Final 02

Video How it works

[ Project Execution Brief ]
A. Data input
from the natural environment: http://www.wunderground.com/weather/api/d/documentation.html
B. Output visualization: City bubbles
Bigger and higher = hotter.
Shows city, country, and temperature
C. Physical input : Proximity sensor- LVEZ0

[ CODE ]
a. Initial Arduino code for proximity sensor

b. Code to upload before moving to processing

c. processing sketch


This slideshow requires JavaScript.

HotCity Final 01

Video How it works http://vimeo.com/33693164

[ Project Execution Brief ]
A. Data input
from the natural environment: 
B. Output visualization: City bubbles
Hotter, bigger and higher. Shows city, country, and temperature
C. Physical input : Potentiometer: cycles the bubbles for information

a. Initial code i used to work with pontentiameter  in Arduino

b. Arduino code i upload before i moved to processing

c. Processing sketch


This slideshow requires JavaScript.

interacting with proximity sensor

This slideshow requires JavaScript.

I’ll say it is Hotcity version 2 to try out interacting with proximity sensor. If user comes closer bubbles would start emerge and the speed of bubble is defined by distance. If use comes closer, the bubbles move faster. Also user can hover mouse to see the information of the bubbles including city, country, and current temperature.

[resource] Studying: to read multiple analog inputs
* http://sheepdogguides.com/arduino/aht1a.htm

Link |Read data from the multiple Serial Ports

I am looking for how to get data from both analog0 and analog1. I found information as below at processing.org. But so far it’s not working well.


import processing.serial.*;

Serial[] myPorts = new Serial[2];  // Create a list of objects from Serial class
int[] dataIn = new int[2];         // a list to hold data from the serial ports

void setup()  {
  size(400, 300);
  // print a list of the serial ports:

// get the ports' names:
  String portOne = Serial.list()[0];
  String portTwo = Serial.list()[1];
  // open the ports:
  myPorts[0] = new Serial(this, portOne, 9600);
  myPorts[1] = new Serial(this, portTwo, 9600);

void draw() {
  // clear the screen:
  // use the latest byte from port 0 for the first circle
  ellipse(width/3, height/2, 40, 40);
    // use the latest byte from port 1 for the second circle
  ellipse(2*width/3, height/2, 40, 40);

void serialEvent(Serial thisPort) {
  // variable to hold the number of the port:
  int portNumber = -1;

  // iterate over the list of ports opened, and match the
  // one that generated this event:
  for (int p = 0; p < myPorts.length; p++) {
    if (thisPort == myPorts[p]) {
      portNumber = p;
  // read a byte from the port:
  int inByte = thisPort.read();
  // put it in the list that holds the latest data from each port:
  dataIn[portNumber] = inByte;
  // tell us who sent what:
  println("Got " + inByte + " from serial port " + portNumber);

Two Analogs

Now I connected two analogs using breadboard.
In a serial monitor it shows value of both potentiometer and Proximity sensor.

Next  How can I use data from each analog pin? Seems i need separate serial ports for each…!??

A0 = Potentiometer : 5v – Gnd – Analog 0
A1 = Range finder :  5v – Gnd – Analog 1


proximity sensor working

Basic proximity sensing is working with Arduino sketch.
The value goes small(because it’s like a distance) as user approach to sensor.
Move to processing
Combine with potentiometer

In a serial monitor window above, you can see the numerical value changing based on things around it.

5v- Gnd -Analog 1


I sutured wire to the sensor at school and it’s working.I didn’t need to suture the extra yellow wire at the end but accidentally i did and just leave it like that. Now i cut to prohibit confusion, but i thought it’s better to leave it then force to remove.

This slideshow requires JavaScript.

Proximity sensor : Range Finder

For sensing the proximity, i am using this LV-maxSonar-EZ0.
* Ultrasonic range finder.
* 2.5V-5.5V, < 3mA
* Outputs: Serial, Analog Voltage & Pulse Width.

It is a size of a dime. The circuit is pretty simple as below. I will suture as picture above and connect with Arduino as below.

This circuit is same as potentiometer, another physical input of my project, so I’ll use bread board to connect both potentiometer and Range finder to 5v-Gnd. I’ll connect potentiometer to analog 2 and LV to analog 1.