Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
mtiutiuM

mtiutiu

@mtiutiu
Hardware Contributor
About
Posts
168
Topics
4
Shares
0
Groups
1
Followers
1
Following
0

Posts

Recent Best Controversial

  • Your workshop :)
    mtiutiuM mtiutiu

    @skywatch

    OMG...

    General Discussion

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    @berkseo

    Yes, it's available here. The documentation is a little bit scarce I admit but if you understand Apache MyNewt and its build system it should be pretty straightforward theoretically.

    I will add more details when I have the time. The code was tested and it's in production. Works without a glitch so far.

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    @scalz
    Thanks.

    To answer your questions:

    • Range is not that "big" if having multiple walls - if more than 1-2 walls things start to degrade but having more nodes in the mesh helps to overcome this. Also one can tune the number of retransmits as shown on my blog and having more relaying nodes will help a lot also. Of course my custom RF design is not perfect or that optimized. Add to that the ceramic antenna which is not that great...
    • Power consumption is a plus also indeed as per node I get around 7mA x 3.3V ~ 24mW. Let's add to this the leds and touch capacitive sensor and make it 30mW on average but no more than that. I enabled the internal DC-DC converter of the MCU and add to that the fact that the nodes will stay more in RX mode hence the 6-7mA constant current draw.
    • The boards are a little bit different but not much from a RF performance point of view (I'm still learning this part when it comes to PCB layout)
    • The hatched ground plane differs around the capacitive pad(s) but that's because the PCB was designed initially using EasyEDA which offers "90 degree" hatches. Then I ported the PCB to KiCAD where I had to do a little trick with some polygons at 45 degree as it doesn't support hatched ground planes (not now at least or in the stable version).

    I tested already both designs - the original one and the KiCAD conversion also and both are working as expected.

    Yes it was lots of work and especially the power supply PCB design for which the main inspiration was the DER-622 application note from Power Integrations.

    But I'm very happy with the overall result. I will update the blog with some real life videos of the whole system in action in the near future also. There will be more blog entries targeting this topic - that's for sure.

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    For those interested I started "documenting" my work and what I achieved so far on my blog (first time I'm "blogging" :) ).

    OpenHardware.io switch power supply

  • 💬 NRF52832 1 channel control plate for in wall switch
    mtiutiuM mtiutiu

    @jeremushka

    Same software can be used. The pin definitions need to be changed though.

    OpenHardware.io

  • 💬 NRF52832 1 channel control plate for in wall switch
    mtiutiuM mtiutiu

    @jeremushka

    It can be used in a MySensors network if desired. In my case it will be used as part of a Bluetooth mesh network.

    OpenHardware.io

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    And the real product pictures now:

    IMG_20200325_185247.jpg IMG_20200325_184401.jpg
    IMG_20200325_183841.jpg IMG_20200325_183823.jpg
    IMG_20200325_183643.jpg IMG_20200325_183620.jpg

    Short demo of touch functionality (will post later on the bluetooth mesh network functionality):
    https://streamable.com/b52qb
    https://streamable.com/dj3z7

    Sorry for the solder bridge replacing the R20 inrush current limiting resistor..that's just temporary until I get the real component :smile: . And yes, the capacitor across the bulb is still needed but it's a very small one of 0.1uF/250Vac and it should fit near the light bulb on the ceiling (only one is needed if there are two light bulbs on the same circuit).

    The aluminum foil wrapped around that sponge is to "extend" the capacitive sensor so that it reaches the front plate fake plastic button. The 3d printed clear plastic around it is to hold it in place and also to spread the small leds light.

    Everything is custom made except for the front plastics.

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    As promised the final design! This is for one channel which I will use mostly in my house. The backside is 3d printed and it holds the electronics. The front panel and fake button are bought from the local store (Leroy Merlin) and I like it very much (it's part of modular switches design and it's very cheap). I could 3d print the front side plastics..but it I can't get the same look and feel - can't beat the molded plastic with a 3d printer for now ... (well you could use some resin or other stuff to fill the holes and then spray paint but still it's a lot of work and it doesn't worth imho)

    Here are some pictures from the design. I will post later the pictures with the real product also.

    exploded_view.png
    one_piece.png

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    @berkseo

    50pcs/lot EE10-A1 Switching Power Supply High Frequency Transformer 220V to 5-12V Maximum Output 3W
    https://a.aliexpress.com/_sOShjH

    It's the same supplier that I used also and the lot seems to be fine...well at least the 2 pieces that I tested so far :smile: .

    Now the latching relays. I found them on Aliexpress only and I received something else instead (which seems to happen from time to time) but luckily it works OK so far. So instead of Hongfa relays I got Massuse which seem to be equivalent.

    massuse.jpg

    Rest of the components can be sourced from LCSC which is a more trusty component supplier compared to various vendors from Aliexpress (which I already knew..but I didn't had other choices).

    Oh and the PCB design and everything else was done using EasyEDA for obvious reasons (JLCPCB is very cheap and pretty good quality for a hobbyist, also their SMT service). I really like their ecosystem - you just create the design using their tool and order everything from there - very, very handy and cheap also as I already mentioned.

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    I did some final testing and everything seems to work just fine so I can say that this is the final revision. The touch sensing board including radio/mcu must not draw more than 10mA (it will work but won't be stable).

    I updated the BOM and schematic with required voltages for caps where it's more important - the rest are 10V or so not that critical (the ceramic caps should be X5R or X7R).

    Oh and I replaced the 22uF/25V capacitor with a tantalum type. Initially I used a ceramic one and the board started to sing :smiley: . Well not quite..it was a more of a buzz because as you all know SMD multi layer caps are known to have this property.

    Next step as already mentioned above is to design the enclosure which will be 3D printed with PETG. The front side will be a custom glass plate also which I'm thinking now how to make it look and fit better.

    It works slow on my side because...well my free time available for this hobby is kind of limited.

    OpenHardware.io switch power supply

  • Battery powered latching relay node
    mtiutiuM mtiutiu

    @iancu
    Usually it's best to have an uninterruptible power supply when it comes to building actuators because you want it to "act" all the time. Using batteries for such a thing I wouldn't say it's a reliable choice on the long term.
    Imagine what would happen if you do this for a light switch and you come home one day and you find yourself in a situation where you cannot turn on the lights...Of course this very much depends on the final application but still in my opinion actuators should be always powered.

    Troubleshooting

  • Battery powered latching relay node
    mtiutiuM mtiutiu

    I still don't understand why people are still bothering to use NRF24l01...it's old tech nowadays :smile: . Well I get that it's cheaper and bla, bla but when it comes to performance and tuning things up it gets harder imho. Not to forget that you still need another MCU in order to make it work thus increasing BOM and complexity (yes, yes I know why some prefer "decoupled" systems, but still...)

    Why not use NRF52832 which is a much more compact solution and let's face it more efficient than the old NRF24L01. Oh and let's not forget that it has a MCU inside also.

    I think the list of advantages is obvious:

    • More TX power: 4dbm compared to 0dbm.
    • Incorporated MCU
    • Incorporated DC-DC converter which when enabled will reduce the current consumption in both TX and RX mode (7.5mA in TX mode and 5.4mA in RX mode - this is only for the radio subsystem)

    Simplified design when using an already available module like the CDEBYTE or CDSNET from Aliexpress (just search for nrf52832 cdebyte or cdsnet) is also a plus. Those modules are really cheap now - around 3$. Oh and it needs to have those external components (inductors, caps) to be able to use the internal DC-DC converter - the CDEBYTE or CDSNET modules have it.

    Now back to this topic main discussion regarding battery powered nodes which need to be pretty responsive no? Well it's not that easy using MySensors to accomplish this - I may be wrong but I tried this for one of my projects and no matter what techniques I used I couldn't achieve the desired results.
    Why? Because MySensors it's not designed to create responsive battery powered nodes - please do correct me here @mfalkvidd if I'm wrong. By responsive I mean to make it respond in a time window of <= 1s.

    @iancu If designing pretty responsive and battery powered nodes then Bluetooth LE is your best bet. I know that it's not MySensors but only BLE can achieve that as far as I know (NRF52832 supports BLE also which is yet another advantage).

    I know that this deviates from MySensors and it's not that have something with this project - it's a really great project but we have to know its limitations (as of now at least).

    Another alternative would be LORA modules which this project supports also and which have lower RX current because this is the state you would want to stay in most of the time (NRF52832 has it pretty low with the internal DC-DC enabled). But I'm not familiar with LORA modules and from what I've read the TX time cand get very high depending on the modulation speed which is not ideal also.

    So what do we need in the end for MySensors: radio modules with very low RX current and fast TX time. Do they exist? I'm not quite sure to be honest (excluding lots of marketing stuff). Faster TX time means also a faster modulation speed/scheme which is achievable even by NRF24l01 so I don't think this is an issue nowadays.
    When it comes to MySensors I think a good start is the NRF52832 based modules at least but it won't guarantee the responsiveness that you're looking for @iancu - for that you need a better software stack and radio protocols also imho.

    Troubleshooting

  • Modular sketch to be configured with JSON (idea)
    mtiutiuM mtiutiu

    @monte

    Are you suggesting to implement something like esphome has? If that's the case then I would prefer yaml instead of json as it's easier to read and maintain imho.
    The idea to have code generated from a configuration file is pretty neat and it simplifies tedious and repeating tasks a lot besides abstraction.
    NodeManager should help as it seems to be pretty modular.

    Development json nrf52 fota

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    Started designing the enclosure for 3d printing ... I will use PET-G as it's pretty strong and not very flammable or so it seems after some tests. I don't know about electrical insulation properties yet ...This all very depends on what other compounds are used when it's manufactured.

    sw_custom.png

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    As a general rule it seems that the input capacitor is choosed based on the needed output power which is obvious and the magic formula is (when using a bridge rectifier):

    C (uF) = 2 x Pout (W)

    So in my case one relay draws about 300mW when switching and we have two so let's take the worst case 600mW. Then the radio part and mcu should not take more than 30mW of power.
    Summing up we have 630mW peak which translates to a 1.26uF capacitor and the nearest is 1uF.

    I just tested with 1uF and it works just fine without a glitch.

    So yeah learning new stuff as I go along. I wanted for a long time to learn how to design offline AC/DC converters because the power supply is the most important part of every circuit and so often overlooked.

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    As a side note: this doesn't mean that the input filtering capacitor is useless in the ac/dc power supplies as it also helps to store energy for the input stage which then gets transferred to the load by the pwm controller. Another useful thing is that it doesn't let the rectified wave voltage to drop too much which may not be very good for the input stage of the pwm controller making it to perform worse.

    But in my case and particularly in this application it interferes when the switch "switches" between the two power supplies (well the other one is more of a "series regulator").

    I will do some more tests. The most important thing for me right now is the power supply stability and then the thing I was waiting for the most: to create a 2 way setup using 2 switches to drive the same led bulb (for stairways).

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    Received my boards and started to perform some testing. It worked OK when powering front plates loaded with Bluetooth LE software which are drawing only ~500uA. But as soon as I tried to power a Bluetooth mesh node which draws constantly around 5-6mA then the stand-by supply (the one built around LNK364 IC) didn't acted fast enough when performing the switching causing the BLE mesh node to reset. In other words the power supply startup time was pretty slow for this kind of circuit.

    After some serious investigations and headaches (around 3-4 days or so) I finally found why. It has to do with the AC-DC converter "capacitive loading". Initially I though that it was because of the output filtering capacitors and which are also used to store energy between cycling the bi stable relay on and off. As you all know capacitors are good for filtering the ripple and storing electric energy...BUT and very important for this project over here - if they're too big they make the power supply to react a little bit slow.

    Why? The reason is very simple: if you use too large capacitors then it takes longer to charge (not to mention about high inrush currents) and because of that they slow down things affecting the AC-DC converter feedback loop.

    Well, in a normal use of the power supply and when not cycling between on and off power states too fast this won't be noticed and doesn't matter too much. In my case it matters and guess what? - not the output capacitors were the culprit after tinkering a little bit with their values.

    The input filtering capacitor was causing issues. Yes, I'm talking about the input filtering stage after the bridge rectifier. But in this case I started to "attack" the AC/DC power supply in a different way and that is: what happens at the input stage when the supply is switched on and off ?

    Let's not forget that in this project the stand-by AC/DC converter is in series with the load (light bulb) and it "breathes" and draws power from the mains voltage and the leakage current from the light bulb which can be very small especially when using LED bulbs.

    So what happens actually? As you all know the AC/DC converter won't work if the input AC voltage is less than 85V or so as most are rated to work between 85-265Vac right? But what this means after the rectifier/filtering stage where we have a continuous voltage (let's forget about ripple right now)?
    Taking the minimum ac voltage value of 85V this translates to: 85 x 1.41 =~120Vdc. So untill the input filtering capacitor won't reach that dc voltage value the LNK364 chip won't work and here I'm referring to it's internal voltage regulator that powers the internal circuitry or it's "start up" circuit. (in reality it may be less than 120Vdc, but still...)

    But then you may think: yes, yes but the input filtering capacitor is only 4.7uF - won't it charge fast enough? Well no, and not quite - let's not forget that it's an electrolytic capacitor with higher ESR and not only that - what matters here the most is the fact that the leakage current from the light bulb dictates it's charging rate an that current can be very small !!!

    And now you have it - the input capacitor in this case slows down things and affects the power supply start up time. And it doesn't matter that much if you increase the output capacitors and it becomes even worse because then we end up affecting the feedback loop from the converter.

    So what I did was to remove completely the input filtering capacitor and now it's damn fast - yes the power supply still works as expected but it's much faster between on and off cycles. And if you look at the original Livolo switch it doesn't have it either but now I understand why.

    We have enough filtering at the output stage so it won't affect our powered circuits. It's a little bit noisy at the input but not that much I would say because we have a bridge rectifier. And the load doesn't draw too much current so it should keep up without the input capacitor which also stores energy for the primary inductor. The LNK364 internal MOSFET shouldn't be affected as it's rated to support the peak input values and even more (700Vdc) as the input capacitor was averaging a little bit the rectified voltage waveform (but not that much anyways because it's small value). I will try with a 1uF/2.2uF and see if that slow things again.

    So yes..I was almost ready to give up on this project. Now I'm more happy than ever and also because I learned new stuff. And designing/playing with offline AC/DC converters is kinda new for me. There are still many things to learn of course.

    I also need to thank @axillent for its "AC-DC at own" post from where I got inspired a little bit.

    OpenHardware.io switch power supply

  • 💬 No neutral power supply/relay board for in wall switch
    mtiutiuM mtiutiu

    This board uses the same working principle behind the scenes as the Livolo or Sonoff no neutral switches (some use a triac based implementation). But again the idea is the same - we take advantage of the leakage current from the light bulb. So yes it still requires a capacitor across the bulb in some cases. This is because we power everything via the light bulb which is in series with our circuit and in the end it all comes down to physics law.

    So no @arden , this one is not so different compared to the one that you already have. I did this because I'm a more of a diy person and I like to customize stuff and of course learn from it.
    Another advantage is that you don't depend on external or 3rd party stuff and you can build/customize it whenever you want (of course this means that you know what you're doing considering the fact that you are dealing with the mains here).
    As I live in EU I have only the live wire inside walls for light switches so this is another reason why. I know that there are another ways of accomplishing the same result but I don't want battery powered switches nor putting stuff on or inside my ceiling.

    OpenHardware.io switch power supply

  • Cannot flash atmega328 on new custom board
    mtiutiuM mtiutiu

    @AdamAnt Regarding the interference between MCU and the radio a pull-up resistor on the CSN line helps. By doing this you can program the MCU without any problems after soldering the radio module.

    Now getting back to the main issue here:

    1. Did you checked for shorts between pins (especially the ICSP part: mosi, miso, sck and also the reset pin to not be shorted to ground keeping the mcu in a reset state). Asking this because I see some pins shifted over there a little bit on the corresponding pads from the PCB.
    2. Did you checked for continuity between the corresponding MCU pins and the ICSP header?
    3. Can you post some pictures on how did you wired the USBASP programmer and the ICSP header from the PCB?

    The schematic seems fine from my point of view. There may be some problems due to faulty PCBs also from the factory (it happened to me) - that's why I suggested doing the above tests with a multimeter (shorts/continuity test).

    Hardware

  • Watchdog not watchdogging?
    mtiutiuM mtiutiu

    @alowhum

    It's not portable but for the AVR architecture you can use:

    void before() {
      wdt_disable();
      wdt_enable(WDTO_8S); // 8s timeout 
    }
    
    void loop() {
      wdt_reset();
    }
    

    Other watchdog options for the AVR architecture here.

    Development
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular