måndag 6 maj 2013

DMX controlled water cooler

I was once presented with the idea to make a water cooler that made bubbles on cue. the idea was that the cooler went empty during a 50 min theater show. It also needed some mystic lights. There was also the idea that the tap on the cooler some times worked and some times not. The solution i found was to make a setup with two dmx controlled valves and and a waterproof rgb led strip with a dmx controller.
Im going to leave the rgb led strip out of this story and concentrate on the dmx bubbles. First i got my hands on a water cooler and luckily i got one of those with a heater to make warm water for tea or instant coffe. When I opend it i found out that there was noway to make a nice cut to the cooled part of the cooler it had plastic pipes for the water molded in to the construction. But the the warm water was in a steel tank with a heater and it had a inlet pipe from the water bottle and a outlet pipe to the tap. I just took a tiger saw with steel cutting blade and cut the heating tank free. When i measured the steel pipe diameter i found out that the pipes outer diameter was a bit bigger than some food grade tubing I had. That men that i could crank the tubing on to the pipes and it fitted perfectly without any water leaking out. Then i got a t-connector for the tubing and two 12v solenoid valves with tube fittings. The first valves I got, I didn't pay attention to the lowest pressure they would open at. When I tried them they didn't open at full. Because the cooler has very low water pressure and most valves needs pressure to open fully. When I found valves that open at a really low pressure it worked fine.

I made the controller to the valves out of two velleman dmx relay kits (k8072) and i putted them in a box together with a power supply.
It worked very good when you wanted the cooler to make bubbles you opend the valve to the waste tank and the bubbles came with a slight delay and the same when you closed it. When the actor took water from the tap you open the tap valve and water is running through. If you want it to look as the water stops you close the valve as the tap is open.





Link to the dmx relay card:

the tinkerbell files!

Here are the schematics and the code for tinkerbell the wirless dmx fairy.








/*************************************************************************************************************
*
* Title    : Example DMX Receiver
* Version    : v 0.3
* Last updated            : 07.07.2012
* Target    : Arduino mega 2560, Arduino mega 1280, Arduino nano
* Author                    : Toni Merino - merino.toni at gmail.com
* Web                       : www.deskontrol.net/blog
*
**************************************************************************************************************/
#include <lib_dmx.h>  // comment/uncomment #define USE_UARTx in lib_dmx.h as needed

// This example receive 4 channels from address 1 to 4 and write analog values to PWM pins 2 to 5

// outputs update in main loop


//*********************************************************************************************************
//                        New DMX modes *** EXPERIMENTAL ***
//*********************************************************************************************************
#define    DMX512     (0)    // (250 kbaud - 2 to 512 channels) Standard USITT DMX-512
#define    DMX1024    (1)    // (500 kbaud - 2 to 1024 channels) Completely non standard - TESTED ok
#define    DMX2048    (2)    // (1000 kbaud - 2 to 2048 channels) called by manufacturers DMX1000K, DMX 4x or DMX 1M ???

void setup() 
{
  ArduinoDmx0.set_control_pin(4);    // Arduino output pin for MAX485 input/output control (connect to MAX485 pins 2-3) 
  ArduinoDmx0.set_rx_address(1);      // change starting adress here
  ArduinoDmx0.set_rx_channels(1);     // number of rx channels
  ArduinoDmx0.init_rx(DMX512);        // starts universe 0 as rx, NEW Parameter DMX mode
  pinMode(5, OUTPUT);
  
  digitalWrite(5, HIGH);
  delay (300);
  digitalWrite(5,LOW);
  delay (300);  
    digitalWrite(5, HIGH);
  delay (300);
  digitalWrite(5,LOW);
  // 2 blinks for on
  
}  //end setup()

void loop()
{
  //write values from dmx channels 1-4 universe 0 to arduino pwm pins 2-5
  analogWrite(5, ArduinoDmx0.RxBuffer[0]);  //buffers 0 indexed

}  //end loop()


as you can see you will need a dmx library from deskontrol.net . this is almost their programing example with minor changes. the output Onoff i just a  indicator that the Arduino has power and is ready to recive dmx.

i will publish the pcb files. but they are not ready yet.