Solar cell cap bank emitter with ESP8266 (ESP01)

Jacob David C. Cunningham
11 min readMar 8, 2020

--

Disclaimer: This is not a tutorial, this is a rambling build log

This isn’t exactly what I wanted but got lazy/didn’t want to take apart the capacitor banks and resolder them(20). The panels look glossy because I slathered Vasoline on them. I have no proof that improves them but I scratched the surfaces of the panels pretty badly and rubbing alcohol made it worse.

Update from 04/02/2021

So… there are these things called super/ultra capacitors apparently and they dwarf those “cap banks” I used for this. I think I can make this thing work with two solar cells stepped down to 3V no deep sleep. A single cap I think should be enough to power it all. It will not have enough power to stay on after the sun goes away. Actually I think a single cell could do it, I might try it and see how compact I could make a little unit. I bought some LDO regulators so maybe I can make this work.

Ordered these from Mouser

During my moisture sensor project [link] I came across this cool post on Hackaday. That’s where the supercap idea came from. Just one of these is enough to charge the ESP-01 to do a WiFi connection/transmit something. I could tap the ADC on the ESP-01 but no use/need here. I think I’m just going to make a cool unit of some kind. I guess a wedge on its own is cool.

Solar cell has 100mA max following the Hackaday post need a resistor about wow 30ohm that’s low.

Update from the future: So this project kind of failed in a way, the boost converter/down-verter(?) I was using has a high start up internal resistance. So you have to short the caps when you have peak power in order to get past that. Then it starts working/transmits every minute as expected assuming producing at least 3.3V/120mA. So far I have not figured out a solution for that, I was not aware of that issue at first.

What is it: ESP8266 that is powered by solar cells and capacitor banks for batteries, ESP runs in deep sleep mode and then sends an HTTP POST request every minute.

This is the finished prototype, this was not the intended build. I suppose if I knew how to do basic elementary school math, I would have known about needing at least two panels. It just seemed “prettier” to only have one. Now I will have this weird triangular thing reminiscent of that music player Neil Young was trying to sell.

Working prototype using ESP.deepSleep

Repo

GitHub

Specs/parts

  • 2 x 5V 100mA solar cells
  • 10 x 6.3v 1000uF capacitors
  • 10 x 50v 470uF capacitors (I’m aware these don’t match)
  • 1 DC-DC LM2596 voltage regulator
  • 1 ESP8266 ESP01 (8 pins)
  • 1 USB to serial adapter CH340
  • Misc parts eg. a button, a switch and a diode to prevent back flow into the cells

Overhead shot of the parts together(except the USB to serial adapter)

Hard to get a good picture of this

Flashing/running steps(so I don’t forget)

  • Your Arduino IDE has to have the ESP8266 added to the board manager, this involves adding this line into your preferences under “Additional Boards Manager URLs” then exit Arduino, come back(should have downloaded from that link, if not you’ll see an error), go to Tools > Boards > Boards Manager, find the ESP8266 set and install that. I did install 2.5 but I don’t know off hand if that’s needed, I installed the latest one at the time it was 2.6 I think. Then select Generic ESP8266 Module from Tools > Board
  • With the modded USB to serial adapter, you hold the button down, slide it into the USB port and you should see the blue LED flash briefly. When you’re doing this, the switch jumper between the wire off the chip to the reset pin should be in the off position. That is only on when you are running the code you uploaded to the ESP8266
  • If it is working correctly when code is being uploaded to the ESP you should see red dots/percentage counter for progress, look at the serial monitor(74880 baud for deepSleep)
Programming mode, see how the switch is not on. This jumper wire hack came from randomnerdtutorials.com, I have direct links in this post

Development

So this is another pointless hardware project, but “it’s cool to build”. This is a little device that you plop on your window sill, it’s powered by the sun and it just outputs HTTP requests to a server, great.

What’s neat and probably a bad idea, is it’s using capacitors as batteries. I have a buck DC to DC converter to output the 3.3V that the ESP wants. I think it’ll work… I have not personally worked on BMS/charging systems yet, so I am not using the Li-Ion cells that I could be using. So either the dumb-proof acid batteries or this cap idea. The DC to DC converter is a huge help regarding avoiding voltage ripple(what does that mean?) but mainly dropping down the solar/cap stuff to 3.3v for the ESP to use.

