Presenting the ESP8266 Capsule!

This project went exceptionally well. With just under two weeks of prototyping and 3.5 straight hours of soldering, the ESP8266 Capsule is complete! The project as I’ve been showing you in previous posts has been crammed into an enclosure (a food container). Let’s take a look at how the soldering went.

IMG_0001The only plan I had was a very rough schematic of the project. I skipped the perfboard planning on paper which is something I started doing with my projects that ended up on perfboards. I thought the circuits were simple enough to wing it… While that’s was somewhat true, it was challenging at times but it all worked out.

IMG_0002I pulled apart the prototype since I had the schematic to work with. I used fresh ATmega328p and AMS1117 boards since I like to have a couple rough assembled ones laying around for prototyping with.

I used some cut jumper wires that still have the female connector on it to connect up the LCD. The ones I used were actually cut off of the old Box project that was sacrificed for this project. I like to think of this as the Box 2.0 since it’s pretty much the same thing, except it gains an internet connection but loses the real-time clock.

IMG_0003This was about halfway through the soldering process. I got increasingly concerned with all of the connections flying out everywhere. They’re that long just for assembly. They would be cut down when it was time to connect everything together.

IMG_0004The first test was scary, as it usually is. The LCD lit up but didn’t show anything. After a few minutes, I realized the potentiometer that adjusts the contrast of the text was turned all the way down for some reason. I thought it would have stayed the same since it was directly taken from the prototype.

The only real issue was with the photoresistor. One of the legs had a loose connection that I had to touch up with my soldering iron a couple more times to get right. I would have liked to hot glued parts of this project but I don’t think I have enough glue for my glue gun. I put some tape in hopes that it’ll help things stay in place. Everything is so tightly packed in there, mostly because of the female connector for the LCD connections, so things aren’t shifting around too much inside.

IMG_0006This is the final product. The sensors are mounted on the top with the LCD underneath it. Beside the LCD is a switch to turn on and off the LCD backlight.

It looks very similar to the Light Timer Project since it uses the same kind of enclosure and LCD. I’d like to think I’ve progressed since then. There are no breadboards tucked in there, and I’m using some custom PCBs… That’s progress to me!

IMG_0007I find that inexpensive switches are hard to find so my previous projects usually never had one unless I had a switch I pulled from an old toy or something. My switches from China finally came in yesterday. They’re cheap and don’t fit in a breadboard, but they work great in the project.

Now that it’s in the enclosure, it can be moved around, especially since it can still be powered by batteries. I’m thinking of leaving it outside for a day and watch the data come in. It’ll be a designated day I’d announce since I’d have to pick a good day to do it. The enclosure is hardly weatherproof, and the power in contacts are fully exposed. I could put it in a bag, but I think that would affect the humidity readings. I’ll let you know.

Thank you for following along with this project! Stay tuned for more projects coming soon!

Here are some links for this project: MYSQL Database Live DemoThing SpeakGitHub Repository

Information everywhere: Take 2!

Last night, I worked on my ESP8266 project code so that the data would be sent to both Thing Speak and the MySQL database on my webhost. After working out some reliability issues, the information from my ESP8266 project is now in three places: Thing Speak, an LCD, and a MySQL database on my webhost.

IMG_20150119_010336Since I’m using my ATmega328p breakout, I can’t see what’s happening in a serial monitor, but I was able to print out messages on the LCD that helped me debug. The problem was that it was sending values fine to my webhost but it kept failing at sending anything to Thing Speak except for one lucky time. I recall seeing some delay when closing the TCP connection when the project was still on the Arduino Uno so I tried adding delays to give it some time to close the TCP connection to my webhost before attempting the Thing Speak transmission. After some trial-and-error with the delay value, it finally became reliable.

The new code is available on GitHub. I also took the time to clean up the folders so that it’s easier to find the different versions of code.

I’m still waiting on some mini slide switches in the mail before I can put everything into an enclosure. I had a beefy switch in my spare parts bin that I was going to use for the input power but I measured the input current during a full cycle with the LCD on. It seems to go between 50mA and 100mA, 100mA presumably whenever it’s taking a measurement from the DHT22 and when it’s sending data through the ESP8266. I had the impression that the ESP8266 drew more current than that so I’m pleasantly surprised it stays that low. The mini switches I’m waiting for have a current rating of 500mA so that should be fine for the power supply.

