Go Down

Topic: interactive film installation  (Read 1 time) previous topic - next topic

meg123

Hi

I'm an artist trying to create an interactive installation.

I want to project a film and the film changes depending on the number of people in the room.

How do i go about doing this?

Thanks

Kevin77

Hie Meg,
One way to do it is to count how many people coming in and going out using a PIR sensor or two IR sensors (to determine the direction of the visitor).
This will only work reliably when you can make people enter one by one. Preferably enter through one door and leave through another...

1:1

At the arduino level I'd say your most robust way to go about it has been suggested >> an entrance and an exit wide enough for one person... Many different sensor types could deal with this.

You could play around with sensors that looked at differences over time and get an estimation of direction, but humans will change direction etc. you'll never be sure - you'll only be likely that you're correct in your count.

Next level up is vision processing, camera in the room doing body detection or similar etc. but that isn't arduino level.

Next question is how do you wish to do the video switching ?  a serial link to some kind of hack-happy application like max/jitter ?
The XY problem:  "the over-use of one line responses that simply link though to websites that describe the XY problem"

ChrisTenone

Consider a CO2 sensor. More people in the room means more carbon dioxide in the room. This is what is used in HVAC for ventillation control.

Kevin77

Although Chris is absolutely right, I do have a few remarks...

it would be the best way of detecting if there are several people in the room,
But I do see two problems, if there is ventilation in the room your reading will be off if the ventilation is turned on, likewise if people left but there is no ventilation the PPM count won't go down very fast

