Bare minimum requirements to power 3.3V or 5V device from mains - Page 1
Forum section: electronics / beginners

author: paulca
author_rank: Super Contributor
timestamp: December 30, 2017, 11:55:53 am
content: 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.pdfAs 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/

author: KugelBlitz
author_rank: Contributor
timestamp: December 30, 2017, 12:30:54 pm
content: 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 theRecom RAC02-3.3SCsmps. 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:https://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.

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: December 30, 2017, 12:47:47 pm
content: 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 programminghttps://tech.scargill.net/32mb-esp01/Its is better when possible to choose a 4MB module.

author: Kjelt
author_rank: Super Contributor
timestamp: December 30, 2017, 12:50:29 pm
content: 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% lossDepending 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,5mm2solid 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 lowas 0,5mm2stranded 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.

author: paulca
author_rank: Super Contributor
timestamp: December 30, 2017, 01:21:59 pm
content: 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:mNkQGcU0dvkTkc5Hs9294LAOTA 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.

author: Kjelt
author_rank: Super Contributor
timestamp: December 30, 2017, 01:57:32 pm
content: Quote from: paulca on December 30, 2017, 01:21:59 pmIndeed 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 30m2addition to the living room, I placed in total about 300 meters of tubing and almost 1,8 km of wire , the picture is halfwayIn 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 tubeI took the 1,5mm2230VAC 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

author: paulca
author_rank: Super Contributor
timestamp: December 30, 2017, 02:05:01 pm
content: 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.

author: Seekonk
author_rank: Super Contributor
timestamp: December 30, 2017, 02:29:08 pm
content: 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

author: Nusa
author_rank: Super Contributor
timestamp: December 30, 2017, 03:08:09 pm
content: Quote from: paulca on December 30, 2017, 01:21:59 pmYou 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.