Tech in the tent

We’re just back from a week or so camping, in the wilds of mid-Hampshire.

It’s more-or-less the end of the season – the youngsters are back to school, the summer has wound down, so the sites are nice and quiet; although the weather is at risk of being more mixed than usual. As it happened, we were pretty fortunate on that front, and managed to get set up and broken down in the dry.

As a maker and techie, I sometimes get a bit antsy when we’re away like this (and when it isn’t EMFCamp… [1]). Fortunately, this time, I had a task that needed solving using technology – in this case, an RP2040 and some MicroPython.

Our tent is a very nice size, and we have space to sit and relax inside, but particularly in the evenings as the days get shorter at this time of year, the lighting situation leaves a lot to be desired. We’ve got a couple of battery-operated / rechargable camping lanterns, but wanted something more adjustable and that would cover more of the space, more evenly.

Like any good maker, I went camping prepared – with a soldering iron, massive power supply, and a roll of LEDs…!

Embedded Mastodon post with the text: "Just spent a bit of time setting up lighting for the tent. Fortunately, like any prepared #maker, I happened to bring soldering iron, solder mat, trimmers, #pimoroni Plasma 2040 #rp2040, and a lot of LEDs along on the camping trip. /cc @Raspberry_Pi TODO: a nice case for the Plasma 2040; I did not bring a #3dprinter with me to this field in Hampshire!"

First off, let’s briefly mention the power. I take a large Jackery Explorer 500 battery with us, along with the same brand’s solar panel for recharging (when it doesn’t rain…!). This trip, I also added an Anker 548 Power Bank as an extra power source; however, the solar panel uses a different connector than the newer battery expects, so I also picked up an XT60 adapter, which allows us to use the panel with the Anker as well, when needed. Works nicely, and we got the sunshine needed to stay topped up ☀️

The lighting arrangement is simple. I cut the strip of WS2812B LEDs to length to fit the arch of the tent (this was the primary reason that I waited until we were actually on-site, to do this piece of work). The strip is inside a rubberised sleeve, which is handy for weather. At the “business end” of the LED strip, I’m running a Pimoroni Plasma2040 board – essentially, a Raspberry Pi Pico (RP2040) board specialised for driving lights, with a 4-way screw terminal, some extra push buttons, and a (as-yet-unused) StemmaQT/Qwiic connector, all with a USB-C connector. I’ve soldered the required wires to the LED strip and protected the connections with heat-shrink.

Code is (of course, if you’ve followed any of my IoT/embedded interests in the past few years) in MicroPython. I flashed the board with the latest Pimoroni MicroPython build, and – for now – trivially adapted some example Neopixel code to enable us to switch between two lighting formats, and also to switch the lights off again.

# - improve colour/brightness (currently a "dumb" division)
# - save/reload state
# - I2C sensor / input
# - (hardware) case for board

import plasma
from plasma import plasma2040
from pimoroni import RGBLED, Button

NUM_LEDS = 156

led = RGBLED(plasma2040.LED_R, plasma2040.LED_G, plasma2040.LED_B)

button_a = Button(plasma2040.BUTTON_A)
button_b = Button(plasma2040.BUTTON_B)
button_boot = Button(plasma2040.USER_SW)

led_strip = plasma.WS2812(NUM_LEDS, 0, 0, plasma2040.DAT)


while True:
        # dim white
        for i in range(NUM_LEDS):
            led_strip.set_rgb(i, round(253/3),round(244/3),round(220/3))
        # bright white
        for i in range(NUM_LEDS):
            led_strip.set_rgb(i, round(253/1.2),round(244/1.2),round(220/1.2))
        # off / black
        for i in range(NUM_LEDS):
            led_strip.set_rgb(i, 0, 0, 0)
        led.set_rgb(0, 0, 0)

# for i in range(NUM_LEDS):
#     led_strip.set_rgb(i, round(253/3),round(244/3),round(220/3))

Plasma 2040 board connected to LED strip, showing the heat shrink.Plasma 2040 board attached to a white USB-C cable, with an LED indicating power, hanging inside a tent with blue and black canvas.LED script arching through a blue tent, lit dimly.

Before you shout at me – yes, I know that having a bare board hanging there like that is “sub-optimal”, so next steps are to wrap it in some nice 3D printed case, as well as considering how or whether to use the Qwiic port… I’m thinking a rotary control for dimming would be more flexible than button presses. As noted in the code comments, it would also be very handy to have the state saved internally when the board is disconnected from the battery.

So anyway, that was a fun camping trip (with added making). Back to regular living situations, now.

How about you, how’ve you been?

[1] I am also now convinced that I need to get to CCC one year! 


The light tent, and understanding white balance

Several weeks ago I had an email from a lady called Gwen Hartley who had read my articles about my self-assembled light tent (parts 1, 2, 3) but was having some issues with the colour of the images that came out. I’m reproducing our correspondence with her permission, as I think this is useful information.

Gwen wrote:

… all the pictures we take (without flash, right?) are YELLOW & people cannot see the true color of my husband’s artwork (he’s a glassblower).

