Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By forlotto
#39917 WARNING!!!!! MUST READ WARNING!!!!!!!!
Please do not try this at home without proper knowledge of laws, knowledge of AC, electric and or certifications required to do so! This is only a demonstration and a note for those who are interested in the working! If you do this you must understand USING THIS IMPROPERLY COULD RESULT IN DEATH, SERIOUS INJURY, fines, or loss of property to you or others! It is extremely important that you DO NOT TRY THIS AT HOME! Without the proper working knowledge, and safety precautions. I assume ZERO liability for any use! You have been warned!
WARNING!!!!! MUST READ WARNING!!!!!!!!

]

Code: Select allbutton "OFF" [OFF]
button "1" [1]
button "2" [2]
button "3" [3]
button "4" [4]
button "5" [5]
button "fun" [fun]
wait

[OFF]
pwo D4 0
pwo D4 0
wait

[1]
pwo D4 180
wait

[2]
pwo D4 200
wait

[3]
pwo D4 220
wait

[4]
pwo D4 260
wait

[5]
pwo D4 400
wait

[fun]
pwo D4 180
delay 100
pwo D4 200
delay 100
pwo D4 220
delay 100
pwo D4 240
delay 100
pwo D4 260
delay 100
pwo D4 280
delay 100
pwo D4 300
delay 100
pwo D4 320
delay 100
pwo D4 340
delay 100
pwo D4 360
delay 100
pwo D4 380
delay 100
pwo D4 400
delay 100
pwo D4 380
delay 100
pwo D4 360
delay 100
pwo D4 340
delay 100
pwo D4 320
delay 100
pwo D4 300
delay 100
pwo D4 280
delay 100
pwo D4 260
delay 100
pwo D4 240
delay 100
pwo D4 220
delay 100
pwo D4 200
delay 100
pwo D4 180
delay 100
pwo D4 160
wait



Parts List:
Esp Basic Wifi Dev Board: http://www.esp8266basic.com/store/p1/ESP_Basic_WIFI_Dev_Board.html
Lamp Socket: Get it from walmart a porcelin light fixture will work fine
Jumper Wire: Get it from anywhere amazon, ebay etc.
AC Dimmer Board: http://www.ebay.com/itm/221975640949 or http://www.ebay.com/itm/222030612813

WARNING!!!!! MUST READ WARNING!!!!!!!!
Please do not try this at home without proper knowledge of laws, knowledge of AC, electric and or certifications required to do so! This is only a demonstration and a note for those who are interested in the working! If you do this you must understand USING THIS IMPROPERLY COULD RESULT IN DEATH, SERIOUS INJURY, fines, or loss of property to you or others! It is extremely important that you DO NOT TRY THIS AT HOME! Without the proper working knowledge, and safety precautions. I assume ZERO liability for any use! You have been warned!
WARNING!!!!! MUST READ WARNING!!!!!!!!

Instructions:
Connect to the Basic IDE using your web browser if you need help doing this refer to the link in my signature to get started! The Beginners Guide.
Load the program above to the ESPBASIC DEV Board using the edit page and save it as blank don't enter a name.


Connect Mode Jumper to 3.3v
Connect 5v to Vin
Connect Gnd to Gnd
Connect PWM to D4

Connect Light to AC LOAD Screw Down Make sure it is tight if stranded wire is used be sure no strands are hanging out!
Connect Power plug to AC Screw Down Make sure it is tight if stranded wire is used be sure no strands are hanging out!

Connect USB to power up Basic Dev Board.
Plug Power Plug Into a socket.

Run Program And Enjoy Wifi Dimming from any wifi device made simple!

Be sure to use dimmable CFL or Dimmable LED based bulbs for best results!

UPDATE UPDATE UPDATE:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::!!!!!!
I have created an android application that will function for AP MODE called dimdum AP MODE ONLY FOLKS keep this in mind it is super simple to create one for wifi if you need it do a little research.

I also have updated my own code so that the light turns on after initial boot so it will turn on to show that everything is powered up then it will turn off and wait 30 seconds to boot. Once booted light comes on so you could in theory just use your light switch albeit the action is delayed. I would also like to note there is a delay not of my own choosing for turning the device to off via the controller board, but I did not worry about this as the delay is actually helpful it is approx 15 seconds giving you 15 seconds to exit whatever room you are in before turning off. I did however update my own code so that the light flashes letting you know that the off command was accepted.
DimDum_AP_Only.zip