Oh man, sometimes it’s like pulling teeth. I literally spent I don’t know half a day or more getting stuck just flashing this ESP01. I finally got it to work, I switched back to Windows(I was using Ubuntu on a split partition laptop). I was trying to use an Arduino Mega to program it but I ended up actually figuring out how to use this USB-to-serial CH340(Yellow plug) adapter I bought from Amazon. Then I was finally able to upload a Sketch aye!!! This time it’s all mostly copy and paste too as I don’t know much about hardware/Arduino/C. I mean conceptually I know what to do but it’s still a wall to me.

I have to setup a basic POST server and have it run/listen to for POST requests. I’m using Node and I’m using Postman to test it real quick to make sure it works. Then I’ll use the code here to program an ESP8266 to send a POST request.

Concept of the device and then the basic starter code for receiving the emitted POST requests from the ESP01

At this time I have 10 of these 1000uF at 6.3V which the solar cell at best can produce 5V and 100mA so I’m not sure how or how long it will take to charge up to support a peak draw of 3.3v at 500mA. I think it’ll work… the boost converter takes care of ripple voltage from what I’m told.

Supposedly even this basic ESP01 is pretty capable/can have up to 4 analog pins… so I think I could at least send the voltage or stored charge or something in the caps if that’s even possible… the last part probably not seems like I need something like a shunt to measure. Still, if I can get this thing, this block that I put in my window and it charges/sends the request, that would be cool. And look it’s working, cool who knew copy and paste would work.

Ehh… was trying to use JSON but running into problems, I have other stuff to do so will just use text.

And there it is, every ten second send a post request, I don’t actually want that but just testing to make sure it works.

What does suck is once it’s programmed you can’t change stuff, so you’ ll probably need some kind of proxy to reroute stuff if you want to change it. It would still send to one place but then from there you can route it to a new destination.

Hardware

Ahh… I’m a little sad, I’m retiring a solar panel(cell) I had running for year(s). I still have my other two running though that are side by side.

Wow I did not realize how bad in shape this solar cell is, this one has been sitting outside.

So… that was kind of bad, I almost ruined this solar cell by trying to “clean it”. I started scraping off the layer like a mad man thinking “I’m helping” but I wasn’t. Then I was like “oh I should peel the layer off!” No! That’s like the Galaxy Fold all over again ha jk. But yeah… I also think it’s like that thing with car headlights, you rub the stuff on and it fills in the gaps, it works for alcohol but of course when it evaporates, back to the piece of crap surface. I tried vaseline too. I bought this because I had the genius idea to scrape a stuck particle on my monitor with a razor blade and it scratched the monitor… and guess what, it did not fix the monitor. So don’t do that. Anyway thankfully the solar cell still works and it’s good insight that the this type of solar cell when exposed to daylight overtime(several months/years) gets messed up. I think it’s mostly being outside that hurt it the most, my indoor cells look much better.

I’m thinking I’ll refine this though, make it more neat and print a body for it. It will do more than just output “hello, I’m still alive” every minute ha.

Seems legit

Mathematically I don’t know if I need the two banks… maybe I do. I have to prove that.

Hmm it’s odd, it’s not working… ESP is on, producing 3.3v and 2000mA looks like so it should have enough power to send. Future edit: turns out I can’t read a multimeter, I think that 2000mA actually translates to 20mA(not in the right range).

Well this is somewhat disappointing(next day, afternoon) it works but it doesn’t work. In run mode the ESP needs the VCC and CH_PD tied to an external 3.3V source. When you do this, the current draw goes up so much that my cells can’t produce enough current to keep it on. I went with more caps and grabbed another cell. It seems to make sense as I saw something about more than 100mA draw… I’m hoping that’s it, even though I saw somewhere about peak~500mA anyway if it charged long enough I think it could work? I’m not sure I need more math.

I’m trying to do some software sleep though to let it charge/run on its own vs. being plugged in all the time(always draining). I think this is possible.

