no worries, im in the same boat as you at the moment
First of all, @mistrovly I am beyond thrilled with your work here In regards to the thread linked above, the circuit they present around the HLK-PM01 is A Good Idea, but it’s also unnecessary with the MeanWell IRM-03 I spec in the build, which is precisely why that part was specified. It has built-in input overvolt and overcurrent protection along with solid filtering on both input and output. It carries the necessary certifications and shouldn’t present EMC problems.
You can save a few dollars buying Chinese supplies, but you wind up spending it again once you add the required protection components and it also costs you footprint on the board. There are a lot of places you can cut corners on this build but the part that is directly handling the high-voltage side isn’t the first place I’d look.
thank you for the advice
Ok I just upload it to my github
Thanks for that
Had a spare 5 minutes today to play with the dremel and an old faceplate i had in the shed. Results arent brilliant, but as a proof of concept it works
Checking the itead wiki, i certainly wouldnt be able to fit a larger screen within a uk faceplate (unless i was to rotate it 90 degrees and use a double plate.
I shall wait and see what the 3d printed faceplate comes out like before i decide to hack into a nice metal faceplate.
Looks good so far
Nice job!
Can you fit the rest of the hardware in the backbox do you think?
Or will you need to hang it in the wall cavity somewhere?
If you’re lucky you may find a makerspace or local fabrication place that can CNC mill these out for you (although not sure about the 45° bevel)
I’ve wrapped up phase 1 of the other project I needed to roll out (pics and live data feed from that) so I’ve spent some time this weekend working on an initial PCB design only to find that @mistrovly had beaten me to the punch!
I’m not going to post links to this until I get the finished boards in hand and can confirm that everything works like it should, but here’s a quick shot of what I’m working with right now:
I’ve added a Phoenix-style connector for AC power and a 2.54mm pitch JST-style connector which means you’ll be able to use the cable that comes with the LCD panel to plug it straight into the board. The AC power connection is milled to allow for creepage which should help a bit for safety reasons. If this works out I’ll be modifying the enclosure to accommodate the phoenix connector and will post all the source files at that point.
Thats look fantastic
I’ve added pin headers for the RCWL-0516 just to see if it works any better, if not maybe we can throw some GPIO pins there or an FTDI header or whatever someone might find helpful. Now hardest part - waiting for the parts!
very nice. One point though, the mains wires are usually just bare, rather than terminating in a Phoenix plug. Surely the screw connectors are more appropriate?
I’m not 100% certain I understand what you mean by this - the Phoenix-style connectors still use a screw connector for the wires, but also offer a quick-connect/disconnect option. There may be some confusion based on the images above which only show the bottom-half of the connector, I may however be missing something and I’m certainly open to input on the design (and am probably doing several dumb things) so if you can help me understand why this might not be ideal I’m all ears
The pads there are at 5.08mm (.2") spacing, which should fit the existing screw connector or a Phoenix-style connector. I like the Phoenix connectors because I can screw them in once and then just plug/unplug them from the board without tools. In either event you’re still going to want a pigtail arrangement coming out of the back. I’ve ordered a handful of various connectors to test out a few different arrangements to get something that will better fit the enclosure, including some right-angle options which may allow the user to easily plug/un-plug the device without opening the rear enclosure or exposing high-voltage contacts.
My end game here is to get something that is easier to assemble for folks that aren’t as comfortable with a soldering iron and maybe build a handful on a Tindie store or whatever so that the hardware aspect of this project doesn’t prevent talented software folks from contributing. Before doing that I want to ensure that the overall design is safe and usable, so please do chime in on any suggestions!
Love your project @luma
It strikes me that your PCB would be a great platform for other mains powered esp8266 projects. To increase flexibility have you considered adding header pads to expose all gpios and power?
I’m currently using sonoff basic switches as they have psu and are so cheap, but the limited number of easily accessible gpios are beginning to constrain my projects.
I was considering placing a set of GPIO pins where the RADAR module connector is for that reason but then it occurred to me: extra-long header pins exist, and you could use those (or the female headers included w/ the Wemos) to provide pin access directly on the Wemos itself. This is nice because it’s cheap and doesn’t require any additional board space and if you can use the female version you get the required parts with the device itself. Would that work for your use case?
edit: if not, any suggestion as to how the pins should be arranged? Another idea I was considering was using that space for an FTDI-style serial breakout for debug.
If you make J3 as long as possible you can get 4-5 more pins in there.
It would allow you to include GPIO 1&3 (TX and RX) + 3v3 and gnd if not there already for the radar.
Also you might might have some space for other gpios, too - off top of head having access to the ADC enabled GPIO would be useful.
I know the suggestion is a bit random as I dont have any specific application in mind, but I think it would beat using long pins as it keeps all the connectivity on the same side of the board.
Future flexibility is good
For the long pins, I mean for them to extend vertically above the Wemos as there is no clearance in the enclosure behind the board. This would put all the connector pins on the same side of the board, and on the side where there’s room for plugging things in.
Still, the point is well taken and I’m currently wading through Ali to pick up some additional wire-to-board connectors to try out a few options. Keep the ideas coming!
My apology, I didn’t realise the other half of the phoenix connector had screw terminals, carry on!
I made some improvement in buttons behaviour, maybe some of you will find this helpful. When you turn on your entity, the button will highlight on yellow, when you turn it off it will back to grey. It works when triggered directly from touch panel and also triggered by turning entity manually, here’s a sample code (based on my kitchen lights):
- alias: HASwitchPlateMain_SceneButton4
hide_entity: True
trigger:
- platform: mqtt
topic: 'homeassistant/haswitchplate/HASwitchPlateMain/state/p[1].b[4]'
payload: 'ON'
- platform: state
entity_id: group.kitchen
action:
- service_template: >
{%- if is_state('group.kitchen', 'on') and trigger.platform == 'mqtt' -%}
homeassistant.turn_off
{%- elif is_state('group.kitchen', 'off') and trigger.platform == 'mqtt' -%}
homeassistant.turn_on
{%- endif -%}
entity_id: group.kitchen
- service: mqtt.publish
data:
topic: 'homeassistant/haswitchplate/HASwitchPlateMain/command/p[1].b[4].bco'
payload_template: >
{%- if is_state('group.kitchen', 'on') -%}
61218
{%- else -%}
65535
{%- endif -%}