1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

PIC data logger

Discussion in 'Microcontrollers' started by Nigel Goodwin, Apr 10, 2016.

  1. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    My HC12 wireless boards turned up on Saturday, so I had a play on Sunday - wonderful devices - I simply unplugged the FTDI module from my PIC board,made a couple of small veroboard adaptors, and plugged one HC12 on the end of the FTDI convert, and the other on the PIC board.

    Instant wireless connection, no software changes required - had it running last evening with the sensor in the shed at the bottom of the garden, feeding my PC in the attic :D
     
    • Like Like x 1
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Just got back home, dug out a mains PSU (I was only using a small 9V battery yesterday), and stuck it all out in the shed - I've got my PC downloading the temperature and humidity every minute, and graphing it.

    It's 29.3C and 42.1% in the shed at the moment :D - I'll see what it does over night - I think it might be useful to add a record of the maximum and minimum readings to the software as well?
     
  3. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Just thought I'd show you what's been going on, it's been running (and still is) in my shed at the bottom of the garden, using the HC-12 wireless modules for the connection, here's a graph of the last 50 hours or so - it was beautiful Monday, and hit over 30 degrees in the shed, but not been so good since, and a lot of rain :( We did have a little warmer spell this afternoon, as shown by the peak at the right, interesting that there was a humidity peak shortly before though).

    Shed.png

    Incidentally, this image was saved directly to PNG from the Lazarus program, previous ones have been from PrintScrn and edited with Paint.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,235
    Likes:
    645
    Location:
    Ex Yorks' Hants UK

    hi Nigel,
    Have a look at the BMP180, barometric sensor.
    Got mine from Amazon.
    Eric
     
  6. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Hi Eric,

    Thanks for that, looks interesting, not sure if I want to measure pressure though - but I might get one to play with :D
     
  7. DirtyLude

    DirtyLude Well-Known Member

    Joined:
    Aug 5, 2003
    Messages:
    1,904
    Likes:
    56
    Location:
    Toronto, Canada
    There's a BMP280 now which is better. You can e-bay modules for cheap.

    They really are very cool just to play with. I was amazed at the sensitivity for altitude tracking. I set up a BMP180 with a display and you can watch the pressure reading change as you just raise/lower it a meter. I'm pretty sure there's a thread I posted on it a few years ago on here.

    EDIT, actually the first one I used is the BMP085, even older.
    http://www.electro-tech-online.com/threads/bmp085-barometric-pressure-sensor.104889/
     
    Last edited: May 11, 2016
  8. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    That was my thought as well :D

    Same for the DHT22, I got some just to play with :p
     
  9. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    OK, been running five days now, here's the resulting graph.

    Shed2.png

    Interesting to see the daily temperature peaks, although Tuesday was a bit of a crappy day :D

    I'm also a bit puzzled as to why Wednesday, Thursday, and Friday all have a humidity peak just before the temperature peak?, presumably Tuesday was just too crappy for anything to happen.
     
  10. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,316
    Likes:
    1,230
    Location:
    Cardiff, Wales
    Maybe the humidity peak preceding the temperature peak could be explained by evaporation of overnight dew?
     
  11. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    It's the middle/late afternoon though - about 4:00 PM or so.
     
  12. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,235
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
  13. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Nope, never heard of it! :D
     
  14. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Just to keep you all up to date, here's a current example using two wireless temp/humidity sensors, the red trace is outside in my shed (at the bottom of the garden), the blue trace is upstairs in my attic workshop - the very first part of the trace isn't relevant, it was just some manual testing done before the run. Hopefully this shows my insulation in the attic is doing something :D

    The three temperature peaks are Monday, Tuesday and Wednesday afternoons. I'm presuming the tiny blips on the blue trace are when the sun shines directly through the attic roof window?.

    Overall I'm pretty impressed with what it shows, and I'm planning adding more sensors and traces.

    24May16.png
     
  15. Mikebits

    Mikebits Well-Known Member

    Joined:
    May 24, 2008
    Messages:
    6,217
    Likes:
    175
    Location:
    San Diego, Ca
    Great job Nigel :)
     
  16. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Thanks :D

    Better than the weather anyway - and I messed up on the days above, it was actually Sunday, Monday and Tuesday - Wednesday was terrible, and today not great either.

    Here's the continuing graph:

    26May16.png
     
  17. DirtyLude

    DirtyLude Well-Known Member

    Joined:
    Aug 5, 2003
    Messages:
    1,904
    Likes:
    56
    Location:
    Toronto, Canada
    I haven't done a PC program in a few years. Last ones I did were in Visual Basic. I've downloaded Lazarus and will give it a try.

    I made a datalogger a few year ago, but never took it off the breadboard. I was going to take it on hiking/canoeing trips to track weather and my location throughout the trip. Once I made it on the breadboard and got data to the microSD card, I kinda lost interest in it. I put a RFM12B RF module on it, but didn't use it. I think my idea was to throw everything including the kitchen sink in case it was useful. It had atmo pressure, temperature, humidity, GPS, accelerometer (to track when I was moving).
    [​IMG]
     
  18. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Well, it's still running - not been so warm today either:

    31May16.png
     
  19. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Well it's gone a bit warmer now :D
    6June16.png
     
  20. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    I've not bothered posting the latest graph, but I've now got four wireless sensors running, shed, attic, main bedroom, and living room - just got the updated Lazarus program running with four, so see how that goes. The latest two sensors are running off 6xAA batteries, but I've not even measured the consumption yet :D

    Here's a Lochmaster layout of the sensor I've just finished, the board has the corners cut off to fit in a plastic box, with the DHT22 mounted externally, on the end of the box, wired to the three pins at the right. The HC12 wireless module plugs into the connector at top right, mounted upside down. The PSU pins at bottom right are wired to a 2.1mm PSU socket mounted on the opposite end of the box to the DHT22.

    DHT22 sensor.png
     
  21. Les Jones

    Les Jones Well-Known Member

    Joined:
    May 15, 2015
    Messages:
    1,474
    Likes:
    191
    Location:
    Lancashire UK
    Hi Nigel,
    Am I correct in assuming that all 5 HC-12s are working on the same frequency and that you initiate a reading by transmitting an address from the HC-12 connected to the PC which causes one of the HC-12s in the remote units to send its data ? I have just started playing with a pair of HC-12s using a PIC12f1822 to convert the DHT22 data to an ASCII string. This is the circuit and firmware that I have used.

    Les.
     

Share This Page