Wireless program

micky01

New Member
Hey guys,
I need some code to simply turn on a relay on for 200 and off again via a wireless transmitter (433)
 

hippy

Technical Support
Staff member
<code><pre><font size=2 face='Courier'>SEROUT PIN,BAUD,(&quot;UUUUUUUUUUUUUU1&quot;)
PAUSE TWO_HUNDRED
SEROUT PIN,BAUD,(&quot;UUUUUUUUUUUUUU0&quot;) </font></pre></code> You will need to adjust the code to fit your actual application.
 

micky01

New Member
Thanks heaps hippy, also, what about a receiver program? I gather its similar:
SERIN PIN, Baud etc etc yeh?

Cheers
 

hippy

Technical Support
Staff member
That should work. See <A href='http://www.hippy.freeserve.co.uk/picaxewf.htm' Target=_Blank>External Web Link</a> for a more detailed solution.
 

Dippy

Moderator
Optionally, you could have the 200mS pause on the receiving end - just in case the OFF command was missed.
 

micky01

New Member
I think it may be a bit harder to have the 200 pause at the recev end. I'll describe my whole project to you:

I'm building a drink despencer, similar to the ones seen behind KFC and the like. I have 2 picaxes, one as sort of like a &quot;remote control&quot;, the other on the despencer it's self. The Remote has an LCD screen which displays a temp value from the despencer sent via wireless. The remote also has 4 switches which, when &quot;ON&quot; send a signal via wireless to a certain relay which dispences some water or what ever.

So basicly, my code at the moment is when ever say SWITCH 1 is High, send signal to wireless relay, looping back every 200ms. When its low, return to the &quot;Main menu&quot;.

Another quick question, is it possible, since i have a receiver AND transmitter on EACH board, have them sending data at the same time? Ie, one will send &quot;turn relay on&quot; and the other will send the data from the temp sensor to the LCD.

Any additional info from anyone would be great.
Cheers
 

micky01

New Member
EDIT: Never mind about that last question, I realised that the picaxe can only excute one line at a time, thus cant have a recv and transmitter &quot;working&quot; at the same time.
 

Dippy

Moderator
Sounds like you could do either method.
I just hope your dispenser doesn't miss the switch-off command.
 

Michael 2727

Senior Member
Dippy, are you having an OFF day ?
You missed the &quot;water or what ever.&quot;
Beer dispenser <img src="smile.gif" width=15 height=15 align=middle> wink, wink.
 

hippy

Technical Support
Staff member
Also, if they are on the same frequency / channel, two transmitters cannot transmit at the same time.

As noted by Dippy, if the dispenser misses the &quot;stop&quot; command you'll soon have a flooded floor. In this type of application it is far better to have the transmitter work as an activator, just like a button push which causes a sequence to unfold and stop of its own accord, under its own control - even if the 'button' ends up jammed on.

Sod's Law - Whatever can go wrong will go wrong. And at the most inopportune moment and despite hours of testing which shows it will never ever happen.

With that in mind, you may also want to build in some protection to prevent the dispenser being triggered by someone locking their car with a key fob nearby or an emergency service digital radio transmission interfering with the system.
 

Dippy

Moderator
Oh, I was innocently assuming it was water or fruit juice. Beer? Forget the OFF, just use a bigger glass.
 

boriz

Senior Member
How about a fixed dispensed volume per trigger. Say half a pint. Then no matter what goes wrong with the TX, you can never lose more than half a pint. Send two triggers for full pint etc.
 
Top