Time controlled, WIFI accessable solenoid

Hello,

I´m relatively new to Arduino and it´s my first post in this forum, so I just hope to hit the right section with my topic.


To make it more reader friendly, the short version:

What do I want to achieve?

  • activate a solenoid at desired times
  • set the times via HTML interface
  • supply power by battery (e.g. 2xAA)
  • save space (most mechnical parts are 3D-printed, so size is limited)

What is done?

  • electrical circuit is finished on Arduino pro Mini 3v3
    (solenoid is activated via MOSFET, can be controlled by a 3-5V pin)
  • clock module (DS3231) is integrated

What needs to be done?

  • integrate WIFI (ESP8266)
  • program HTML interface

How do I achieve the goals most effectively?

  • Arduino + ESP8266 + DS3231 or
  • Arduino + ESP8266 or
  • ESP8266 as standalone or
  • a completely other way

Long version:

I´m trying to realize a time controlled battery supplied Catbowl, which I can programm (set the desired times when it should open) via a HTML interface in my home WIFI. The mechanical job is almost done and the cap is released by a solenoid, that snaps back. So far so good, simple programm is written to an arduino pro mini 3v3 and the electrical circuit works. Alltogether, I need 2 controllable pins: one for the solenoid, that delivers 3-5V to control a MOSFET and one that receives feedback if the cap was opened (and consequently send an email or so). But now, trying to include time and WIFI and so on, I wanted to ask the community for the best way how to finish my project.

At the moment I´m reading through so many articles about the ESP8266 (WIFI module), the DS3231 (clock module) and power saving (because of the battery issue) and ask myself, what my final configuration will look like.

At the moment I have the ESP8266 and the DS3231 connected to the Arduino. The DS3231 delivers time perfectly and was already tested. But do I need it when I´m able to fetch time information from the ESP8266 via internet? Do I even need the Arduino, because the ESP8266 works as standalone? Does the ESP8266 satisfy my needs for a low power consumption? Or is it better to attach it to the Arduino and wake it up when I call it from my home WIFI (if possible), because I only need it for setting the unlocking times? But when I put it to sleep, can I fetch time when I need it? Are there enough pins on the ESP8266 to run my programm?

You can see, I´m at a point where perceived 100 paths exist that I could follow. I hope someone can give me a general hint, what my perfect setting could look like, especially when it comes to the battery issue. It would be great if I only needed to change for example 2xAA once every 2 months or so.

Thanks to everyone who hung on until the end!

Greatings,
Fosekosz

  1. If you are activating a solenoid with an output pin and detecting the status of a door flap with an input pin and require WLAN functionality, then this can be achieved with the ESP8266 alone. The work you have already done on the pro-Mini is not wasted because that can be ported directly to the ESP8266 if you use the Arduino development environment to program the ESP8266.

  2. You can fetch time information from an NTP server and use that to update the microcontroller directly, but it is best to use the DS3231 as your primary source of time and update/correct that regularly from an NTP server. That way, you can tolerate network failures.

  3. When you program the web interface, you'll effectively be programming a 24Hour time switch. There are some libraries to get you started like GitHub - tzapu/WiFiManager: ESP8266 WiFi Connection manager with web captive portal which handles things like feeding in the credentials of your WLAN etc.

  4. I'm not sure about the life of the batteries for this configuration. You have to experiment.

Thank you for the detailed answer!

Never thought about network failures, it´s a really good point.

One last question that maybe kills the WIFI idea:

Running the ESP8266 24/7 is no option, as it would drain battery to zero within hours. Is there any way to wake it up from sleep via WIFI? Any battery saving method I found uses time control. This is not useful in my case, as I don´t want to wait for a certain time to change opening times.

If not, are there any other comfortable ways or modules, that allow modifying the time variables without hooking it up to PC and compile a new code, as my girlfriend will refuse that for sure :smiley: Unfortunately, there is no space for a display.

I´m afraid I have to kick the WIFI idea and with it the opportunity to change parameters even if I´m not at home by VPN or such things. I always tend to exaggerate things...