Radio issue on relay sample



  • I really like this project and am a noob when it comes to Arduino. That said, I feel like I am picking it up quickly. I am wanting to try and automate some light switches in my home. I bread boarded the relay sample and it works great. So I decided to try and build a prototype that I soldered. I used cat 5 wires for my low voltage jumpers to connect things. I used a pro mini and to power it I found some buck converters on ebay that folks claimed work great. I created a soldering bridge to connect the buck converter to my positive and negative AC that is connected to my relay. I want to hijack the AC power source from my switch to power my Arduino and step the power down to 5 volts (kids, don't try this at home). So far so good. Everything I soldered together works when I hook up to 5V usb. I have a vera home controller so I detect the new switch and it is found and enrolls in the system as expected. The button locally on the device functions great and the status updates in vera. Vice versa, I can control the relay from vera and the relay opens and closes on the device accordingly. When I hook this up to the AC is when I get differing results. It always can enroll after a reset. I can usually get it to turn on and off once after a clean reset. After that it is hit or miss. It seems if you wait a few minutes it starts working again but it is far from reliable. From what I have read I suspect it is a power issue. I have purchased the suggested electrolytic capacitor (4.7uf) and the 3.3V regulator (the real tiny ones, I must have missed that prior to purchasing). Somehow I got them soldered on and it works as it is what powers the radio. I put a multi-tester on it to measure voltage when hooked up to USB VS. AC power source. When hooked up to PC I get 4.91 V and the regulator has 3.33xV going to the radio. This seems very stable. When I hook up to AC I get a very consistent 4.96V from the buck converter and the regulator steps that down to 3.37xV. I am getting a slightly higher voltage going to my radio so I was curious if that slight difference could be causing the issue. I am getting pretty close to having something that I can fabricate and put cleanly into a gang box but I need to get it working before I start trying to make it look pretty in a switch box. I also have the capacitor bridged across the radios positive and ground. I feel like I am so close...yet so far. Great work to all the sharp minds that made this project happen!!!


  • Hardware Contributor

    Hi @manicfarmer!

    Do you mean you hook up the relay to AC or when you hook the buck converter to AC (for arduino power) the problems starts? I guess its the AC to relay. This is quite a common problem if you search to forum... relay stops working after some tries, or it only works one way (either button or command from controller). The most common solution is the change to a better power supply.

    Is it a mechanical relay? I read somewhere that these can cause a spikes when they are turned. We know that the radio is extremely sensitive to this. try to power it with your usb cabel from your computer and see what happens.



  • How I have setup the perfboard is to bridge the connections from the relay to the buck converter. It works great when plugged into usb from the pc. I experience the issue when the Arduino is powered from the buck converter. Button never seems to work although I have tested the voltage and it appears to be sending the correct voltage the the pin on the Arduino. I get intermittent results when I toggle the relay using my vera controller. So you are suggesting I try a new way of powering the unit? Here is a link to the buck converter that I am using to power the unit.

    http://www.ebay.com/itm/5V-700mA-AC-DC-Power-Supply-Buck-Converter-Step-Down-Module-Top-Sale-/111856870992?hash=item1a0b306650:g:zeMAAOSwhkRWeg2v



  • @manicfarmer Oh yeah, it is a mechanical relay I believe. Not a solid state, one that uses magnetism.


  • Hardware Contributor

    Well, if it works with power from PC but not power from buck converter you have the issue.

    First thing I would do is to look how you wired ground from the relay. I have had nodes that didnt work if i wired ground directly to source. Sometimes I had to wire it trough the arduino... and I have had nodes i needed to to the other way, relay ground directly to source. (Note: NOT on the AC/Mains side offcourse!)



  • Ground from the relay is wired directly to the source (buck converter). All power and grounds come from that single source with the exception of the radio. I used the voltage regulator to step down the 5V to 3.3V. I used the ground from the buck converter to ground the voltage regulator. Are you suggesting that I try to ground the relay from the Arduino instead of the buck converter? I was also thinking of putting one of these on order to test it out.http://www.ebay.com/itm/1PCS-HLK-PM01-AC-DC-220V-to-5V-Step-Down-Power-Supply-Module-Household-Switch-/221950420477?hash=item33ad46a5fd:g:8WYAAOSwxN5WVRA-

    I hate to order just one in case it works because I have to wait on China shipping. Does anyone know if this is a better solution than the buck converter I posted up top?


  • Hardware Contributor

    @manicfarmer said:

    Are you suggesting that I try to ground the relay from the Arduino instead of the buck converter?

    Yes - No harm in trying that, it has worked fo me.

    About the HLK-PM01 - I use these in my AC designs and so far (in this forum) i think its the most discussed as it comes to safety. I would use those any day before those cheap buck converters. They are working great for me.



  • I will definitely give that a try. I am also going to order about 10 of these HLK-PM01 for in wall switches. Maybe all the buck converters I have can be used for something that doesn't use relays and live inside a small enclosure. Thanks for the suggestions. I'll give them a try and post my results.


  • Hardware Contributor

    As a tip, there is some projects on openhardware.io if you want to use HLK-PM01.
    Of if it works changing power, you could try a diode before the relay if you want to use that buck converter.



  • Thanks for the tip(s)! I have actually stayed away from openhardware because it sounded like it was out of my league at this point. I have relied on google for most of my searching and found some cool in wall PCB projects but none that were a finished product and worked the way I had hoped. I just found your project on OpenHardware and am very impressed. Great work!!! It looks like you have already done what I am trying to prototype. I am going to take a closer look at your project. I would probably be better served starting with something that is much closer to a finished product. I think I am going to look at the components and try to build a few to test them out.


  • Hardware Contributor

    There is also a HLK-PM01 with a relay already attached - which mine has not.
    http://forum.mysensors.org/topic/1540/110v-230v-ac-to-mysensors-pcb-board
    This is a bit bigger so check if it fits inside the wall if that is the purpose.

    Also im releasing a new design for my in-wall sensor, this has a few AC traces to close to each other which might be dangerous if you have them in either a enviroment with high humidity or a unclean enviroment.



  • @sundberg84 I did see that project but didn't look at the design in detail. I really like the idea of the relay and power being in one unit. I definitely have some reading to do.

    I did try and ground the relay to the Arduino. The results seem to be not as good as before. I got it to function a couple of times but most of the time it didn't seem to work. Of course when it is powered from USB on my PC it works great. I hooked up the TX, RX and DTR so I could hook it up to the serial monitor to see what the output says and I was getting some readable output and some that wasn't. Pasting output below. Typically each send command prints on its own line so maybe this has something to do with the issue I am experiencing.

    send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=5,sg=0,ót=ok:1.5.1send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
    repeater started, id=1,!parent=0, d¿/W–k•õÅrþsend: 1-1-0-0 s=255,c=3,t=11,pt=0,l=14,sg=0,st=ok:Relay & Button
    send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st?ok:L‚
    send: 1-1-0-0 s=1,c=0,t=3,pt}0,l=0¬sg=0,st=ok:


  • Hardware Contributor

    Those strange characters indicate it's a power problem in my world.



  • Got my HLK-PM01in the other day so I removed the buck converter from my test board and added one of these and now it communicates fine. Thanks for the advice.


Log in to reply
 

Suggested Topics

  • 87
  • 5
  • 5
  • 7
  • 2
  • 7

8
Online

11.4k
Users

11.1k
Topics

112.7k
Posts