Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : 240V Remote Control
Author | Message | ||||
Keith @ Senior Member Joined: 19/06/2011 Location: AustraliaPosts: 167 |
Hi Guys I've been busy creating a simple 240v wireless remote control which will eventually turn on or off a heating/cooling pad or refrigerator for a home brew. The temperature sensor to control the on/off would also be logged to the MM's SD card. I purchased a Watts Clever remote control kit with 3 plug-in 240v switches but I suppose any like product would do. Cost $45 and I've still got 2 switches to use. The advantage of going this way was to totally remove the 240v risk from the MM side. I have taken from Geoff's "Battery Capacity Meter" ... using the 5.0v DIL relays to turn on and turn off by connecting the output of the relays to the button pads on the Watts Clever remote. I have written a very simple program to test the concept and used a 500ms pause to reduce any problems with relay contact bounce before turning the pin off. All works as I expected and the MM power usage is minimal as the relay is only momentarily activated. I had some trouble with the PIN, SETPIN commands but the one that I found counter intuitive was the PIN() =0 or =1 where I was thinking that HIGH would turn the pin on and LOW would turn the pin off ... after some digging around and head scratching I worked it out. Question ... Can anyone enlighten me on why PIN(x) works this way? PIN(0) according to the MM manual works in the correct sense. The more we know, the more we know we don't know ! |
||||
donmck Guru Joined: 09/06/2011 Location: AustraliaPosts: 1313 |
A real world application Keith? Not sure I am following your question however, and why you said PIN(0) works fine, but the others don't? zero sets low, non-zero sets high. I would prefer commands such as LOW and HIGH, but there are so many variants of Basic that users have experienced, we would all never agree on anything, so I'll go with what Mr Maximite wants it to be. I am young, I'm flexible. Cheers Don... https://www.dontronics.com |
||||
Keith @ Senior Member Joined: 19/06/2011 Location: AustraliaPosts: 167 |
Don From v2.4 manual ... PIN( pin ) = value ..... 'pin' zero is a special case and will always control the LED on the front panel. A 'value' of non zero will turn the LED on, or zero for off. However, when I followed this logic trying to use PIN(11)=0 and SETPIN(11),9 it actually turns pin 11 on ie turns the relay on. Whereas PIN(11)=1 turns the relay off. I suppose you are right in your answer that this is the way the MMBasic has been created ... I'm not being critical as much as letting people know what I have encountered. I have not tried using PIN(0) to check the logic as listed above from the manual. cheers Keith The more we know, the more we know we don't know ! |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
The reed relay is wired between 5V and the open collector output from the Maximite. When your program wants to turn on the relay it would have to pull the pin low so that +5V will appear across the relay. To make an output low you program PIN(x) = 0 So, due to the way the relay is wired up it inverts the output from the Maximite. To make it easy you could define two variables like this: 10 RELAY_ON = 0 : RELAY_OFF = 1 Then you could use them in your program: PIN(x) = RELAY_OFF This technique would also help Don: 10 LOW = 0 : HIGH = 1 20 PIN(x) = HIGH Geoff Geoff Graham - http://geoffg.net |
||||
VK6MRG Guru Joined: 08/06/2011 Location: AustraliaPosts: 347 |
I have one of these remote 240v switching devices, and I think it would be a perfect thing to incorporate into the WIB. Then using the digital out's, control the remote and the analogue in's to monitor current, voltage etc. Its easier to ask forgiveness than to seek permission! ............VK6MRG.............VK3MGR............ |
||||
VK6MRG Guru Joined: 08/06/2011 Location: AustraliaPosts: 347 |
By the way, as it a web server based device, no negative comments about wanting an Ethernet port for a web server option for the Maximite Its easier to ask forgiveness than to seek permission! ............VK6MRG.............VK3MGR............ |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
it`s sposed to be home brew not tech brew constant tempreture would be a good idea but i did it for about four years and the trouble i found was the summer too extreeme it would stop fertmenting technicians do it with least resistance |
||||
donmck Guru Joined: 09/06/2011 Location: AustraliaPosts: 1313 |
too easy Geoff, Cheers Don... https://www.dontronics.com |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
sorry i got confused overflow in the heat and stop ferm in the cold ....two stars i got a bit carried away ...sorry no more home brew chat technicians do it with least resistance |
||||
RossW Guru Joined: 25/02/2006 Location: AustraliaPosts: 495 |
I argued for that but got yelled at, so maximite is totally off my radar now for the forseeable future. I'm developing for another board which I'll be using (and supplying to others) because it DOES have ethernet. Its not expensive either. *shrug*. If the zealots *permit* development of something as *technical* as ethernet, then I might reconsider - but now that I've put all my efforts into an alternative product, it'd be unlikely. |
||||
VK6MRG Guru Joined: 08/06/2011 Location: AustraliaPosts: 347 |
The WIB is a PIC based device, so it shouldn't be to hard to add the Ethernet controller, MAC address chip and other bits onto an external board and mod the WIB firmware to suit the Maximite. Just a thought. Its easier to ask forgiveness than to seek permission! ............VK6MRG.............VK3MGR............ |
||||
Print this page |