ESP8266 Progress

There can be no doubt that I still have some way to go in terms of reliability with my test rig in Spain before putting this stuff in charge of the heating back home in the UK:

Raspberry Pi 2 is on an un-interruptible supply but does not 100% recover from loss of broadband. One example made my Apache instance disappear until I rebooted the Pi !! I’ve just instigated a check for Google connectivity every 15 minutes leading to a reboot if no success – hoping this will solve the problem.

ESP8266 board mostly recovers from power failure but I have one example of it simply not communicating until next power cycle. Will soon do some tests removing the power for various periods from milliseconds upwards.

Other than these points, I’m starting to get somewhere. I have plant-watering control running, a kitchen light under dusk to midnight control using my Node-Red scheduler referred to elsewhere – and as of this morning I’m logging external temperatures locally every 15 minutes using MQTT and Node-Red to ask for temperature, MQTT, Node-Red and MYSQL to store the temperature (as read by a DS18B20 using my own ESP8266 fast code) and local HighCharts and PHP to read the temperature from the DB (including missing values) on a chart on the Pi (up to now I’ve always used GroveStreams for everything but I’d like to try storing information locally). I’ve documented all of this in previous blog entries. At some point I want to scrap the PHP and use JS within Node-Red.

Building up to this seems such overkill – but then now it is done, the sky is the limit – setting these up (below – and remember – click on any image to show full size version) took no time at all. I used the scheduler with a new addition to my little ESP board, a timer option which turns the output (ESP-01 for example) on on request for X minutes – the board then turns the output off all on it’s own.

So for the watering I just sent the same message at dusk and dawn, a timed request for 4 minutes of watering. I figured dusk and dawn were as good a time as any and no chance of blasting hot water onto the plants (believe me, in Spain if you try this at lunchtime from a typical black pipe watering system, you’ll fry the plants).

The lower block above simply puts out the temperature request every 15 minutes and above that an MQTT block picks up the incoming temperature and fires in insert command off to the MQTT node.

Meanwhile I’ve been pondering a device I’d not specifically come across until yesterday, the Si2302 N-channel MOSFET. From EBay these work out at a few pence each (like, 3p in quantity) and are simply tiny SMT devices (but large enough to solder by hand). I’m thinking these might do for powering LED strips, both simply on-off control and PWM. If I’m reading the spec right, these should work just fine from the 3v + output of an ESP8266 with no other components (no base resistor for example) and with 1 amp’s worth of LED STRIP (12v) attached I reckon the chip should dissipate no more than 80mw. Of course my maths could be miles out but I’ve a few samples on the way to give this a shot and if they pan out I’ll stick them on the next board.

Has anyone had any experience of this particular MOSFET?

Post navigation

0 thoughts on “ESP8266 Progress”

Si2302 are fine for switching LEDs, just do not exceed the power rating, about 1A is fine. If you order from ebay and seller is near China it is most likely to have marking "A2SHB". Not genuine Vishay part but work as well.
For a higher current you may consider AO3400A, same SOT-23 package but a little beefy.

Oh thanks for that Baoshi - as you say they ARE more beefy - but accordingly more expensive. With a maximum power dissipation of 1.4w I'm guessing they'll handle WAY more power. Well I was just looking - and a friend had pointed these out as cheap. I see a use for both - your A03400A for driving LED strips and the Si2302 for handling relays etc. Hmm.. right I'm off to Ebay.

The AO3400A are showing up on ebay at under US$0.08 each in lots of 100.

I would still be tempted to use a resistor (somewhere around 100 ohm to 1k) between the GPIO and the gate, mainly for protecting the ESP8266 in the rare occurrence of a short on the MOSFET, or a solder or PCB short. Also the resistor gives you some other options, like diode logic, etc.

Hi Oliver... not quite seeing the point - why would I want to use an opto-coupler for low voltage? Now, if switching mains power then there are two general options - first is a relay - and that needs a transistor - so these (cheap) mosfets would do that also... OR I use a solid state relay or opto-triac.

Yes. It check if WIFI (wlan0) has an IP. If not it attempts an new connection. It should be transparent to any running program in your PI...
I'm using this script to assure reconnection if my router reloads.

And so that leads me to a question. What if the router is giving an IP address... but there is no connection to the outside world? Perhaps the Internet provider link has gone down? I'm not sure all programs will handle this?

From the point of view of the script I shared, it wont't do anything. If it has an IP, it will keep the current wifi connection, there's no need for wifi reset.

I'm not fully understanding what kind of programs you mean.

Welcome

Hi - I'm Pete and this is my technology blog. It is BIG. Use the search box below or check out the archives and other links below - be sure to SHARE what you like using the social media buttons and please subscribe to my YouTube channel http://www.youtube.com/PeterScargill

Please register or log in - the top menu changes a lot when you are part of the party... and once in, don't forget to tick the box so you will get email follow-ups to comments.

I am tied to no organisation - I do this for the joy of learning. Maintaining a blog of this size takes a lot of work and I hope you find my contributions useful - if you want to help fund my gadget habit or buy me a coffee - here is a link.

Disclaimer: Because I have no idea of your level of technical skill or the requirements of your country laws in terms of electricity supply etc., I accept no responsibility for any damage caused through following advice in these pages. When dealing with mains voltages you should satisfy yourself that whatever you are doing is safe and if unsure, seek advice from someone who is sure.

Notice: I'm always happy to offer advice on stuff I've written - and indeed take advice. If I can help in any way just let me know but PLEASE don't ask me how to program in C/PASCAL/NODE/etc. There are many resources out there - if you want to program and can't - there's always Google.

Newsletter

The blog will send you occasional emails containing links to recent posts. No ads and your email will not be given to third parties. There's an un-subscribe link on each email. Invalid names will be deleted.

Links

EE Times | Electronic Engineering TimesEE Times connects the global electronics community through news, analysis, education, and peer-to-peer discussion around technology, business, products and design