Author Topic: Bare minimum requirements to power 3.3V or 5V device from mains  (Read 479 times)

0 Members and 1 Guest are viewing this topic.

Offline paulca

  • Super Contributor
  • ***
  • Posts: 1704
  • Country: gb
Bare minimum requirements to power 3.3V or 5V device from mains
« on: December 30, 2017, 10:55:53 pm »
I was looking into home automation last night again and the little ESP8266 board popped up and gave me some ideas.  As I see it, it's basically a Wifi enabled out-of-the-box Arduino-like MCU dev board.

I figured a very easy first project might be a table lamp with a REST-like HTTP API for turning it on or off.

Similarly I could consider using the ESP8266 in place of a much heavier and costly Raspberry PI for running things like temperature, humidity, air pressure sensors and sending over the network or switching a relay.  I know I had a rant about this the other day but I was looking at it from the point of view of the Arduino not necessarily being convenient due to adding Wifi being a pain and quite expensive.  The ESP8266 kinda moots that point as they cost only £3 with Wifi built in.

Obviously the remaining 'wire' required is power.

For low voltage only I could just use a USB wall wart and a 3.3V regulator.
For main powered devices I could hack the USB wall wart and place it in my enclosure with a 3.3V LDO.

Are these suitable for running 3.3V boards direct off the mains?
https://uk.rs-online.com/web/p/embedded-switch-mode-power-supplies-smps/1358895/
Datasheet: http://docs-europe.electrocomponents.com/webdocs/15c7/0900766b815c7588.pdf

As an aside for actual light bulbs it appears that people are buying IoT lightbulbs which are already based on the ESP8266 or an Atmel MCU with a WiFi module.  They hack into the Tx/Rx pins and reprogram them.  Seems like an interesting idea to break you free from whatever nasty online portal they normally attach to via the internet and allow local network control from custom servers or an OpenHab system.
https://www.cnx-software.com/2017/03/03/ai-light-esp8266-based-wifi-rgb-light-bulb-supports-mqtt-via-espurna-open-source-firmware/
"What could possibly go wrong?"
Current Open Projects:  3 Channel Audio mixer with DAC, BT, pre-amps and h/phone amp, WS281x LED controller Version 2 5V/5A w/Atmega328, FY6600 Power supply, 5A DC Load (Still!)
 

Offline KugelBlitz

  • Contributor
  • Posts: 13
  • Country: ro
Re: Bare minimum requirements to power 3.3V or 5V device from mains
« Reply #1 on: December 30, 2017, 11:30:54 pm »
I am doing something similar to what you are planning and I also looked into using the meanwell smps but the place that I buy components from only sell those to companies for commercial use. Instead, I chose to use the Recom RAC02-3.3SC smps. Unlike the meanwell, this requires a fuse and a varistor, as per the datasheet.

Actually, I just built the PCB and it works just fine powering an ESP8266-01 board that switches a relay on or off. If you're interested in my electrical diagram (and also PCB layout) you can find it on this thread:
http://www.eevblog.com/forum/beginners/pcb-design-and-mains-voltage-advice/

The ESP8266-01 only has 8 pins exposed, 4 of which are GND, VCC, EN and RST. This leaves you only with 4 GPIO: TX, RX, GPIO0 and GPIO2. You can use TX and RX as you wish but GPIO0 and GPIO need to either be left floating or pulled high with a pull up resistor to VCC (recommended) or else the chip won't boot into normal execution mode. This means that you won't be able to use GPIO0 and GPIO2 as inputs, only as outputs.
Of course, you can use a variant of the ESP8266 that exposes more pins.

Regarding the arduino, you may get away without using it. You can write arduino style C code and flash it directly to the ESP chip allowing you to program it just like you would program an arudino.
 

Offline JacquesBBB

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: fr
Re: Bare minimum requirements to power 3.3V or 5V device from mains
« Reply #2 on: December 30, 2017, 11:47:47 pm »
I am also looking to these kind of solutions.

The problem with the multiplication of IOT devices, is the multiplication of power sources. One way, is to try to go  to very low power, and then use a  single lipo cell for  several months,  eventually one year.