I’m trying this physical sleep mod mentioned here and here.

This is what I like, dumping hours into something I’m obsessing about. I have to fix it, I have to get it done, till I collapse from exhaustion. But I can’t yet, not at this time(day job and all that). I want to see this work. I’ve “sacrificed” other things already. I think I can do it(hopefully).

Stole a diode from this old oscope

Ahh man… so it works for programming and wake, but you can’t have the wake wire hack connected while you have the programming button depressed on the USB to serial adapter hmm…

Well that’s one ESP down, I ripped that little pad off while trying to add a switch to the wake trip wire. I later added hot glue on top of this to secure it.

Kind of funny, I’m running out of sunlight and sanity to complete this project. I realize without doing the math/planning ahead of time, bound to run into more problems/stuff just won’t work(physics).

This is the first version that I wanted, it seems more compact but not enough power.

So at this time, I have modified the code to use the ESP.deepsleep(microsecond) approach which does seem to work because now instead of powering down(red led goes off), the ESP stays on with the same wiring as before regarding the CH_PD and 3.3v being connected. The code is working too while plugged in to USB, let me see if it works on the two solar cells and the bank of caps.

More power…

Oh damn it worked! Ayee…. I’m curious though if a single panel can do it. Let me confirm one more time.

Unless specified the rest of these are just while it’s plugged into the USB adapter or calls from Potman. These are console logs from the Node JS server listening for POST requests from the ESP8266

So it can’t only run on one panel. Also it seems like it has to be not plugged in to the ESP for a second or two so the caps charge up, then you can plugin the CH_PD pin and it will work.

I’m going to design a housing for it(3D printed), my concern is since it sits on a ledge, my cat will knock it off. It should be able to just fall/bounce off the carpet.

Man I can breathe a sigh of relief finally… it’s funny now you’re here… so what… Well at least there is a next plan(the housing) and then probably extend its functionality by using the analog inputs. It’s kind of exciting thinking about what it can do as a challenge on limited resources.

It’s funny at the end of this I have like 300 tabs+ open in Chrome of me frantically trying to find information. Without direct sunlight towards end of day it doesn’t have enough power to charge up/show red LED while CH_PD plugged in.

Future design

I’ll design a housing for this, will look something like this.

Ehh… it’s not as cool as a “square triangle” this is a “rectangle triangle” ha

You can see the component’s it’s kind of a mess all the caps.

It looks neat the cap banks.

I’ll post an update when I 3D print the body/put the parts in. It won’t change much functionally yet as I have to put in more time learning the ESP01’s capabilities and I’ll probably have to buy more parts(sensors). Conceptually this is pretty useless, but if it was working off LoRaWAN or something, that would be cooler, my end goals are to make random drones that are out in the wild(in a controlled environment of course) but they’re “self sustaining”.

Future things to consider:

How to get rid of excess energy. Calculate/figure out minimum power required.

Edit: I guess the excess energy isn’t a problem “it will only provide what the load draws” someone said.

Update 6 days later

I printed a basic body for it. It’s not great, I did not consider the size of the electronics, I just printed frames for the solar cells and then tilted it at 30-some degrees and extended legs down to make a triangle. The cap banks could have fit inside the triangle but would have required a lot of work to desolder/re-arrange/resolder. So I just decided to extend it. I had a similar design anyway(a rectangular back for the electronics) but the solar panel would swivel on a joint so you could adjust the angle with fold out orthogonal plains under the solar cells.

More pics

Sadly it’s a cloudy these next 7 days or so, I did a measurement and when it’s cloudy it only produces ~2.4v which I could get double if I went in series but also not enough current I imagine. This means currently not enough power to turn the ESP on.

As a side note this body took around 8–9 hrs to print. Mostly due to the large flat surface area that was I think 3mm thick. The area that holds the cells are empty.

I added the STL/gcode files to the repo. The design isn’t great, particularly the bars that extend outwards. They are pretty fragile.

--

--

Jacob David C. Cunningham
Jacob David C. Cunningham

Written by Jacob David C. Cunningham

Software developer and general technology tinkerer

No responses yet