… We’re currently using a larger, taller lightbox, as he needed to be able to put taller pieces in it to photograph for customers. We have 11 lights now — with 100 watt compact fluorescents in them, and they STILL look yellow & are not a true reflection of the piece’s color.

I attached 2 pics of the pieces we took yesterday… notice how YELLOW they look?! We even tried to brighten them in PhotoImpact… NO LUCK! What are we doing wrong? We are supposed to NOT use a flash, right, so we don’t get the light spot? It looks SUPER bright to the eye, but when we photograph it — it’s YELLOW.

IMG_8002.jpg    IMG_8007.jpg

At this stage I didn’t really have enough information make a definite diagnosis, but I thought it would be a good idea to work through the problem with her:

What kind of camera are you using to take the photos?

You need to set your white balance to compensate for the lighting conditions. If you are using a DSLR you can usually shoot in RAW and then change the white balance in your photo software. For a compact, sometimes they have an “indoor” or “tungsten / fluorescent” light setting… otherwise you can use some software to set the neutral colour – I’m not familiar with PhotoImpact though.

I use software called Lightroom which is intended for DSLR users primarily… by using the eyedropper white balance tool and tweaking the brightness and clarity / contrast settings the images look a little better to me.

Again, I don’t know enough about your specific situation, but basically you want to work out the colour temperature of the lamps you are using and compensate for it – lots of photo software has white balance or neutral balance tools – you just click on the bit of the image you know is white, and it rebalances the image for you.

I also attached some edited versions of the images she had sent me, which looked like this:

IMG_8002.jpg    IMG_8007.jpg

Gwen was pleased at the changes:

[we have a] Canon PowerShot S2 IS – 5 megapixels… I don’t need anything fancy – just TRUE COLORS of the pieces & non-yellow-looking images!

… I’ll check into the white balance… there HAS to be something on one of the many settings on this camera!

Now, luckily, if you don’t have a DSLR then something like a PowerShot S2 is just the kind of compact camera you’d want for this kind of photography, as it has the right level of manual control to allow adjustment of white balance etc.. I did a bit of research, and came up with the following advice:

A PowerShot is a nice flexible compact camera.

Looking into the details about the camera you have, I found this review.

It looks like if you set the camera to P or Av mode, and then go into the function menu, the second option down will be White Balance – try the Tungsten and Flourescent light settings (if you have the manual for the camera you’ll probably be able to learn more about this). That would help for getting the right colours straight off the camera. Custom WB would be even better, in this mode you usually photograph something you know to be white, and then tell the camera to use that as a marker to where the white is in the image.

I also did some reading up on the software you have, PhotoImpact, and I found this. This describes doing basically what I did with your other images – you get an eyedropper to pick a colour from the image that should be “white”, or the software can try to fix it in Auto mode.

I have to say that Gwen’s husband Scott does produce some truly beautiful artwork – check out Infinity Art Glass to take a look. I’m really glad to have been able to help them.

Back to the light tent – sort of

Some of my most regular blog traffic comes from a short series of posts I wrote a year ago, about building a tabletop light tent. I also sometimes receive questions and comments about it.

The most recent query appeared over in my guest book, from a gentleman called Buzz Coren. He wrote:

I’ve already built my light box and have been fooling around a bit with different lighting setups….I’m getting very fuzzy results and wondering if I might need a higher MP camera than my 5-year old Canon 2.3 digital elph. Comments?

In the spirit of open communication, I’m going to reply to that question here, as well as dropping Buzz a line directly.

The first thing to say is that I’m probably just as new at this – light boxes and lighting – as Buzz is! In fact the photos on his website look as though he’s probably spent a lot more time on lighting than I’ve ever done.

I took a look at Buzz’s site (which is really nice by the way – I like the “made on a Mac” part especially!) and to be honest, the photos there look fine. They are obviously not very large size, so I can’t assess how noisy / fuzzy / grainy they are. I don’t know whether they are taken with the 2.3MP camera? They are pretty good if they are!

My view is that yes, you’ll certainly get better results in terms of definition, detail, fuzzy/grainy-ness if you move up to a newer model of camera… most compacts start at around 5MP now, and the IXUS / Digital Elph I own has 7 (I think) which has been superb for outdoors photography and snapshots, although I’ve not used it in the context of the light tent. Here’s what I wrote about it back in May.

I’m not sure what Buzz’s precise problem is, though. With these kind of images you will also get better results if you can use a tripod, and a timer or remote release to avoid shaking the camera. Lighting is key too, I think even the lamps I got for the light tent were a little under-powered.

To be fair, I have not done a huge amount with the light tent but I have found that shots are noisier, and I put this down to lighting and the length of exposure. Someone else who contacted me about the light tent articles suggested trumpet bulbs, which are apparently available on eBay – these are supposed to be pretty good for this kind of photography too (thanks to Fiona Sands for this tip, which she shared with me back in September).

The moral of the story is, now that I’ve got a nice macro lens and external flash, I really ought to invest in some more bulbs and pop the tent up again! It’s fantastic that my articles attract so much interest.