M5Stack Cardputer and an Intervalometer for Digital Cameras
-
https://github.com/AndrewDJohnson/M5CardPuterIntervalometer
[I would like to know how to make this available in M5Burner!]
Recently, I was out walking and some heavy rain/storm clouds could be seen approaching. For a while, I had been meaning to try and do a time lapse sequence, using a Canon SX740 or Nikon P900 camera – as photographing clouds and storms can produce interesting or even spectacular results!
Unfortunately, the SX740 has no time lapse feature, although it may be possible to use something like CHDK to enable this. (I used a similar method when I had a Canon SX50, which I sometimes regret that I sold).
Anyway, the Nikon P900 has a timelapse feature built in and it’s accessed through the “SCENE” mode/menu option. However, this has certain limitations because you can only run the time lapse for a set number of minutes, with a set period for the time lapse. Also, the results are not always saved at the camera’s maximum resolution of 16MP.
A forum post I read noted this problem, and a response to the Original Poster suggested a solution was to use an Arduino device and circuit to send an IR pulse to the camera, mimicking the camera’s IR remote, to take photos. The Arduino device mentioned was an ESP32 microcontroller - and the circuit was shown constructed on a bread board. This seemed rather unwieldy, to say the least. At this point I’d realised that a recent purchase – about which I’ve been meaning the write a blog entry – not only had an ESP32 microcontroller, it also had a built-in IR LED. This is the excellent and versatile M5Cardputer!
I thought that I should be able to directly use the Arduino Sketch from the circuit example, with only one modification. All I needed to do was change the Pin number of the IR LED. That is, in the M5Cardputer, the IR LED is connected to pin 44 of the ESP32.
I loaded the code into the Arduino IDE and compiled it and downloaded it to the Cardputer… it worked straight away!
The Cardputer is well-suited to the role of IR Camera remote control – being battery powered and pocketable! All that needed to be added was some code to time the repetition of pulses and then offer some options to the user.
IR versus Bluetooth Control
Of course, one could view IR remote control as “old hat” now – as newer cameras can be controlled by Apps and either a BlueTooth or WiFi connection, providing easier functionality and, for example, video/image previews on the remote device (i.e. Smart Phone or Tablet). The Carpduter is also equipped with WiFi and Bluetooth, so could, in theory, be used to control a camera with these methods. One such project has been built for a Canon Camera, using an Arduino Board.
Support for Different Makes of Camera
In my mind, the popular brands of digital camera are Canon, Nikon and Sony – but there are, of course, several other manufacturers – Olympus, Pentax and Minolta being some. I wondered if anyone had made Arduino-based remote controls for them… After more research, I ended up finding some code called MD_multiCameraIrControl. However, this included a lot of code to control other camera features – like zoom, so was more complicated than needed. A simpler version of this code at multiCameraIrControl contained IR pulse timings for other cameras, all in one file. These were added to my code.
Additional Features
I needed to add 2 user prompts – to enter the frequency of photo taking (e.g. every 3 seconds) and the overall duration of the timelapse (e.g. 10 minutes).
Finally, it was obvious that I should allow the cardputer to be used like a “normal” remote control – with a press of any key on the keyboard causing a pulse to be sent to take a photo.
Hence, when the software runs, the user can select between using manual remote control and the intervalometer. In each case, there is an abort option so that the menu reappears and the mode of control can be changed once more.
Using the Code/Firmware
The code can be downloaded from Github – both as firmware binary (.bin) and the INO/Sketch file. To write the code onto the Cardputer’s flash memory, you will need to use M5Burner. Run the software and choose “Export firmware” and then point this at the bin file you downloaded!
Practicalities / Physicalities
So, now we have the electronics and what not all working, how can we actually use the Cardputer easily when the camera is taking the photos for the timelapse? It could be rather tiring standing there and holding it for half-an-hour!
The Cardputer has magnets in the case and so, for example, it should stick to something like a radiator or a fridge door… but we’re not likely to find either of those things on a mountain top… so it might be possible to attach it to the leg of a camera tripod? You need to ensure that the camera’s IR sensor can “see” the IR emissions from the M5 Cardputer. Perhaps you can put the Cardputer on a camping chair or table? Another option is to use an elastic band wrapped around the camera lens and the Cardputer to make sure it is pointing in the right direction. You might need to use a piece of card between the Cardputer and the camera lens to stop it scratching the outside of the case of the lens. Another alternative might be to use some sort of Velcro strap to fasten the Cardputer to the camera lens.
In testing, the Cardputer’s battery life seem to be several hours so it should easily last long enough to do some very long time lapses. It is much more likely that your digital camera battery will run out before the M5 Cardputer’s battery does!
One final note is that setting timelapse value of 1 second on the Cardputer may not produce good results, because the camera may not be able to set the auto focus and exposure in such a short time – it depends on the camera and the mode in which it is set
Happy Timelapsing – or remote controlling!