This is my first project. Hopefully it won't take me a month. This is a wall clock in the shape of a Stargate. The main visual elements are a 60-LED ring mounted behind a laser-cut and etched stargate.
I'll be able to use this as a functional reference. It'll need some modification, as it's supposed to work with 2 rings.
The Led ring clock in the above project as it's configured draws 90mA. This includes always on hour indicators, whick I'm hoping won't be necessary.
When powering the whole circuit through the ProMicro's BAT pin, the power draw was 84mA. Not sure why it seems to draw less than when the generator was powering only the led ring, but it gives me a general idea of how much the circuit consumes. I'll look into ways to reduce power consumption, but this isn't a priority.
Tried to replicate https://learn.adafruit.com/neopixel-60-ring-clock?view=all but the LED ring display was really wierd. Followed recommendation of powering ring separately, using 6v generator, but didn't change the weirdness. For some reason, Arduino Leonardo setup didn't work at all (ring lighting was static - no movement), whereas using an Adafruit ItsyBitsy (Adruino Pro Micro) got some movement on the ring, but not the expected movement.
Managed to improve somewhat my understanding of libraries and how to use them :D
Managed to set time on the RTC :D
Managed to run "strandtest" from the fastLED library and everything seems to be working on the ring.
So I guess my main objective right now is to get the RTC to provide a signal that will be converted into something legible on the ring. So far the projects I've found have been helpful. I can't make them work, but there are sufficient common points between them that I can start to figure out what I'll need to include, if I want and am able to code something more or less from scratch.
So, I'd say what I need to learn is :
- how to light up different parts of the ring in different ways. Trying out super basic sketches with one or two functions should help.
- how to convert time input into information that will be useful for lighting up the ring.
- linking time info with desired lighting output (functional and pretty) on the ring.
I've put the chassis design (stargate front, container, prospective cable management, battery holders, etc.) on hold, as it doesn't seem to be the right time (haha), and it's hard enough to focus on the one task of coding something functional, when I'm learning how to do so, pretty much from scratch. Maybe if I need a break from not making progress on the code.
Tried to run a light dependent resitor (LDR) on the same board, and get it to display on the Arduino IDE serial monitor. It worked on its own, but not at the same time as the LED ring display. I discovered that this is due to my use of delay(), which pauses the whole loop().
In the end, I managed to get everything working at the same time by reducing the delay for the LEDs.
I'm not getting a very wide value change for the LDR. Values only vary from 500-800. WIle I wasn't expecting them to go all the way to 1023 when the LDR is fully uncovered, I was expecting them to be close to 0 when I cover the LDR with my finger.
Wanted brightness to change based on LDR value, but can't see a change. Not sure what it's due to. Maybe the value itself doesn't change enough. Maybe I haven't defined the right type of variable (don't know if the neopixel library needs it to be an integer, I assume so since it goes from 0-255). Maybe my code's just wrong in another way.
What I want to do:
Find other functions which can replace the same effects as a delay and prime better programming practices for myself in the future.
Investigate reason for LDR values not going below 500.
inversitage whether need / able to use "ldrValue/4" as a variable to define brightness of LEDs.
Tested controlling the ring using Arduino Leonardo and Pro Micro. Wanted to see how small I could go. Several pro micros from the fablab didn't work, or overheated, and I don't know why. (It's 'cause they're shitty clones and need specific drivers, apparently).
Played around with colour, delay, and pin settings in Arduino IDE
Did a light test using a chunk of scrap transparent PMMA which I'd sprayed grey, then had laser etched a stargate segment onto. It looks pretty good.
Powering the device deep dive part 1 - what power source am I going to use? 9V battery doesn't hold enough juice. I might need to plug it into the wall if a reasonable amount of battery life comes with an excessive battery chonkiness tradeoff.
Soldered a DC jack to a 9V battery connector. Probably won't need it, but I wanted to try.
Founf out I need a resistor for the signal input and a capacitor for the power.
Want to do:
One of the first things I need to do is design the ring for lasercutting and etching, so that I can design everything alse around it and the LED ring.
Need to think about time change options so the time is easy to adjust. Rotary encoder?
Want to include a Light-Dependant Resistor to control brightness of ring depending on ambient light.
Want to check whether PIR is worth integrating, to only switch on when someone moves into the room. Corrollary: an the PIR sensor be integrated into a dial-home-device
Make a case for the ring to stick to the back of the PMMA, so as to avoid light bleed.
Learn to fucking code
Trying to understand what resistors / capacitors I should use, if any. Projects I've found as references aren't consistent in either regard.
Design questions for later:
Should I use a switch, or will that fuck with the RTC?