Arduino experts around?

zozo

Member
Joined
16 Apr 2015
Messages
7,537
Location
Netherlands
It's rather new for me but I like to play with it to automate a simple 3 volt LED for a mini terrarium setup... Now I already ordered me a NodeMCU ESP8266 WiFi development board I know that can do it... I'm not totally unfamiliar with program scripting did some VBS in the past so in a way, I can make some sense of it, but it's more than a bit rusty... Already found a valid sketch that automates the LED on/off over WIFI internet Time Server.

This bellow should work, but if I would need to change the time I need to re-upload another edited script.

Now I've also seen that HTML can be corporated to access the NodeMCU as webserver via port 80 to edit the values web-based via button tags etc. Would like have buttons to switch LED port off and on, on-demand and be able to edit the time on and time off values. Seeing examples it all looks much too easy, but still, this is where I run into complete noobilities. I actually wouldn't now where to start HTML scripting with Arduino IDE is completely unfamiliar to me... I'm more of a copy/paste script kiddie (more to say old fart) but i can't find the examples i need and how to incorporate it.

Are there people around that know this stuff? Any assistance would be hugely appreciated... 😍
 
Last edited:

zozo

Member
Thread starter
Joined
16 Apr 2015
Messages
7,537
Location
Netherlands
No have not seen it thanks I'll give it a read... Tho I do not have the Arduino Uno but will get the NodeMCU wifi shortly.
No idea if it can handle all that as the Uno does...

I actually came to the idea with looking at this NodeMCU getting started tut.

What he shows here does for a part what i want relatively simple, switch the LED port on/ff via Web... The part i'm missing is how to create the possibility to edit and save the time parameters and where to put this correctly in the script.. :)

It actually shouldn't be too difficult for someone who knows how to incorporate the correct HTML tags and parameters to get it done... It looks like it needs a few more lines... But at the moment I'm running around like a chicken without ahead.
 
Last edited:

dino21

Member
Joined
17 Mar 2020
Messages
128
Location
Derbyshire

zozo

Member
Thread starter
Joined
16 Apr 2015
Messages
7,537
Location
Netherlands
I was typing out code, but this does a much better job: A Beginner's Guide to the ESP8266

You're basically trying to build an http server with the NodeMCU to control some LEDs, yep simple, see how the above helps :)

Thank you! I have some reading and digging to do now... This is indeed what I basically want... I can edit the existing sketch i posted above to say LED on at 08:00 and off at 20:00 that ain't rocket science. And i guess it simply wrks and loops this day in day out till told otherwise.

But it would indeed be fancy that if needed that I can edit the time period over the HTTP server on the NodeMCU without editing the script and upload it again.

It actually is for this little bugger :) A friend asked me to also build one for him but he wants it mobile and wireless on battery power, no power cords to mains. It only contains 3 x 3.3 volt 200mA LEDs parallel...
IMG_20210108_102427854.jpg


So I thought intersting idea and experiment, this I can only fix with using the NodeMCU hooked to a battery.

That's how the idea was born... :) But my scripting skills are more than a bit rusty... Haven't touched it over a decade.
 
Last edited:

zozo

Member
Thread starter
Joined
16 Apr 2015
Messages
7,537
Location
Netherlands

dino21

Member
Joined
17 Mar 2020
Messages
128
Location
Derbyshire
That's a good one, made a new order to play with that too... It's too cheap not too, funny stuff...

If you have the time and brain power its an interesting hobby, though its our young ones who do all the work on them, they were equally overjoyed when finding that RN tutorial, it really got them into those wifi /bt things; ( it all baffles us oldies !:) )
They say log on to that site with an email address to get their latest updates, all free, though they have not joined up to the paid for lessons etc as most of it can be found for free.
They also suggest you look at this free site ( one of several similar) which allows you to build your own mobile App to control your ESP etc etc.

MIT App Inventor | Explore MIT App Inventor
 

zozo

Member
Thread starter
Joined
16 Apr 2015
Messages
7,537
Location
Netherlands
I think I found what I'm looking for, almost completely ready to roll.


This would be the web-based portal to set and update the ESP timer

Only need 1 timer (A) and since it likely is designed to switch relais I need to fiddle a bit with the Pin settings to make it switch a small Mosfet instead... It only needs to switch 3 LEDs 3.3.V - 60mA total

Thanks, Guys for the inspiration... I let you know how it runs when all is tested...

Now the hunt is on to find something similar for the ESP32 via bluetooth...
 

dino21

Member
Joined
17 Mar 2020
Messages
128
Location
Derbyshire
let you know how it runs when all is tested...

Now the hunt is on to find something similar for the ESP32 via bluetooth...
Yes, please do let us know how it works, as all that wifi stuff is a mystery to us, I do occasionally see the younger ones doing such stuff, but they go at such a pace I'm lost after 5 mins ! :drowning:

Re the ESP32 and Bluetooth, seems it working in two ways, BT Classic and the newer BLE Low Energy.
Apparently BLE is complex to set up and run so they suggest sticking with BT Classic , when you load the files for the ESP32 ( see the RN tutorials) into the Ardunio IDE it installs an Example folder which include wifi and BT test programs.
You should also find a similar ESP8266 Examples folder.

Re the Mosefet, you can drive them directly ( or via a simple resistor) from the micro if you use the Logic Level Types , most supplier list them as such.
However for your current needs any simple transistor should be fine eg BC337. BC547
 

Attachments

  • 000355.jpg
    000355.jpg
    9.3 KB · Views: 6

zozo

Member
Thread starter
Joined
16 Apr 2015
Messages
7,537
Location
Netherlands
I think I changed my mind again... :) After reading some documentation it seems I didn't think of the obvious. The more fancy features requiring regular updates the more power consumption... Since it needs to run on battery power I need a lite setup to have to longest fun for my buck. But I ordered 3 boards so still room enough to play and see where it ends.

Thanks!...
Re the Mosefet, you can drive them directly ( or via a simple resistor) from the micro if you use the Logic Level Types , most supplier list them as such.
However for your current needs any simple transistor should be fine eg BC337. BC547

Regarding lite, I indeed ordered a few BJT NPN 2N3904 transistors that should do the job perfectly with a 1.5V gate and a 27k resistor to the 3.3V IO pin to switch the 60mA source/base load.

That GitHub site I previously linked to is a gift from heaven... It contains quite a few alternative timer switch programs that are ready to use with minor editing. Enough stuff to learn...
 
Top