Thanks for reading!

Information everywhere

Not only is the information from my ESP8266 project on the internet, but it’s now also displayed locally at the sensor station. I’ve added the LCD that I recovered from a previous project.

IMG_0001I’ve completed a few projects that had enclosures, but they were always make-shift like cardboard boxes or plastic food containers. I’m considering getting a solid plastic enclosure, but my biggest problem is not having any tools to cut into it. It will probably be cardboard again…
IMG_0003The first line of the LCD displays the temperature, humidity, and brightness. It changes between the three values every five seconds. The bottom line counts down to when the data will be send through the ESP8266 module to Thing Speak. I’d set it to send every 120 seconds, or two minutes.

There’s just a few more things left to do with this project:

1. Migrate everything over to my AMS1117 voltage regulator and ATmega328p boards.

2. Get a power supply.

3. Find and stuff everything into an enclosure.

I probably won’t be sending any data to Thing Speak until I complete this list so apologies for that.

You can get the code for this project on GitHub.

Thanks for reading!

Progress on the internet

IMG_0001Remember that New Years Resolution post I made that talks about getting my Box project on the internet? I decided to do it.

I actually purchased a DS18B20 temperature sensor for the wifi project but it hasn’t arrived yet. I decided to take the old Box project apart and get the DHT22 temperature and humidity sensor out of it. I’ll probably keep the incoming temperature sensor for something else since this doesn’t need it anymore.IMG_0003I’m thankful past me used a socket for the ATmega328p microcontroller as I was able to recover it, along with the real time clock and the LCD. For whatever reason, the real time clock started to lag and is now like 15 minutes behind. I’ll have another use for it eventually.IMG_0002I added the DHT22 sensor alongside the photoresistor I was using before as a test. With some code modifications, I got it to send all three pieces of data.
graphs You can view my Thing Speak channel here. I’m still playing around with the hardware configuration so sometimes the graphs show some weird values. I also don’t leave it powered overnight at this point. I’d like to package up the hardware so that it can be a little more portable. Like I said in the previous post, I’d like to use my custom PCBs (ATmega328p and AMS1117 voltage regulators) with the wifi module. They will help with bringing down the size of it.sunsetThere’s one satisfying graph. This is the light in my room as the sun was setting. The jump at the end is when I turned on the room light. It’s pretty cool to see how consistent the room light is, and how much natural light varies.

One last thing: I’m finally on GitHub. You can get the code for this project from there. It took me a while to get on it because I always found it easier to just throw things on Dropbox and share files that way. People are very interested in the code for this so I finally took the plunge and got on GitHub. I’m thinking of putting some of my Eagle files on there too. It’s good motivation to take documenting my code more seriously.

Thanks for reading!

Hello Internet! I have a Thing!

IMG_0001Just before Christmas, I ordered a bunch of things off of eBay, the most interesting being this ESP8266 “Serial to Wireless Internet” module. It’s the first thing to arrive so I was excited to get it working, even though the temperature sensor I bought for it hasn’t arrived yet.IMG_0005Because of the way the pins are on the module, you can’t plug it into the breadboard directly. I put together this adapter so that it would fit.IMG_0004I like how small it is. It’s kind of cute.IMG_0007After some tinkering with the code, I got the readings of a photoresistor up on Thing Speak. I put it on a seperate breadboard father away so that the shadows from the rest of the hardware wouldn’t affect the readings. Whenever my temperature sensor arrives, the data going online will be a bit more interesting. I’m thinking about how I can get it outside but I’ll speak to that a little later. I also have plans to use one of my ATmega328p breakout boards and AMS1117 boards (thankful now that I put a 3.3v regulator on it) to free up the Uno.thingspeak

This is a screenshot of the readings last night with the room light on. With the room light on, it was steady around 700. When I turned off the light, it dropped down to under 50. In the daytime with sunlight coming through the window, it’s up to around the same range. It’s interesting to compare between the brightness of a lightbulb and natural light… though I think seeing the temperature through the day, even indoors, will be more interesting. I can’t wait!

You can download the code I’m currently using here.

Here are the articles I used to get it up and running:

Getting Started with ESP8266 WiFi Transceiver (Review)

ESP8266 Wifi Temperature Logger

IoT Datalogger with ESP8266 WiFi Module and FRDM-KL25Z

Thanks for reading! Stay tuned for the temperature sensor!