Streaming camera video from an Arduino Giga

A close friend has been trying to get a video feed from an Arduino so he can make astronomical observations from a gizmo he has made that will sit in the garden and observe the video in the house over USB.

We tried various methods including using the Processing app but did not have any success. The release of the Arduino Giga with Display Shield and onboard plug in camera (OV7675) has changed things. Using these integrated modules with the OpenMV application produces good quality video over the USB connection. An image of the Giga from the Arduino website is shown below.

There is a write up on using OpenMV on the Arduino forum. This is easy to follow and works very well. If I understand it correctly OpenMV loads specific firmware into the Giga rather than an Arduino based code uploaded in the normal way.

There are a few minor things to watch out for. The Giga seems to like a double reset to clear out any existing code before loading the OpenMV code. Likewise when reverting the Giga back for Arduino use you must also do a double reset.

As mentioned in the article you need to load the display.py demo example code but the demos are not available for selection until OpenMV detects the board in use. Once the boards is detected you will get details on the bottom status bar.

The other minor thing that is not immediately obvious …. if the video and the histograms are not present on the right hand side of the screen you need to drag them into view using the side arrow.

Here is a screen shot showing the code on the left hand side and the video feed and histograms on the right hand side,

The Arduino Giga is a very sophisticated module and the various example sketches that are available to run on it are impressive. It will certainly stretch my ‘cut and paste’ coding….

Links to similar or related post are listed below : –

Arduino Giga Display Shield and lvgl.h

When the Arduino Giga appeared on the market with its associated glossy Display Shield it looked like a programmers dream.

I am not a programmer. Sitting down to do a software project to me is like writing off a large lump of my remaining MTBF.

John, my close friend in France, is an also ran in this respect. We both fumble around doing cut, paste and edit development and end up with some quasi stable code that might do the job intended.

So joy of joys the Giga appeared and John got excited … which rapidly degenerated into acute frustration, hair pulling and suicide by software tendencies.

I got sucked in to help – blind leading the blind.

I tried running all the Arduino demos for the Giga Display Shield and after an inordinate length of my life had passed I concluded that any sketch with ‘#Include lvgl.h’ in it would be unlikely to run.

Slight digression. What is not made generally clear is that with lvgl library you have to edit the lv_conf_template.h file and re-save it in the Libraries folder as lv_conf.h. The edit is simply to change a 0 to a 1 and instructions are in the text at the top of the file listing. This edit enables lvgl. I spotted this and duly did as directed. Still no joy.

Out of desperation I deleted the lvgl library version 9.0.0 and replaced it with the 8.3.11 version. I then had to do the 0 to 1 and do the Save As etc routine again….

To my huge surprise this worked . See below as a simplistic overview of the changes needed.

So progress has been made and there are some nice demos to watch now that they are running OK. Note that the Arduino IDE will constantly tell you there is a later version of the lgvl library but you have to ignore this and opt for manual update. If 9.0.0 does get loaded you will have to go through the above process again to the extent of removing 9.0.0 and replacing with 8.3.11 but the edited lv_conf.h file will be unaffected so you don’t have to repeat the edit and Save As process … hopefully someone will fix it in the near future.

I would further add that not all the published demo sketches work. If you want a reliable sketch to demonstrate the camera onto the Giga screen download from Kurt’s depository on the link below.

https://github.com/KurtE/Arduino_GIGA-stuff/blob/main/sketches/GigaCameraDisplay/GigaCameraDisplay.ino

Conclusion – maybe metal bashing, Fusion 360 and 3D printing suddenly have a much more attractive appeal.

Links to similar or related post are listed below : –

Arduino ESP32 Feather Huzzah Installation

Installation was not as easy as expected

We are currently in France and this is always a time to relax away from the workshop and instead I usually end up doing computing ‘stuff’ which can be Fusion 360 designs or Arduino code. I have a couple of projects that will potentially involve either an Internet of Things (IoT) connection or possibly a direct WiFi connection between two Arduino modules.

I need to clearly state at this point that I am not a ‘softie’ and my Arduino code is a mix of Cut and Paste with some finger in the air suck it and see code. I get there in the end but it can be painful to be aware of hours of your life dribbling through your fingers all because of a forgotten curly whirly bracket somewhere in the code.

Back to the story. I got sucked in by the MKR1400 GSM as being a potential solution and signed up for an Arduino SIM to accompany it. This worked to a degree but then I discovered that the GPRS service is slowly disappearing all over the world as the spectrum is ‘repurposed’ for newer technology. The Arduino 33 IoT was then ordered and this seemed to work well with control over the WiFi network and from the associated Arduino mobile app. It did have some limitations for the main application I had in mind.

Next the ESP32 came to my attention. This is a fairly new kid on the block and has some very interesting facilities. The ESP32 Feather Huzzah version from Adafruit is rather nice as it has a Lipo battery connector. Unlike some other ESP32s it does not have a Load switch but just a Reset one. The ESP32 looked like the most attractive and a couple were ordered.