2. I have not found a decent affordable CO2 sensor that is reliable below 1000ppm. I tried several. (ou can see my other post about that here : http://forum.arduino.cc/index.php?topic=298547.0 )
But if you know of one, I would be very grateful if you would tell me where i can order it! I am still looking for one below 100$.

Kind regards, Kevin


ChrisTenone

#5
Apr 07, 2015, 06:46 pm Last Edit: Apr 07, 2015, 06:47 pm by ChrisTenone
Although Chris is absolutely right, I do have a few remarks...

it would be the best way of detecting if there are several people in the room,
But I do see two problems, if there is ventilation in the room your reading will be off if the ventilation is turned on, likewise if people left but there is no ventilation the PPM count won't go down very fast

2. I have not found a decent affordable CO2 sensor that is reliable below 1000ppm. I tried several. (ou can see my other post about that here : http://forum.arduino.cc/index.php?topic=298547.0 )
But if you know of one, I would be very grateful if you would tell me where i can order it! I am still looking for one below 100$.

Kind regards, Kevin


Hi Kevin, here is a device I'd like to try out, that may meet your requirements:

http://www.co2meter.com/products/k-30-co2-sensor-module

ChrisTenone

This thread has been bouncing around in my head for the last couple of months. I have built a 'people counter', which although it is most certainly a work in progress, I am heartened with the results so far. I built it using the littleBits Arduino-at-Heart module and supporting circuitry, and a Vernier CO2 sensor. You can see it here, on the littleBits website.

I use a fan in the device for sampling, and to hasten response time - I can tell within a few seconds when a person enters or leaves a medium sized room, with normal, 'classroom' ventilation. I gave up on precise number reporting, and now assign three categories: empty, a couple people, and crowded. I also read out %CO2 (to one significant digit), which in an empty room is about 0.04%, to a crowded room, which is about 0.1% CO2. This narrow range is what limits the precision of the count.

Over the summer, when I have more time, I plan on trying to develop this into a small package using the device I referenced above. I had intended on using an Arduino Micro board for processing, but 'some people' are trying to convince me to use an ATtiny84 or '85 instead.

As (if?) I make progress, I will come back and report here, but I probably won't get very far until June or so. Stay tuned!

Kevin77

Keep us posted indeed!

I do have one question... What if the ventilation starts or stops?
I also noticed the price of the sensor... Wouldn't it be easier placing two sensors at the door?
If A is triggered before B, soeone enters,  if B triggers before A someone leaves. I would imagine a rather small door in a classroom? Or could two people enter/leave at the same time?

Thanks for the update btw!

CheesyFactory


ChrisTenone

Hi Kevin, Cheesy, et. al.,

I hooked up a CO2 sensor to a recording device, and left it alone in my tutoring center for a couple days over the summer. I think it tracked the people pretty well:



robtillaart

nice measurement!
done with that - http://www.co2meter.com/products/k-30-co2-sensor-module - sensor?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

ChrisTenone

nice measurement!
done with that - http://www.co2meter.com/products/k-30-co2-sensor-module - sensor?
Thanks weighing in Rob, ... a K30? ... I wish!

The K30 sensor is the gold standard of CO2 sensors. (But they're 90 bucks so I'll work the device I have for now, but I will buy a K30 eventually.)

I used a "CK Sensors 0113 v5" sensor for this demo. If I had a link, I'd post it, but CK's website is amazingly content free, but has a beautiful picture of the seashore! The sensor is a polished linear chamber, 8.5 cm long with an IR LED at one end, and a photo detector (sensitive in the NIR) with an interference filter at the other end. It's from a Vernier device that had been used in biology experiments to monitor plant respiration. The sensor module's output was amplified with an NTE928 op-amp to get the range of interest (0.05% to 0.1%CO2) into 0 to 5 volts. I know that a multi-op-amp "instrument" amplifier would have been better, but I just wanted to know if this would work, and had a 928 on hand.

The amplified voltage went into a Tiny85 that converted it to an approximate CO2 concentration on the output, using Vernier's conversion formula. The 0.31% (3100ppm) shown is impossibly high for room air (and outside the linear range), because I blew directly on the sensor.  The graph I posted was made by attaching the output of the littleBits voltmeter to a labpro datalogger, and adding the labels with Photoshop. The values are all reasonable, room air is considered to be "stuffy" if the CO2 level exceeds 1000ppm, while "fresh" air is about 400ppm CO2.

My circuit:

and here's the Tiny's code:
Code: [Select]
/*
 * Purple People Counter
 * 04072015 clh - convert CK113v5 CO2 sensor to count & percent
 * 
 * Thanks to sean_littleBits on the littleBits forum
 * for the voltmeter code:
 * (http://discuss.littlebits.cc/t/number-module-arduino/540/4)
 *
 * Uses a Vernier CO2 sensor connected to a0
 * count output to pin 1
 * percent/100 output on pin 0
 *
 *rewrite for tiny85 - 050615 clh
 *
 */

void setup()
{
 pinMode(0, OUTPUT);
  digitalWrite(0, LOW);
  pinMode(1, OUTPUT);
  digitalWrite(1, LOW);
  pinMode(2, OUTPUT);
  digitalWrite(2, LOW);
  pinMode(3, OUTPUT);
  digitalWrite(3, LOW);
  pinMode(4, INPUT);      // digital pin 4 is analog pin A2
}

void loop()
{
  // get the sensor value on pin a0 (val is 0 to 1023)
  int sensorValue = analogRead(A2);

  // output to the number bits on pins 5 (the number of people) and pin 9 (percent)
  analogWrite(1, percentTo255(peopleCount(sensorValue)));
  analogWrite(0, percentTo255(percentCO2(sensorValue)));

  delay(300); // dawdle for .3 seconds
}


//----------------------- subroutines ------------------------

// convert percent (0-99) into 256ths (0-255) for output to number Bit
int percentTo255(int n)
{
  int clockValues[] = {0, 3, 5, 7, 9, 11, 15, 17, 19, 22, 25, 28, 29, 32, 35, 38, 39, 42, 44, 47, 51, 53, 57, 59, 60, 62, 65, 69, 70, 72, 75, 78, 82, 84, 85, 87, 91, 93, 96, 97, 101, 103, 106, 109, 111, 112, 115, 117, 121, 124, 126, 128, 132, 134, 135, 137, 141, 143, 145, 147, 150, 154, 156, 158, 160, 163, 165, 168, 171, 174, 177, 179, 181, 184, 186, 188, 190, 192, 195, 197, 202, 204, 206, 210, 212, 214, 217, 219, 221, 224, 227, 230, 233, 235, 237, 240, 242, 244, 246, 250};
  return clockValues[n];
}


int percentCO2(int value)
{
  return (map (value, 0, 1023, 0, 99));
}


int peopleCount(int value)
{
  int result = 0;

  if (value >= 50 && value < 70) {
    result = 21;
  }

  if (value >= 70 && value < 85) {
    result = 41;
  }

  if (value >= 85 && value < 95) {
    result = 61;
  }

  if (value >= 95 && value < 102) {
    result = 81;
  }

  if (value >=  102) {
    result = 99;
  }

  return (result);
}


I'm encouraged to make a people counter device with this concept, but look at the variability of the data!

I need to learn more about dealing with this, chaotic, imprecise-yet-patterned kind of ... fuzzy ... data. Do you have any thoughts about where I could look for information about this kind of data handling?

Go Up