So im working on a project making a childs night light.
its rather small WxLxH 60mm x 90mm x 80mm
Its functions are that once switched on an LED bulb stays on for a period of time (40 mins) and fades out. or if it dims down about 10% every 10 mins or something
I have an led bulb that i have bought from jay car its is an Automotive H1 16x White SMD LED 12VDC 3.2W
H1 base doesnt matter as i have removed the base. attatching 12V battery straight to the LED was too bright for what i needed but applying a 9V battery gave me around the brightness that I needed.
I haver a switch which is pretty much a spring underneath a metal pad so any vibrations it connects the circuit (for when the child waked up in the night they can easily tap or pick up the night lkight and the light will turn back on) I found this switch was better for what i needed then a mercury switch.
what i need help with is figuring out which product i should buy that would best suit my project. i could easily buy the Eleven (arduino uno compatible) board but its actually a bit big for my case.
am i able to load the code onto the chip and once loaded make my own pcb board and attatch the chip onto that with my power source (9V battery) and LED (will prob need a transistor and maybe a variable resistor? or will i need more components to make the chip work? is this easy enough to do or am I making it hard for my self?
another option is using the Leo stick as its the right size but problem is that its power source is USB which could be helpful if i could attach a rechargeable battery so when usb is connected it charges the battery and when disconnected the light runs off the charged battery. If this is do-able I would probably prefer this option as the leo stick is the best size.
to make things harder i wonder if there is a code where if the switch connects mulptiple times as in its being shaken the light will stay on for a different amount of time?
so say if the switch is connected a short number of times (so bumped on) it will stay on fading out from 100%- 0% in about about 7 mins
and if its shaken connecting the switch about 10 times it will stay on for about 40 mins?
I have no idea if this is possible just a question.
please Help as my knowledge is very minimal. and please let me know if you know any code that will help me with what I'm trying to achieve as i have no way to be able to teach my self code in the short amount of time i have. (Its for a uni project that is due in 2 weeks!!)
Thanks in advance for your help