A battery-powered RGB lamp able to detect movement and ambiant light to adapt its behavior.
The behaviour is simple : Once it starts, the first color is red. A push on the button will cycle the color order. The colors are: red, green, blue, pink, orange. After orange, a button press triggers deep sleep. When in deep sleep, lamp can be wake up by button press or movement detection. If ambiant luminosity is too high, the lamp emits a quick blue blink and shut down. If the ambiant luminosity is low, the lamp remain on selected color until no more movement is detected long enough.
The repository contains:
Identifier | Description |
---|---|
HLR1 | |
HLR2 | |
HLR3 | |
HLR4 | |
HLR5 | PSML transmit its remaning battery level wirelessly, each 15 minutes |
HLR6 | PSML transmit light intensity wirelessly, each 15 minutes |
HLR7 | Long press (2 seconds) on push button toggles permanent light mode |
NOTE: data is a value which is exchanged between components
HW ------------------- --> BatteryVoltageSensor ------> D_tension_in_mv
HW ------------------- --> LuminositySensor ----------> D_luminosity
HW ------------------- --> PushButton ------------> D_ButtonPressed
HW ------------------- --> PushButton ----------------> D_ButtonLongPressed
HW ------------------- --> TimeCounter ---------------> D_EmitData
D_tension_in_mv,D_luminosity, D_EmitData --> X10MessageFactory --------> D_X10Message
D_X10Message,D_SendBatteryVoltage --> X10Encoder ----------------> HW
|--------|
Battery ----------->| |
| |
Presence Sensor --->| |
| |--> RGB LEDs
Luminosity Sensor ->| PSML |
| |--> 433Mhz transmitter
Push button ------>| |
|--------|
- Battery is a 18650
- Light sensor is a simple photoresistor GL5528 (1MΩ)
- Presence sensor is a HC SR501
- Push button is available from outside enclosing device
- PSML itself will be implemented on a Arduino Pro Mini
Identifier | Description |
---|---|
HWR0 | |
HWR1 | PC0 (A0) , configured as analog input, throught a voltage divider using a 10k resistor |
HWR2 | PC4 (Arduino Pro mini A4) |
HWR3 | PC1 (Arduino Pro mini A1) |
HWR4 | |
HWR5 | 433Mhz emmitter shall be wired on PB0 (8) pin |
HWR6 | PB1 (Arduino Pro mini '9'), Green PD1 (Arduino Pro mini '3'), Blue PD6 (Arduino Pro mini '6') |
HWR7 | |
HWR8 | PD2 (Arduino Pro mini '2') |
Identifier | Description |
---|---|
NFR1 | |
NFR2 |
Name | Value | Description |
---|---|---|
AMBIANT_LIGHT_TRESHOLD | 122mV | PSML only wakes up under that light ADC measurement |
LOW_POWER_MV | 2500mV | PSML blinks and does not start normally under this battery voltage |