For those following in my footsteps you need to be aware of two things, First of all you have to download the libraries for the WROOM device.

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

You would expect that would be all but not quite. On Win10 you need to also download a new virtual USB driver from Silicon Labs CP210x and run “silabser.inf” from the ZIP download.

https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads

Once you have downloaded and run these you should be able to select and connect to the Adafruit ESP32 Feather in the Arduino device listing. (NOT the Adafruit Feather Huzzah ESP8266 from the board listing, it is easy to just ‘see’ the Feather Huzzah words,,, been there ….). You might also need to look in the Windows Device Manager to see which COM port has been allocated to the Silicon Labs CP210x driver. This will likely be a high number – COM9 on my machine. The IDE does not necessarily immediately ‘see’ this.

If the ESP32 appears to connect OK try uploading Blink. If all is well this should work. Beware it leaves the confusing last message on IDE 2.0 “Leaving … Hard resetting via RTS pin …” which looks like it is held but in fact it has finished and all is good.

Note that all of this waffle was written in January 2023 and the ESP32 hardware and support code etc is changing all the time.

In closing I can recommend DroneBot as a good source of Arduino stimulation.

Links to similar or related post are listed below : –

Dewpoint Monitor Updated Arduino Code

Dewpoint Monitor Auto Reboot facility added

In November 2021 I detailed a Dew Point Monitor. This was aimed for workshop use so a heater or dehumidifier could be turned on automatically to help prevent rusting of assets.

This has been very successful but had one minor issue. If the sensor failed or became disconnected the Arduino would lock up on sensing the problem. Plugging the sensor back in would not re-boot the code. I have added an auto reboot on sensor fail detection.

I have also removed the code that flashed the display after a humidity detection as this seemed superfluous.

The revised write up which contains the code listing is attached on the following link :-

Links to similar or related post are listed below : –

Dewpoint alarm monitor to help avoid rust issues in the workshop

A Dewpoint Monitor to protect the workshop

I have recently read a number of posts on workshop forums about rust degrading workshop assets.   When the temperature of the air reaches close to the dew point then the moisture in the air will condense on the cold surfaces in the workshop and moisture will inevitably lead to rust forming.

You can protect against this to some extent by ensuring that all exposed surfaces are coated with lubricant of some sort such as WD40 and only dry sources of heat are used in the workshop.   A better protection solution which was popularised by the clockmaker William Smith, is make a 50/50 mix of linseed oil and thinners and coat this on the objects needing protection.  This works well but does not last forever.

Looking around on the internet there are various Arduino projects to create a dewpoint monitor using the DTH11/DTH22 which are combined temperature and moisture probes.  Such devices, with a little bit of maths, can provide an alarm output if the dewpoint reaches close to the air temperature.   This could be used to turn on a heater and raise the air temperature and avoid moisture being deposited.  I opted to have the sensor remote via a cabled connection.

The dew point calculation I used is the Magnus-Tetens formula (Sonntag90).  This provides accurate results (with an uncertainty of 0.35°C) for temperatures ranging from -45°C to 60°C.

The dew point is calculated according to the following formula:

Ts = (bα(T,RH)) / (a – α(T,RH))

where:

Ts is the dew point;
T is the temperature;
RH is the relative humidity of the air;
a and b are coefficients.

The Sonntag90 constant values are : – –

a = 17.62 and b = 243.12°C;

and this is the final formula needed : –

α(T,RH) = ln(RH/100) + aT/(b+T).

I made a prototype using an Arduino Pro Mini as the controller and I used the above equation to calculate the dewpoint from the humidity and temperature readings input to the Arduino from the DTH22 sensor.   Once the dewpoint reaches within a defined limit of the temperature, a relay is closed to allow heaters to be turned on.   This trip point also causes the LCD display flash to warn that a trip point has been reached.

The working circuit was drawn in Fusion Electrical and a printed circuit board layout was created.   Fusion’s Electrical CAM output as Gerber and Epsilon files were converted in FlatCAM to CNC GCode.  The CNC files were than posted to my Tormach PCNC440 to mill the copper traces.

I designed the PCB using through hole components to make assembly easier for my more mature eyesight.

The trigger output from the PCB can feed any 5V coil relay that is rated with contacts capable of feeding the AC voltage and current needed for the heaters.

UPDATE 18/12/2021

Due to demand I have ordered a small quantity of offshore manufactured PCBs for the Dewpoint Monitor.  If you are interested in one then send me an email as per address below.  First come first serve.

UPDATE 1/11/2022

Auto reset code added should the sensor lose connectivity,

New write up is below including the new code

Similar or related subjects : –

 

 

 

 

 

 

 

Verified by ExactMetrics