Dogs Need Help!

Hi,

Sorry for the (hopefully ) attention grabbing title but I really do need some help!

I'm trying to build a circuit that will turn on heat lamps in my dog's kennels during a defined time variable if the temperature drops below a certain set point with an override that I can trigger from my phone.

I've managed to sort out everything on the electronics side but I'm struggling on the phone bit, I'm using an Uno with a ESP8266-01.

I'm at the stage where the Uno can connect to my router via the ESP & I can ping it from any device locally connected to my router using Mac's "Terminal" but I can't connect via a browser & I haven't got a clue on how to proceed from here.

I've dowloaded the "Arduino Ethernet Manager" App thingy but I can't find any support for it.

I can find loads of videos on how to create a web connected weather station etc (I don't understand them) but I can't find any help on how to simply turn on & off a digital output from my phone (or at a push a web browser)

An old(ish) guy would be very grateful if you can help.

Thank you.

For the smartphone side of things, look at Blynk.

To "connect with a browser" you of course first have to set up a web server on the ESP and have it serve pages.

Also if it's just to switch on a heat lamp and read a temperature sensor do yourself a favour and get yourself a NodeMCU or WeMOS mini board. They have the ESP8266 on board and all pins broken out, so you can connect everything directly to the ESP, which in turn can be programmed easily through the Arduino IDE. Most Arduino libraries work out of the box, others have ESP versions. Makes life a lot easier.

mickjbriggs:
Sorry for the (hopefully ) attention grabbing title but I really do need some help!
I'm trying to build a circuit that will turn on heat lamps in my dog's kennels

You'll need a Switch, a Heat Lamp, some Dog Treats and Train Dog To work light Switch On and Off

Sorry, couldn't resist :slight_smile:

Yours,
TonyWilk

Thanks for all the help so far.

I now have an atMega communicating via the ESP & displaying a RTC on the Blink app & on a LCD, all that is finally working ok (after a lot of reading!) but I can't figure out how to write the code I need to turn on an output between specific times.

I have a string "currentTime" containing hours, minutes & seconds & want to use it to set the state of "timeState".

For example if it's between 05:30 & 18:00 I want timeState to be high, at all other times timeState will be low.

I have tried to search how to do this but I'm a little lost, if anyone could point me in the right direction I'd be very grateful,

Many thanks,

Mick.

if (hour() == 5 && minute() == 30) timeState = true;
if (hour() == 18 && minute() == 00) timeState = false;

Now just make sure you check on this at least once a minute (if placed in loop() that would normally be checked many many times a second, just don't put it in deep sleep or so).

Easy when you know how!

Thank you very much.

Or

timeState = (hour() == 5 && minute() >= 30)  || (hour() >= 6 && hour() <= 18);

then it won’t matter if it somehow misses the exact minutes.

Thank you,

The first example seems to be working fine but I'll keep that in mind.

mickjbriggs:
The first example seems to be working fine

What if there is a temporary power cut or some other fault around the 5:30 time? When the Arduino starts up again, it will have missed the exact minute and the earlier code will not switch on the heater. The later code will switch it on.

PaulRB:
What if there is a temporary power cut or some other fault around the 5:30 time? When the Arduino starts up again, it will have missed the exact minute and the earlier code will not switch on the heater. The later code will switch it on.

Ah ok, I see your point now.

Many thanks.