The other solution is to have a small power supply with very low no load power. The two above solutions seems to be nice.
Right now, I am mostly using ESP8266, which is also the chip in many commercial device.
But when you multiply theses devices, you also want to be able to change the firmware OTA.

In this case, its better to have 4MB memory. This is often not the case in the commercial devices, and for example in sonoff  relays,  people have tried to change the  memory chip to be able to do OTA programming
https://tech.scargill.net/32mb-esp01/

Its is better when possible to choose a 4MB module.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 4683
  • Country: nl
Re: Bare minimum requirements to power 3.3V or 5V device from mains
« Reply #3 on: December 30, 2017, 11:50:29 pm »
You should do an efficiency and cost calculation for this setup first. The standby power in losses runs up pretty high.
mains to 5V will be around 70-75% which is 25-30% loss  :(

Depending on the layout of your house and the amount of sensors you are going to use I would opt for an alternative 12V (or 7,5V) DC grid in your house.

Benefits:
- only one very reliable high efficiency (90+%) mains to 12V DC converter needed (in electricity costs this will save you at least €2 per year per sensor)
- no safety and other regulation issues that are mains related (children).
- small form factor for your devices since the largest parts of the PSU are not present.

Cons:
- single POF if the PSU goes so goes all devices, on the other hand since it is a single PSU you could buy a very good one and preventively replace it every 10-15 years or so.
- you need wiring to every location (use a fuse for each room just after the powersupply).
  I myself use "cheap" 1,5mm2 solid core copper installation wire which has only a 0,2V drop over 20 meters of cable which is negligable and costs 0,20 per meter, you could go as low
  as 0,5mm2 stranded if needed (cheaper) depending on distance to the PSU but with additional losses.
- you still need a DC-DC converter per sensor OR drop the 12V DC to 7,5VDC and use a standard 7805 or other linear regulator (calculate the energy costs before deciding).

Other options:
Instead of Wifi with all the full ether problems use RS485/CAN/ whatever you want, use CAT5 cable and use two pairs for powersupply (your proprietary alternative PoE with only 12VDC on the wires), this is what I have done for my LED lighting when extending my house.
« Last Edit: December 30, 2017, 11:52:41 pm by Kjelt »
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 1704
  • Country: gb
Re: Bare minimum requirements to power 3.3V or 5V device from mains
« Reply #4 on: December 31, 2017, 12:21:59 am »
Installation wiring is an interesting idea.  Something I could consider when I move out of rented accommodation and buy a house next year.

I was surprised to find you are from Holland, from your post I half expected you to be from the USA.  Their building standards are suitable for this kind of ad-hoc rewiring as they usually have wood/dry wall construction and often with underfloor access, so adding a DC circuit would be fairly easy.

In the UK most of my walls are solid concrete block.  I have solid concrete floors (due to commercial premise below), so adding any wiring will involve tracking, plastic conduits, plastering, galvanised boxes etc. etc.  I suppose stapling DC flex around the skirting boards is an option, but I'm not sure my landlord would approve.

I also had the issue with the Mean Well ESMPS being on back order or only available in x20s.  They seem to be a US import only recently on the Euro market.  I found the Recom RAC02-3.3SC and as you point out it requires you add the protection circuitry yourself.  The datasheet I was looking at had the full Macoy, X, Y caps, MOV, choke, fuse etc.  Seems a bit of a faff.  I'll keep looking for fully contained units.

My ESP8266 board is still in the post, but does anyone know what the regulator on the dev board supports?
I went for this one as a first test:
https://www.ebay.co.uk/itm/NodeMCU-Lua-ESP8266-Development-Board-ESP12-ESP-12-with-CP2102-USB-UK-Seller/322485098225?hash=item4b159c16f1:m:mNkQGcU0dvkTkc5Hs9294LA

OTA programming is something I'll look into.  It's not a massive issue to go and pull a sensor and plug it into the PC though. 

I am only expecting half a dozen boards to start with.  Downstairs, Upstairs, boiler house (relay), outdoors (out the living room window, so only the sensors are outside) etc.

The outdoor stuff I currently only have a waterproof dallas one wire out the window, so weatherproofing isn't an issue.  I intend to upgrade that to include the BME280 pressure, humidity, temp, but for that I will need a kind of Stevenson screen/house and thus I have put that off till I move house and have a shed/garage/garden to play in.

On effiency, I don't think I'm that concerned.  Leakage/quiescent power and losses totalling to the order of 1 watt per device is not a big deal.  Multiplying that up it's about 1Kwh every 1000 hours or 50(ish) days.  So a total loss of 1 unit of electricy every 2 months per device.  With 5 devices and 1 year that's a total wastage of about 30 units or £6.
« Last Edit: December 31, 2017, 12:25:24 am by paulca »
"What could possibly go wrong?"
Current Open Projects:  3 Channel Audio mixer with DAC, BT, pre-amps and h/phone amp, WS281x LED controller Version 2 5V/5A w/Atmega328, FY6600 Power supply, 5A DC Load (Still!)
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 4683
  • Country: nl
Re: Bare minimum requirements to power 3.3V or 5V device from mains
« Reply #5 on: December 31, 2017, 12:57:32 am »
Installation wiring is an interesting idea.  Something I could consider when I move out of rented accommodation and buy a house next year.

I was surprised to find you are from Holland, from your post I half expected you to be from the USA.  Their building standards are suitable for this kind of ad-hoc rewiring as they usually have wood/dry wall construction and often with underfloor access, so adding a DC circuit would be fairly easy.

In the UK most of my walls are solid concrete block.  I have solid concrete floors (due to commercial premise below), so adding any wiring will involve tracking, plastic conduits, plastering, galvanised boxes etc. etc.  I suppose stapling DC flex around the skirting boards is an option, but I'm not sure my landlord would approve.
Indeed it requires a lot of creative solutions to make it look better, but I am not too picky.
The LED lighting was done when I build a new 30m2 addition to the living room, I placed in total about 300 meters of tubing and almost 1,8 km of wire , the picture is halfway :)
In every tube I had 12V DC and a CAT cable installed, the nice thing is that 12VDC you are allowed to do that  :)  , with mains nothing else is allowed in the same tube  :(
I took the 1,5mm2 230VAC installation wire for the 12VDC so if I ever sell the house a new owner can remove the CAT cable and still use the wire for mains lighting or whatever.
Oh well it was a bit too much but fun project and since all tubes end in a large metal installation housing I can add DIN PSU's relais, own projects whatever I want, and there is still plenty of room  :)
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 1704
  • Country: gb
Re: Bare minimum requirements to power 3.3V or 5V device from mains
« Reply #6 on: December 31, 2017, 01:05:01 am »
Did you consider PoE?  I'm sure you would have, but I'm not sure of the voltage and current limitations and PoE switches can be expensive.
"What could possibly go wrong?"
Current Open Projects:  3 Channel Audio mixer with DAC, BT, pre-amps and h/phone amp, WS281x LED controller Version 2 5V/5A w/Atmega328, FY6600 Power supply, 5A DC Load (Still!)
 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1716
  • Country: us
Re: Bare minimum requirements to power 3.3V or 5V device from mains
« Reply #7 on: December 31, 2017, 01:29:08 am »
I was on youtube the other day and this popped up. The days of building stuff are over! It uses the esp286. The attached youtube video shows how to easily reprogram it if that is your inclination.  There are numerous other modules in this family that do everything and DC. For the price, this is a deal getting an esp286, a case, connectors, supply and board shipped for $6. Just mod that module. The listing has an explanation of how to use it with your phone.



https://www.ebay.com/itm/112433332794?ssPageName=STRK%3AMEBIDX%3AIT&fromMakeTrack=true
 

Offline Nusa

  • Frequent Contributor
  • **
  • Posts: 972
  • Country: us
Re: Bare minimum requirements to power 3.3V or 5V device from mains
« Reply #8 on: December 31, 2017, 02:08:09 am »
My ESP8266 board is still in the post, but does anyone know what the regulator on the dev board supports?

You can see it in the picture: ams1117-3.3v in sot-223. Good for about an amp, if I recall correctly. However, if your 5V is from a computer USB port, you probably will have less than 500ma on the input side.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf