Introduction: Ronde De Nuit
The purpose of this project is to use a color led strip to make a night light activated by a motion sensor.
My idea was to get a diffuse light around my bed but without screwing, pasting or plugging anything.
So it works on NiMH AA batteries, it is made of 3D printing and is designed to lay on the floor, under your bed.
I propose 2 models : a full moon and a half moon design.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Bills of Material
- WS2812 led strip (110cm length for full moon and 60 cm for half moon)
- HC SR501 PIR motion sensor (1 for half moon, 3 for full moon)
- XH connectors (pitch 2.54 mm)
- crimping plier for these connectors
- USB Serial adaptor
- LDR sensor
- one 4*AA Battery holder
- 4 AA NiMH batteries
- ON/OFF switch
- atmega328p (arduino programmed)
Electronics for the PCB :
- Components listed in the eagle file
- M3 * 10mm bolts
- M3 * 5mm bolts
- M3 tap
- Glue gun
- NiMH charger
Step 2: Skills
To make the project you will need :
- a 3D printer with a 0.4mm or less nozzle
- to use Eagle to order and make the PCB
- If whenever you do not feel conformable with this, contact me, I can provide you a PCB with all the components needed.
- Arduino skills :
- install the required libraries
- compile and download the software
- optionally program an atmega328p with the arduino bootloader (or you can take it from an arduino board to avoid this step)
Step 3: 3D Printing
I propose 2 models : a full and a half moon model.
I give you here :
- STL files for direct printing
- Fusion 360 files if you want to tweak it
- 0.3 mm layers
- 0.4 mm extruder
Step 4: The PCB Controller
My PCB is made around an atmega328p (with arduino bootloader programmed) :
- The serial port is connected to a 6 pinheader connector, in the purpose to plug a Serial-USB adapter
- AQV20 is a photoMOS relay. The purpose here is to switch power for the Led Strip.
- I had some AQV20 components in my stock, but I've seen there are not easy to find. You can take an equivalent like an AQV21.
- I provide an alternative board schematic which uses a MOSFET to replace this AQV20 but it has not been tested yet.
- 4.8 V is the nominal voltage, what doesn't mean anything in fact
- When the batteries are fully charge I measure 5.1 V minimum, when discharging the voltage will drop
- When there is no charge the current is less than 1mA
- T1 adjust the voltage, be sure to set T1 to 15k to get 5V at output
How does it work ?
- The PIR sensors are connected to PIR1/2/3 XH connectors.
- When we start, the atmega goes quickly in sleep mode. The consumed current is then < 1 mA.
- When a sensor detects a movement, it sends a +5V on the corresponding pin (4,11,13) and awakes the atmega.
- Then the atmega triggers the photoMOS relay, which powers up the Led Strip (connected to STRIP XH). Data are sent on the single line BUS (pin 12 of the atmega).
- ronde 1.0 has been made and tested, it works good
- ronde 1.1 has replaced the photoMOS relay AQV20 by a MOSFET transistor, it has not been tested yet
Step 5: The LDR Assy
At start I didn't think to use a light sensor, but indeed it is more that useful to preserve battery life.
So I've soldered a Light Dependent Resistor in series with a 10 Mohms resistor, putted it on a shrink tube and added an XH connector.
I use the PIR1 connector the plug this LDR assembly. For the half moon it is ok, for the full moon it takes the place of a PIR sensor. So I had to do a choice.
I aim to design a new board with an extra connector for light sensor. For future use ...
Step 6: Assembly
- Tap the holes with M3
- Solder the LDR Assy
- Make the XH connectors for :
- PIR Sensors
- Battery Holder
- Led Strip
- Power ON/OFF switch
- For half moon : LDR on PIR1 & PIR Sensor on PIR2
- For full moon : LDR on PIR1 & PIR Sensors on PIR2 and PIR3
Step 7: Load the Software
Plug the USB-Serial interface as shown in the photo above. Take care of the orientation !! If whenever you plug it reverse way it won't damage the board, but better to avoid it.
Use Arduino IDE to download the corresponding software.
I used external libraries you need to install first :
My sofware is very basic and I expect you to tweak it :
- At power-up the ledstrip will blink 3 times as a welcome message.
- Then the micro-controller goes in sleep mode.
- When a motion is detected, it wakes up the micro-controller and lights up the led strip.
Playing with the software you will be able to change colors, delays etc ...
This is an entry in the
PCB Design Challenge