UPDATED CODE:
Code: Select allpwo D4 180
delay 100
pwo D4 200
delay 100
pwo D4 280
delay 100
pwo D4 400

wprint "SET Dimmer <br>"
button "OFF" [OFF]
button "1" [1]
button "2" [2]
button "3" [3]
button "4" [4]
button "5" [5]
button "fun" [fun]
wait

[OFF]
pwo D4 300
delay 100
pwo D4 250
delay 100
pwo D4 180
delay 100
pwo D4 0
wait

[1]
pwo D4 180
wait

[2]
pwo D4 200
wait

[3]
pwo D4 220
wait

[4]
pwo D4 260
wait

[5]
pwo D4 400
wait

[fun]
pwo D4 180
delay 100
pwo D4 200
delay 100
pwo D4 220
delay 100
pwo D4 240
delay 100
pwo D4 260
delay 100
pwo D4 280
delay 100
pwo D4 300
delay 100
pwo D4 320
delay 100
pwo D4 340
delay 100
pwo D4 360
delay 100
pwo D4 380
delay 100
pwo D4 400
delay 100
pwo D4 380
delay 100
pwo D4 360
delay 100
pwo D4 340
delay 100
pwo D4 320
delay 100
pwo D4 300
delay 100
pwo D4 280
delay 100
pwo D4 260
delay 100
pwo D4 240
delay 100
pwo D4 220
delay 100
pwo D4 200
delay 100
pwo D4 180
delay 100
pwo D4 160
wait




Also got in contact with the manufacturer of the dimmer board he has released larger quantity for your ordering pleasure included another link above!!!

Give it a shot let it rip this thing is way better than any dimmer I have seen to date!
WARNING!!!!! MUST READ WARNING!!!!!!!!
Please do not try this at home without proper knowledge of laws, knowledge of AC, electric and or certifications required to do so! This is only a demonstration and a note for those who are interested in the working! If you do this you must understand USING THIS IMPROPERLY COULD RESULT IN DEATH, SERIOUS INJURY, fines, or loss of property to you or others! It is extremely important that you DO NOT TRY THIS AT HOME! Without the proper working knowledge, and safety precautions. I assume ZERO liability for any use! You have been warned!
WARNING!!!!! MUST READ WARNING!!!!!!!!
You do not have the required permissions to view the files attached to this post.
Last edited by forlotto on Sun Mar 20, 2016 5:39 pm, edited 5 times in total.
User avatar
By forlotto
#39969 Yes there is a zcd and the flickering only happens at certain levels on the non dimmable bulb obviously the same goes for the dimmable version as well at certain thresholds below 10% I believe for AC LED bulbs I think I have read but in my testing I believe it is slightly higher than 10% somewhere around 14% ... and there is another spot as well once it gets to a certain point though with dimming on the high end I really don't see any gains in lighting as far as brightness or lumens go now this is according to eye I don't have a meter because essentially what matters is what your eyes interpret for everyday use.

Been gone all day except for a short jaunt here and a short time earlier as well gotta get cracking and figure out what the crashing is about but I will post up a video of operation as soon as possible.

The other thing this module has zcd I believe it is handled by an atmel on board to do the detecting and it works in accordance with the PWM output either 3.3v or 5v it is a bit on the pricey side but it is a super simplistic setup that anyone could do that was the reason for doing it this way to share a project that anyone with a working knowledge of HIGH VOLTAGE can pick up the stuff and begin to automate their home.

I wouldn't complain however if someone is good with android code and wants to add an android app to the project but if they did so I would request that it remains open in source for all to see the code and is free from advertisements. I don't want exploit apps nor do I want ads bloating someones operation of the program nor their phone. This is meant to be free to use unless you plan on using it to profit if this is done I ask that you donate a fair percentage of your earnings to Mike the developer of esp8266 basic.
User avatar
By Mmiscool
#39972 You can use app inventor to make an app easly.

If you would like some help or some information about app inventor let me know. It would be easy to make it interact with the msg handeler branch.

If you Google MIT app inventor you will find the web based development environment. It really is not too bad for making simple interfaces for devices.

Personally I prefer to have a server manage most of that stuff for me and to handle interfacing between multiple esp devices and the outside world.