Garage Door Monitor likes its sleep

Garage Door Monitor Update #2

The NodeMCU project is still chugging along. I’ve gotten more experiments done which I’ll share with you shortly. Unfortunately, all of this information has left me more indecisive of how I want things. To recap, I want to make something to be able to tell me whether or not my garage door is open or closed without going outside to check. Click here to see the first post about the project.

garage1Problem: Is it dead or does it just like to sleep?

The problem with the NodeMCU working for a while and then giving up on life is still the big one. I’ve done a few overnight tests with a few tweaks (mostly giving it delays/time to do things) with them all resulting in entries stopping after about six hours.

When I use my bench power supply, I’m able to see how much current it’s drawing. When it’s on, it’s pulling about 69mA and peaks to about 71mA when it’s transmitting data. It doesn’t seem like much, but it registers as pulling no current on my power supply when it’s in its deep sleep. Seeing that, it’s hard not to want that sort of power saving on the final build.

More likely than not, I won’t let it go to sleep and have it on all the time. I haven’t actually tested this yet to see if it will stop working again. Stay tuned!

Experiment 1: They still can’t hear each other

I tried to get two NodeMCUs to talk to one another again but it’s still not working out. Basically, I had one that would set up as an access point with a webpage that I’d try to get the other NodeMCU to connect to and read. I could get it to connect once but then it failed at reading any data. After that, I couldn’t get it to connect to the AP NodeMCU anymore. I have no idea what changed in that time.

The alternative solution is to continue sending my data to my webhost, and then having the NodeMCU connect to a webpage I have online which will feed it the information it needs. The webpage it would connect to would give it raw unlabeled data that it knows how to decipher.

Experiment 2: Keeping it local

After banging my head for a few hours, I strayed away into another alternative, which would eliminate the second NodeMCU where I use my phone to see what the NodeMCU in the garage is up to.

It went very well since it was easy to modify the WifiAP example sketch (at least that’s what I think it’s based off of, I’ve been accidentally saving over the example sketches). I was able to see the values on my phone by visiting an IP address once I connected to the NodeMCU. However, the fact that I have to switch my wifi is a bit annoying which makes this an undesirable option. It’s still good to know I can do this though as I could use it in some other project.

So now what?

With everything in mind, I’ve got some updated objectives:

  1. Garage NodeMCU has a limit switch which will tell whether the door is open or not. It will connect to my webhost and send data. This NodeMCU is no longer allowed to go to sleep!
  2. Webhost will present the data to me on a page much like the screenshots I’ve been sharing. It will also have a seperate webpage with raw recent values.
  3. Inside NodeMCU will connect to my wifi network and then to that webpage with the raw recent values. It will take those values and decide what to do. (Light up an LED, make a sound after a few minutes, etc.)
Advertisements

Eye on the power

I added in the battery level code from https://code.google.com/p/tinkerit/wiki/SecretVoltmeter into my ESP8266 program and it works like a charm. The code uses a reference voltage in the Atmega328p microcontroller to get a reading of Vcc going into the ATmega328p. For the ESP8266 project, that would be the 5v output of the AMS1117 board. In my testing with the dead-ish battery yesterday, I found that the system started to fall apart once it dropped below 5v. The LCD backlight would start flickering and the sending of data seemed to fail more often.

I already have the system sending me emails if it gets bad values from the DHT22 sensor or the ESP8266 fails at sending to both ThingSpeak and my webhost in the same cycle. It was easy enough to add a little more code so it would send me emails at certain voltage levels. I’ve got it sending emails to me when it drops to 5, 4.8, 4.6, and 4.4 volts.

Screenshot_2015-01-24-00-02-03I got this email when I retried the battery for the third time after bringing it in from outside in yesterdays outdoor trial. If I give the battery a rest, it’ll be able to power up the system again but it’ll die after a short period. The lowest threshold email I got was for 4.6v before the battery died again.

I don’t expect this project to go battery powered again but this is definitely something I’m glad I found and I hope it finds a place in other projects.

At this point, I feel like the project is over. It’s been a great learning experience working with two programming languages, my custom PCBs, and seeing the community that has gathered around the ESP8266. It doesn’t have to be over though… Solar power, anyone? Perhaps in the future.

Like I mentioned a couple posts ago, I have other projects coming up, including some experiments with some RF transmitter and receivers, and my custom shift register PCBs that should come in next week if the postal service is consistent with the last two times I ordered from Dirty PCBs.

 Thanks for reading!

The Box: The Soldering Plan

Planning is underway to get the temperature/humidity monitor (The Box) project soldered and into the final box.IMG_0938 When I do larger soldering projects, it’s usually hit and miss because I end up trying to plan out the board as I’m going along. This time, I have a piece of grid paper and have tried laying out the components. This way, I can start soldering anywhere on the board without having to think as much.IMG_0939This is a rough plan of the layout of things on the box. Everything mounted on the box will be connected to the board with jumper wires (one end soldered to the board).

I’m a little hesitant to get started so I’ll take a couple more reviews of the plan before I start soldering anything. Hopefully that won’t take too long!

Temperature/Humidity Sensor Soldered. Again.

It’s been a while since I touched the Temperature & Humidity Monitor project. I’ve been thinking about making it a standalone device, combining it with the real time clock and LCD I have sitting around.

IMG_0810I decided to transfer the sensor onto a new board. I cut a piece of perfboard and soldered it on, trying to be neater than last time. IMG_0812Somewhat unnecessary layout but I think it looks nice.testI tested it and it worked fine. This time, I put my soldering iron near it and tried to get the temperature to rise. I’ve never experimented with it like this so I just found out that the graph doesn’t rise past 30ºC. I’ll probably go back in and fix that.

A part of me would be bothered if I couldn’t get the sensor to work with the Visual Basic program once it becomes part of a standalone project without the Arduino board. I haven’t tried making a serial connection with an Atmega328 chip by itself. For now, the sensor would probably not be permanently mounted to anything so I can always plug it back into an Arduino and work on the VB program if I chose to.