Author Topic: Integrating AC-DC Power module into hobbyst PCB  (Read 372 times)

0 Members and 1 Guest are viewing this topic.

Offline santinilorTopic starter

  • Newbie
  • Posts: 3
  • Country: it
Integrating AC-DC Power module into hobbyst PCB
« on: April 30, 2025, 11:38:02 am »
Hi,
I will preface by saying that this is my first post inside this forum, hence please forgive me if I make any obvious mistake.

Coming to the reason of this post. I am designing a simple terrarium controller that will essentially monitor the temperature and humidity of my terrarium, and turn the heater (ceramic resistive heater) on and off accordingly using a solid-state relay (I was thinking of using a PD controller with PWM if anyone is interested). Now, to control everything, I will be using a raspberry pi pico 2w. Since I already need to bring mains ac to the electronics enclosure (to power the aforementioned heater) I was looking into safe ways to power up my control circuit with mains AC. I am designing a simple PCB to connect everything, and I found out about these power modules which can be mounted on a PCB and encapsulate all the power supply circuitry; here I link one just for reference [url]https://www.lcsc.com/datasheet/lcsc_datasheet_2410121947_Recom-Power-RAC03E-05SK-277_C5382940.pdf]https://www.lcsc.com/datasheet/lcsc_datasheet_2410121947_Recom-Power-RAC03E-05SK-277_C5382940.pdf] [url]https://www.lcsc.com/datasheet/lcsc_datasheet_2410121947_Recom-Power-RAC03E-05SK-277_C5382940.pdf [/url].

My thought was of having a portion of the PCB reserved just for the AC circuit, and then connect the regulated 5v circuit to the dc side.
The AC circuit would just consist of an AC terminal, a fuse on the hot line and then the power module and the relay. I attached a simple schematic to better explain what I mean. I know I need to properly size the traces and space them from the DC ones.

Now I've never dealt with Ac directly inside one of my circuits, and I would love to receive feedback on this approach.
« Last Edit: April 30, 2025, 09:07:26 pm by santinilor »
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 10521
  • Country: nz
Re: Integrating AC-DC Power module into hobbyst PCB
« Reply #1 on: April 30, 2025, 11:58:06 am »
The concept all seems fine to me.
Your 2W Pi pico will likely need burst currents above 3W so you will need to make sure you have enough capacitance on the output of the 3W converter to keep the pi happy. But that shouldn't be hard.

You could maybe consider some mains input filtering, but if it's just a hobby thing it may not be needed.

And make sure you use the actual earth pin for connecting to the case or exposed metal parts.

One important thing, don't label mains neutral as earth, it's confusing and might lead to actually wiring it up wrong.

Consider what will happen if the circuit fails somehow and the heater stays on 24/7. eg Don't design a system that require under 100% PWM to avoid melting and catching on fire. It's a bad idea.

If you want something safer, so you don't have to deal with mains at all, you could use an off the shelf IOT wifi style mains relay plug and have the heater connected to a normal mains plug connected to it. 
Then talk to the wifi relay from the pi for on/off control over wifi.  If you want PWM you'd have to find a mains wifi plug that supports that.
You'd still need to power your circuit somehow so you'd need a DC in jack and a ACDC wall brick

« Last Edit: April 30, 2025, 12:23:01 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: santinilor

Offline santinilorTopic starter

  • Newbie
  • Posts: 3
  • Country: it
Re: Integrating AC-DC Power module into hobbyst PCB
« Reply #2 on: April 30, 2025, 12:29:57 pm »
Thank you, I really appreciate you taking the time to answer my question.
My bad on labeling neutral earth, I am still new to the AC side of electronics, as I said, and was using it as an analog of "GND" in DC. I will create global labels both for Live and Neutral in order to prevent any confusion. Regarding the connection of the metal casing to earth, I was planning on 3d printing my case so it will be plastic (probably PETG or PLA).

I didn't consider input filtering. In your opinion, can it be beneficial to include it in this kind of circuit?

I thought about using an external wifi relay, but given that I am planning on implementing a PWM control, I didn't want to be dependent on wireless communication. I thought about just powering the DC circuit with an external power supply, but since I already need mains, I didn't want to add another cable to run from the socket.

Regarding the concern on the circuit failing and the heater remaining on I am thinking of mitigating the issues this way:
1) The heater can be powered constantly without risk of melting. The PWM is only needed to reach the desired temperature setpoint.
2) I will probably use a normally open relay so that in case of power loss of failure of the control circuit, the heater will be disconnected.
3) On the software side I will monitor the temperature and send a notification if it exceeds some threshold
4) I will make the raspberry pico ping my server so that I will know if there's a power loss

« Last Edit: April 30, 2025, 12:46:40 pm by santinilor »
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4124
  • Country: nl
Re: Integrating AC-DC Power module into hobbyst PCB
« Reply #3 on: April 30, 2025, 08:30:37 pm »
Your use of the "Earth" symbol is unconventional. There is a difference between "ground" and "Protective Earth" (PE). The normal convention is to use "ground" (GND) symbols for the "reference" / "zero". and use Earth symbols only for PE (connected to pin 3 of J3). But it is just a convention...

According to the datasheet, that Recom power module  has "significantly wide margin to class B EMC compliance without external components". so apparently it does not need extra filtering, and you just have to make sure of wide enough clearances (both between the AC input wires, and primary and secondary). Also, I think it's (officially) illegal to use a plug with a PE connection, and then not use it in your appliance. Here in the EU, there are basically two options. Use PE as a barrier between mains voltage and anything that can be touched, or do not use PE, but use a double reinforced insulation barrier instead. But it's a long time (30 years or so) since I looked up details. With DIY you can get away with a lot, but having an idea of what the regulations are, (and why they are what they are) is probably a good idea.
 

Offline santinilorTopic starter

  • Newbie
  • Posts: 3
  • Country: it
Re: Integrating AC-DC Power module into hobbyst PCB
« Reply #4 on: April 30, 2025, 09:05:39 pm »
Thank you for your help. Yes, the misuse of the Earth symbol was already pointed out to me and was just a stupid error on my part. I have edited the initial post with a corrected schematic. Regarding the regulations concerns, as you say, this being a personal project only, I am not bound as strictly by them, but I am very interested in the reasoning behind them and the general safety guidelines. After all, the main reason I wrote this post is to make sure I am not underestimating the dangers of AC.
Since the schematic was just made for illustration purposes, I mistakenly used the socket symbol with PE even if I am not planning on using a plug with a PE connection since my enclosure will be 3d printed and not metal. Is this an ok reasoning, or am I missing something?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf