Switch on / off light or power board with Max msp
Hello,
I want to "control" light with max msp. I don't want to dimm light. I just want to switch off or on light. So maybe it is the easiest to switch on or off a power board via max / msp. Does anybody knows how to do it with a max msp patch and what hardware do I need to connect it to a power board? Thanks, Martin
Max would be the easy part of this equation. However, dealing with large voltages - like you would find in a home power board - is a non trivial task and I would suggest that you proceed with caution...
If you're still keen to get your hands dirty, take a look at an Arduino board, controlled with Maxduino or similar. There are many tutorials out there that will help you learn about switches, but again, if you're dealing with the voltage that comes out of the wall, you can get real dead, real fast. http://arduino-info.wikispaces.com/ArduinoPower
Thank you, is there not another way to get the signal out of max msp and maybe to have some save kind of hardware which "tells" the power board on or off?
If you ask that question, I would go with the Arduino suggestion. There are really easy to use solutions for driving relays available:
Arduionos are certainly the cheapest & good but if you want a simple solution (midi note switches on/off) this is good,but costs a bit
thanks so much. That "midi note on / off" solution seems to be very suitable for me. Does anybody knows where to get such a midi switcher in australia? I need it as soon as possible in the next days. I would be happy if anybody has some recommendations? I'm here just for two month and I don't know where to buy something like that?
The other solution, cheap and quite safe is using an Arduino board with this kind of "plug and play" relay. Then, you can use Arduivis to talk to the arduino code from max.
On your Arduino board, you just have to plug your relay on the Digital Inputs and send High or Low value to them true Max/MSP.
This would be the easiest solution for me.
Are there any new approaches to this need by now ?
How can I control a power socket with maxmsp ?
Any new suggestions very welcome.
Cheers.
Why new ?
what is wrong with suggested options ?
Look at this baby:
What a monster! You can switch 250V/7A with this. Plop it onto an Arduino Uno and you're off to go. This will let you switch four fridges or ovens on/off all from the comfort of Max,
Hens Zimmerman
@Source Audio
it’s 10 years old and the preferred an straight forward solution is discontinued unfortunately.
So I was hoping there are new solutions similar easy like the canford switcher without tinkering in arduino which would open a massive new black hole to my schedule without a foolproof step by step guide.
I am afraid without doing a bit od DIY, it could become expensive.
you can buy ready to use DMX based stuff, home automation based etc stuff,
but allways need a way to control it from max.
there are many different home power plugs with remote control,
but again ...
one has to hack IR code to be able to switch it from max.
Or use smart apps on phones ...
Expensive is not so much the issue here. Rather, the solution needs to be easy to establish and reliable.
I am currently looking at:
with
in hope that the two things work together.
Cheers, and thanks for thinking along - much appreciated.
that pwr switch is a good buy,
it should be switchable with that midi gadget,
but you will need to supply power to the relay.
PWR-Switch needs voltage 3 -24 Vdc to turn on,
that relay only shorts 2 contacts.
Thanks again for thinking along. If I understand you right, I will need lets say a 9 volt battery block somewhere within the circuit of MIDI-relay-box relay and to the power socket relay connection since all the MIDI-relay-box does is open or close the circuit? The MIDI-relay-box itself, to function, is powered by the MIDI-IN connection (hoping the interface provides it), but that is not passing Voltage on to the relay contacts to switch that power socket.
The connection on the MIDI-relay-box is a jack. I will have to split the ring and tip for the connection to the battery and/or power socket.
Your brain is greatly appreciated. Thanks.
I am actually a bit suspicious about powering that midi gadget, because midi connection
is run through 2x 220 Ohm resistors which allow maximum of 11 mA.
That has to be enough to power optocoupler & midi circuit and keep relay coil turned on.
AND .. midi line is HIGH only when no data is transmitted, as soon as you send data it gets
pulled to ground at 31250 baud speed.
Midi cable length and gauge will add to the problem.
Honestly, I would suggest to use little arduino, either as midi, serial , whatever to
control that power switch.
Also wireless is possible
for example usb midi (cost 5 EUR)
all the code would fit into few lines....
#include "MIDIUSB.h"
void setup() {pinMode(2, OUTPUT); digitalWrite(2, LOW);}
void controlChange(byte channel, byte control, byte value) {
midiEventPacket_t event = {0x0B, 0xB0 | channel, control, value};}
void loop() {midiEventPacket_t rx; do {rx = MidiUSB.read(); if (rx.header != 0){
if (rx.byte1 == 176 and rx.byte2 == 1 and rx.byte3 == 1) {digitalWrite(2, 1);}
if (rx.byte1 == 176 and rx.byte2 == 1 and rx.byte3 == 0) {digitalWrite(2, 0);}
}} while (rx.header != 0);
}
Midi CC 1 on ch 1 powers relay on digital pin 2 On or Off
P.S. and it would mean less soldering then to insert that battery
after paying 200 $ for that midi thingy
ANOTHER BULLSHIT :
are that guys so stupid ?
Thanks again Sounceaudio.
I am not sure that I understood who you're calling "so stupid"… But the setup as drawn works.
Cheers.
I meant arduino code they included in the manual.
Dear Sourceaudio, may I poke your appreciated brain again:
Would this setup, as drawn by you above and working great here - require the 9V Block to be replaced in the "near" future? The Relay will be switched on and off about 3000 times a day at a maximum 10 seconds per "on" state. I have no clue what that means regarding the power consumption of the circuit. The installation has to run for 3 weeks.
Thanks so much again.
J.
I would use little power supply.
anything between 5 - 15 volt and 200 ma should do
@JIRC I'm looking to build something similar for an exhibition. I'm curious what you ended up using in the end?
@collin
I used what was described here in this thread and everything worked flawless. Let me know if you need specific details. Cheers, J.