• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

LRTimelapse Pro-Timer Free

Offline
#41 IamaRobot
(2017-02-21, 22:18)gwegner Wrote: In theory it should be possible, but since the Arduino does not have a real time clock, you'd have to add a separate module for that otherwise you would have to reenter the current time each time that you power on the device. Apart from that it would be adding that functionality to the sketch.

Hi gwenger! Thanks for your Pro-timer I love it. I make time-lapse projects of boat building over 9 months and wonder if it is possible to get instructions how to add a clock. Setting up the Pro-timer to do timelapse during working hours (9-5) would help me a lot.

Thanks heaps!
Offline
#42 SimenZhor
Do you have any coding experience at all? If you do, you should look into this library. It should be a trivial matter to hard-code what you're asking for (however, keep in mind you will definitively need an external power source). You will also need to do some testing on how your code behaves when the Arduino looses power and is reset. In the current version of LRT Pro-Timer the timer will need to be manually restarted. I am planning on implementing a small change to this on my own unit and if I'm pleased with my own solution I'll send in a "pull request" to Günther so that it can be included in the official code. However: keep in mind that for such a long term project you're describing you probably don't need all the menu functionality the LRT Pro-Timer provides, and writing the code from scratch (based on what Günther has provided of course) would probably be the best way to do this.

Let me know how your coding experience is, and I'll do my best to help you

Edit:
I'm sorry, but after researching a bit this seems to be a bit less trivial than I thought. The Arduino doesn't have an internal clock counting anything else than the time since it was switched on, meaning that the libraries used to control such things rely on external hardware (GPS, WiFi or a computer sending the time to the Arduino through USB). This means that without expanding your controller with for example a GPS sensor it won't be very reliable over such a long timespan. The other option I could think of is to set up two timespans (say 8 hours a day it should take pictures, and the remaining 16 hours it should not) that counts down one interval each time a picture is taken. It would be synchronized by being started at the correct time the first time it's set up. This approach is also very vulnerable to power loss.

Edit 2:
The RTC chip called DS1307 seems to be the best option to set the time and keep it through power loss. However, I haven't printed my LRT Pro-Timer case yet, so I don't know how much space there is left in it, I haven't tried to connect this chip either, so I can't guarantee it will have the correct pins available. There are very cheap versions of the chip on ebay, but since you are going to leave it running for such a long time I'd look into Adafruit's DS1307 chip instead. However, the ebay ones are probably good for testing.

About the space in the case. Seeing as you're probably gonna have external power connected to your timer, the room where the batteries should stay can be used to store the RTC module.
Offline
#43 IamaRobot
(2017-08-18, 11:27)SimenZhor Wrote: Do you have any coding experience at all? If you do, you should look into this library. It should be a trivial matter to hard-code what you're asking for (however, keep in mind you will definitively need an external power source). You will also need to do some testing on how your code behaves when the Arduino looses power and is reset. In the current version of LRT Pro-Timer the timer will need to be manually restarted. I am planning on implementing a small change to this on my own unit and if I'm pleased with my own solution I'll send in a "pull request" to Günther so that it can be included in the official code. However: keep in mind that for such a long term project you're describing you probably don't need all the menu functionality the LRT Pro-Timer provides, and writing the code from scratch (based on what Günther has provided of course) would probably be the best way to do this.

Let me know how your coding experience is, and I'll do my best to help you

Edit:
I'm sorry, but after researching a bit this seems to be a bit less trivial than I thought. The Arduino doesn't  have an internal clock counting anything else than the time since it was switched on, meaning that the libraries used to control such things rely on external hardware (GPS, WiFi or a computer sending the time to the Arduino through USB). This means that without expanding your controller with for example a GPS sensor it won't be very reliable over such a long timespan. The other option I could think of is to set up two timespans (say 8 hours a day it should take pictures, and the remaining 16 hours it should not) that counts down one interval each time a picture is taken. It would be synchronized by being started at the correct time the first time it's set up. This approach is also very vulnerable to power loss.

Edit 2:
The RTC chip called DS1307 seems to be the best option to set the time and keep it through power loss. However, I haven't printed my LRT Pro-Timer case yet, so I don't know how much space there is left in it, I haven't tried to connect this chip either, so I can't guarantee it will have the correct pins available. There are very cheap versions of the chip on ebay, but since you are going to leave it running for such a long time I'd look into Adafruit's DS1307 chip instead. However, the ebay ones are probably good for testing.

About the space in the case. Seeing as you're probably gonna have external power connected to your timer, the room where the batteries should stay can be used to store the RTC module.

Hi SimenZhor! Thanks for your quick reply. You are quite correct that I will be using external power so the battery space will be free. The Adafruit chip you recommended is on it's way and will get tested when it arrives. I do not have any coding experience and will have to learn some I guess, a good opportunity while the components are on their way! Thanks again
Offline
#44 SimenZhor
(2017-08-19, 12:24)IamaRobot Wrote: Hi SimenZhor! Thanks for your quick reply. You are quite correct that I will be using external power so the battery space will be free. The Adafruit chip you recommended is on it's way and will get tested when it arrives. I do not have any coding experience and will have to learn some I guess, a good opportunity while the components are on their way! Thanks again

Hi again, I've made some code that's supposed to do what you're asking for above (when you install the RTC chip on your Pro-Timer). However, I haven't had the possibility to test it, as I don't own the DS1307 myself, so I can guarantee with 99% certainty it will have unexpected bugs Tongue

Anyway! Here is a branch of my GitHub fork of Günthers code focusing on long term timelapses:
 https://github.com/SimenZhor/LRTimelapse...Timelapses.

The main difference between this code and Günthers code is that it's got a new mode option called "daily schedule", which is supposed to be what you're looking for. This mode won't show up unless there's a RTC connected to the Arduino running the code. The other big difference is that my code saves variables in case of power loss. This isn't properly tested either, but should work to a certain extent. There are issues with this - mainly because I can't save any of the variables based on the millis() function (which is used to control the entire intervalometer right now) seeing as millis() return the time since the Arduino was turned on last time.

I've also noticed a few other problems you're gonna face in your long term project (some of these are probably worthy of noting for you too Günther):
- millis() will overflow after about 50 days, making the intervalometer stop completely in the current build.
- If you have short intervals, the imageCount variable will overflow too. I've changed it from int to long, meaning it won't overflow before it has taken 2^31 = 2147483647 pictures (as compared to 2^15 = 32768 before), so you're probably fine. But in the 0.88 version, using ints, a long term project like this might actually be at a teeny tiny risk of overflow.

The first of those two issues will need to be handled manually for now (by resetting the Arduino when it's outside the scheduled period. It should start where it left in the code I linked, so this shouldn't be a problem), or the entire code needs to be rid of the millis() function. The last option is the best one, but that means the code will be completely reliant on the DS1307 RTC chip, something I don't want to do unless the official project also makes this upgrade.

About that chip. In the code I linked the RTC chip is supposed to read the time of the compiler when the code is being uploaded. I have no idea if this works as flawlessly as the libraries made it seem, so keep this in mind when testing. You might have to sync the clock more manually, see this for further instructions. When it comes to the wiring, it seems the DS1307 just needs four cables, two being 5v and gnd. The other two are the Analog 4 and Analog 5 pins marked "SDA" and "SCL" on the LCD shield.

...also check out: