Close

Firmware and the future

A project log for ESPLux - Smarts for your downlights

A circuit you can place inline with your existing low voltage lights to allow for wireless control

mattMatt 04/25/2015 at 11:500 Comments

Howdy!

First up, apologies for the lack of formatting - I'm posting this from my phone.

While I'm waiting for my boards to turn up, I thought it would be a good idea to start working on the firmware for the ESP8266. Not wanting to reinvent the wheel, I started off with NodeMCU, then wanting a web server to be able to configure everything, I found nodemcu-webserver. So I have used these as a base.

The functionality I want to get out of the web interface is as follows:

So far, I have a test web page that I am comfortable with. It simply lets me turn an LED on and off, and set the brightness of it. Here are some details on each of the parts.

Hardware:

I have used the ESP breakout I made in an earlier post together with a small test board I made before starting this project that has an SMD LED on it (along with a few other components on it that I'm not using). If you wanted to replicate this, you could easily solder on a standard through hole LED along with an appropriate value resistor. I used a 10 ohm resistor on this board, but depending on your LEDs characteristics your value may vary. I connected the LED to GPIO4. (I've noticed that GPIO4 and 5 are switched on the silkscreen. Oops.) 3.3v in this is just connected to my lab power supply I bought off eBay.

Firmware:

As I said above, I started off with nodemcu, and then installed nodemcu-webserver. I followed the guide from the webserver notes and built up a page that lets me control the lights. I'll look into posting these files up on my GitHub over the next few days, I'm just strapped for time at the moment.

Usage:

After you set up nodemcu, the ESP comes up as an access point. You can connect your phone/machine to this AP and then simply open up a web browser and go to the webpage. From the interface I can turn the LED on and off, or set the brightness level on it. All of this information is pretty useless without giving you the firmware, I'll post a new log with more information within the next week or two.

Where to from here:

I'm still waiting for the two boards I made earlier to arrive. Once these arrive, I'll have a play around with them and hopefully they all work fine. I'm fairly confident about the switching board, but not so much about the power supply, but hey! Will give it a whirl.

I'm starting to build up the first draft of the finalised circuit, then consequently the pcb. Once I'm happy with the switching and psu circuits, I'll add them in.

The firmware I'll keep working on. I'm fairly confident with my abilities with this part (this probably is unfounded. Haha) I can write up web pages and have a basic understanding of a few different languages. I'm sure I'll be able to get together a lua script to do all functionality above to work. Security will be an interesting one, in the first instance, I will be relying on my wireless security, and will be looking into options at a future time.

Hopefully the boards turn up in the next few days so I can keep moving forward!

Discussions