There is much writen about domestic systems. Switching by remote devices, by the internet you name it... So, just one article with another approach for controlling a lamp.
What can be writen about a floorlamp? The most simple one is controlled by a switch. When just a little more complex; by a timed switch. Next step is by an internet controlled switch or by a mobile app on your phone. But then again; what are your requirments when you are not frequently present at home; a timed switch is not so ideal because of the consequent switching time? Infact, that will trigger a burglar to get the idea that it could be that you are not at home a lot... The most beautiful way is to simulate "the normal way" of switching; i.e. when it is getting dark, extra lightning is required. And in the case of bedtime, switching the lamp off. Switched on at night when you go for a pie and maybe switched on early in the morning when you get out off bed. There it is... a new idea for just another project.
What are the requirments:
- The time of day
Functionality for a correct time present on the board; this is simple done by the AFSM; With the use of a RTC and -just occasionally- connected to HMI (for example by a serial interface), the time will be communicated every 30sec to the board and when a RTC present, the RTC will be updated with the PC time. - The Light sensor
A LDR coupled on the board for measuring the light intensity. When the LDR is positioned on the rigth spot, one of the requitments is to set a setpoint for the light intensity to switch on the floorlamp. - Button for setting the ambient light switching setpoint
When the button is pressed, the control must wait a moment before the intensity is measured, reason; when pressing the button you are are most likely somewhere in the surroundings of the LDR, influencing the ambient light. So after 5 seconds, the light intensity is measured for 5 seconds. The average ambient ligth level, will now be the setpoint for switching the floorlamp. Ofcourse the floorlamp is off during the setup procedure. - Userinterface
After the button is pressed, a LED will be activated for 5 seconds constantly before measuring the ambient light intensity. When measuring the ambient light, the LED is blinking. Remark: After pressing the button and a constant activated LED, get out of the area influencing the LDR. - Floorlamp time off
After 22:00, a random moment will be calculated to switch off the floorlamp. When that moment is reached, the floorlamp will be shut off. From that moment, untill the morning, a PIR is activated. - During the night
In the period of deactivation the floorlamp and untill morning, the PIR will signal the present of movement. When there is some movement, the floorlamp will be swithed on for 10 minutes. When movement is again signaled during the 10 miuntes, the timer will be reset to 10 minutes. - Morning
In the morning (from 6:00 o'clock), the floorlamp will be activated between a certain ambient ligth level and when there is signaled some movement. When the ambient level reaches the setpoint (from the "dark" side), the floorlamp is deactivated untill it gets dark again.... - State transitions
Functions are build in to prevent "nervous" switching between certain ambient ligth levels. A certain level must be detected for half a minute, for switching states. - Hardware Switch
Oh... and of course a relay to switch the 230Vac is used for the lamp. - Bonus
When build with the AFSM, you get a HMI, database logging and trending as bonus
Conclusion; Is it possible to make a floorlamp control, behave like it was operated by a person? The answer is more or less "yes". Is it usefull? Nah.... it is just fun to make and probably much to complex for a simple floorlamp....
The control was made with (click on the pdf files to view)
The estimate costs for all electronic parts are €20,-
Schema: