Jump to content

Wireless sensors with ESP8266


SteamyTea

Recommended Posts

Been thinking about this for a while, but have no idea where to start and what I need.

 

These ESP8266

https://www.ebay.co.uk/i/291358321099?chn=ps&adgroupid=13585920426&rlsatarget=pla-142405585506&abcId=&adtype=pla&merchantid=109754416&poi=&googleloc=1007013&device=c&campaignid=207297426&crdt=0

Have a few pins on them, some for power, some for data.

Is it as simple as connecting up say a BMP280 to the correct pins, find the wireless signal, connecting to it, reading the data off and then doing something clever with that data so it makes sense.

Or do I need more kit to program the ESP8266, think I read somewhere that you need to program them.

 

Basically it would be nice to make a few wireless sensors to scatter around the place, might also be good to make something to read the flashing LED on my electric meter (like the old CurrentCost could do).

 

So HELP

Link to comment
Share on other sites

Nick, why not with one of the developers of the Lua firmware for the chipset -- me?  For a start don't use the bare ESP-02 or even the the ESP-12E modules as you will need UART, and 5V to 3.3V drop-down.  Use the Wemos D1 mini.  This can be powered and programmed over USB serial port.  Wemos do a range of shields as well.  The price is about £6 from the UK or £2 from China -- if you can bare the 3 week delay.  Give me a ring if you want to chat about options.  //Terry

 

Counting the flashes on the meter is easy, even with Lua -- though if you can't get power to the box (yea, yea, I know, but ours is outside) then an always-on Wemos burns through battery.  You need a low power I2C counter timer; you can then put your ESP8266 into deep sleep and wake up every 30 mins or so to send the reading to your RPi or whatever; this will run for months on a LiPO.  (And Wemos do a cheap charging shield for the D1 mini as well.)  

Link to comment
Share on other sites

Have you got some links to the Chinese stuff, don't really want to buy the wrong things by mistake.  3 weeks wait is nothing, been thinking about this for a decade or more.

 

My old CurrentCost has a battery life of years, how do they manage that from a couple of DDs.

I could open one up and see what is inside, or get @JSHarristo have a look and see if he can copy it cheaply.

  • Like 1
Link to comment
Share on other sites

OK @TerryE this D1 mini looks like a lot of fun but it is Arduino which I am not at all familiar with, python though is fine and it looks like I can install micro python which would give me control of the machine at my level, if I understand correctly? (You would probably like me to install Lua - go on convince me.) The  ESP-8266EX has some great little features although the 10bit ADC is bit limited for resolution. I guess the big question is getting set up to play - is my list complete?

 

  1. Get a D1 Mini (pro?)
  2. Build some I/O around the board to play with.
  3. Install associated driver on PC
  4. Connect D1 Mini to PC using a USB lead.
  5. Download the uPython interpreter binary.
  6. Load uPython to D1 Mini and flash it over.
  7. Get programming.
Link to comment
Share on other sites

@MikeSharp01, Mike,  If you are comfortable in C and the Arduino IDE, then the ESP is one of the targets.  I've used Python, but not the embedded uPython on the ESP8266.  The Lua RTS that I work on is more as Javascript is to Java then Lua is to Fortran.  It's another late binding language like Python, Javascript and Perl, though the RTL is event driven -- more like node.js. 

 

The nice thine about the Wemos is like the Arduino, you just plug the module into a USB port and away you go.  I've a a couple doing all of the I/O on my heating system. 

Link to comment
Share on other sites

10 hours ago, SteamyTea said:

Have you got some links to the Chinese stuff, don't really want to buy the wrong things by mistake.  3 weeks wait is nothing, been thinking about this for a decade or more.

 

My old CurrentCost has a battery life of years, how do they manage that from a couple of DDs.

I could open one up and see what is inside, or get @JSHarristo have a look and see if he can copy it cheaply.

 

Ditto any links to share as likewise would love to give these ago for some simple logging around the house

Link to comment
Share on other sites

Well I have bought a few quids worth of WEMOS D1 mini V3.0.0 from AliExpress, so shall wait until they turn up and see what can be done with them.

Will be nice to have just one RPi storing all the data rather than several (cause it makes it neater).

Have to work out a way to make a decent battery pack.

  • Like 1
Link to comment
Share on other sites

Nick, when you want move from breadboarding to something more permanent, then you will either need the prototyping hat or mount the Wemos as a daughter board on a through-hole board, and UPS hat. Just shout if you want more details.

Link to comment
Share on other sites

45 minutes ago, TerryE said:

But have you got some of these. Absolutely essential for old farts when soldering!

Don't jest.....I tried to splice my boys Xbox headset cables the other day, they were like bloody hairs :(

I put my sons glasses on and it was like looking at tree trunks, so I guess the glasses-less days are numbered......if only I can get longer arms from somewhere...

Those come with different strength lenses?

Link to comment
Share on other sites

I had IOLs ten years ago as well, but I still can't focus at 15cm unaided. Even at 0.1" pitch, these made doing fine solder work just so much easier. And to NickfW's point there is 4 different strengths plus compounds.

 

  • Like 1
Link to comment
Share on other sites

Guest Alphonsox
14 hours ago, TerryE said:

But have you got some of these. Absolutely essential for old farts when soldering!

oxd3162560k.jpg

 

 

I definitely need these - I managed to set fire to my wife's slippers last time I got the soldering iron out - Have you got a link ?

 

Link to comment
Share on other sites

I can't remember where I got mine from. Just Google magnifying headset with light

 

Theother thing that I would recommend is a temperature controlled iron. You can get a cheapy from Bangood or AliExpress for around £30-50 if I recall. They are size compatible with the Pro ones that cost ten times as much, which means that the cheap tips also fit them.The temperature is usually way off calibration, but you just work out the setting that works for you by trial and error.  A lot better than any uncontrolled iron, and good enough for doing the odd through hole board.  Big Clive did a review of one on YouTube, which is what made me buy one.  

Link to comment
Share on other sites

Guest Alphonsox

I had to replace my soldering iron following the slipper incident. I got a cheap temperature controlled one from Lidl/Parkside as a stop gap which works surprising well given that is only cost a tenner. Long term I'm hoping some of the ones in the lab at work will need replacing.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

How are you getting on with the WEMOS

I have managed to get mine connected to my router, then access via WebREPL or a USB Serial connection on PuTTY.

It reads the DHT22s ok as well.

That is as far as I have got.

To connect to the router, I modified the boot.py file:

 

# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
import gc
import webrepl
import network
import dht
import os
import machine
webrepl.start()
gc.collect()

def do_connect():
    import network
    sta_if = network.WLAN(network.STA_IF)
    if not sta_if.isconnected():
        print('connecting to network...')
        sta_if.active(True)
        sta_if.connect('XXXXX', 'XXXXX')
        while not sta_if.isconnected():
            pass
    print('network config:', sta_if.ifconfig())

 

Next is to work out how to get the Wemos to send temperature data to a network drive.

How much 'stuff' and you put into the boot.py file, or is it best to use a main.py file (think that runs at boot too) and use the os commands to run separate micropython files

WEMOS.jpg

Edited by SteamyTea
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...