I wanted a nightlight that would glow when the room is dark and also be able turn on the other lights in the room. It is unnecessary for it to glow when the room is lit so I wanted it to also shut down its own lights when it turns on the other lights in the room.
My thoughts was also that I wanted it tidy and a bit more innovative then to just push a button to turn it off. I decided that I wanted it to control it's lights by tilting, for me it seemed nice.
I hope you will like it :)
- 1:Arduino Pro Micro
- 1:HMC5883L (Magnetometer)
- 1:FS1000A/XY-FST RF Radio Module (433MHz)
- 1:Something that can be used as antenna
- 4:Red Leds
- 1:2.2k ohm resistor
- 1:TIP120 transistor
- 1:18650 Battery
- 1:18650 Battery Holder
1:Proove remote relay
I Will use Proove relays, they have radios using 433MHz. If you want to use some other company's relays you could try to figure out the protocol it is using yourself or you could search for it. Someone might have already done the work of figuring out the protocol.
Step 2: Setting Up the Arduino
I used a Arduino Pro Micro and because the Arduino IDE doesn't come with the support for this device you will have to import the board yourself. The following link is to Sparkfun, follow their tutorial to get the Arduino working (it is very good).
If you also want to test your board with a blink sketch, they got one to.
The code I used will be provided here.
Step 3: Schematic
This is the schematic that I will be building. When the radio sends signals it needs a lot of current for a short amount of time, but it is more than what the battery can provide. Placing a capacitor close to the radio transmitter fixed the problems that I had with the radio.
The Arduino can not provide that much current thru it's pins, so I decided to run the LED's with a transistor. I used a TIP120 transistor but it is made for more high power applications so changing it to a smaller one would not be a bad thing.
Step 4: Testing the Sensors
Now when the Arduino is loaded with the necessary code it's time to test the HMC5883L and the radios function.
Step 5: Cutting
The thought is that the battery and all the electronics should be contained in the neck of the flask. The neck will later be covered with rope.
As you can see the plastic battery-holder is to big so I did need to cut it a bit.
Step 6: Deciding Placement + Soldering
Deciding where to put the sensors and still making the whole device small enough to make it fit into the opening of the flask made it so that the sensors had to be mounted on the top or the bottom. I decided to mount them on the top because the led's will later be mounted on the underside.
Step 7: Gluegun Magic
To hold the sensors in place I used hot-glue. Using a Hot-glue gun Is also good way to cover up the metallic parts of the build that should not be exposed. It is hard to see in the pictures but I do cover the radio (the lower one) with hot-glue and let it cool before I add more and pressed the magnetometer into place.
The rope that's added will be used to hold the device in place and it is also used to pull the device out of the flask. It actually fits very snug so it is more to be able to pull it out then to keep it in place.
Step 8: Adding Leds and Testing
I pulled out the proove relays again and tested how the radio reacted and if the magnetometer values had changed when all the other parts were added so close to it. It seems that the magnetometer is not that sensitive that it will be disturbed by the magnetic fields coming from the other electronics, which is a good thing.
Step 9: Adding Coloured Water
For the coloring of the water I used standard food coloring.
Step 10: Tidy Up the Handle
I decided to twist some thread around it, it covers up the electronics and makes a nice handle to hold when using the deceive.
Step 11: Protect the Electronics (from Water)
Of course the electronics will not like touching the water so I put it into double plastic bags and and put it into the flask. The bag were trimmed down to a more manageable length and i wired more thread around it to make it waterproof.
It is possible to pull the device out of the handle and changing the battery without touching the plastic bag.
Step 12: Cover With Cork
To cover up the hole I pushed down some cork and winded some more
thread around it to make the transition between the cork and the flask nicer.
Step 13: Last Testing
So, I guess it works like it should, i am a bit disappointed that you can see the a bit of the device if you look at it from the side. I am almost always standing above it so it is not a that big of an issue. I did not think that I would actually need to add a capacitor before I tested it, but I guess I can get It working with a smaller one. Then I could get more of the device to be inside the handle. It is also possible to modify the handle, making it a bit longer with some plastic pipe maybe?
Step 14: Done
This is my nightlight, It does not shine that brightly (as you might have guessed, only 4 led's). But It does give of a nice red shine when it is completely dark. I can of course not use it as a reading light so I also have a light on the wall to allow me to read.
I think that it is beautiful that it does not have any cables sticking out, but that to comes to a cost. It is not that hard to change the battery and recharge it but you will have to do it once a week. For me it is not a deal breaker, the 4 minutes that I need to change the battery is worth it for me. But If you think that you could cope with it then I think that a wired solution is the best.
Thank you for reading my instructable!