Jump to content

Large 'Retro' Power System Display


HedgeSlammer

Recommended Posts

Energy-Jason
This post was recognized by Energy-Jason!

HedgeSlammer was awarded the badge 'Great Content' and 20 points.

Vital to being able to keep within the inverter output limits (and avoid importing expensive grid power unnecessarily) is having the means to display the relevant information in an immediate and accessible way.

That's what I told my wife, anyway.  Really, I'd just scored a bunch of old RC servos on ebay for £5 and I wanted to play with them. 😉

spacer.png

 

In context:

spacer.png

 

It uses 6 servos, a Wemos d1 mini clone and a tri-colour LED.  Dial faces are 3D printed, with a filament change from white to black (which turned out much better than I imagined, TBH).

The servos only had around 90° of sweep angle, so I 3D printed some little holder/gearbox things to get over 180° and provide a shaft for the needle to go on, plus some 'steampunk' needles.

spacer.png

spacer.png

 

All run buy the obligatory D1 mini and held together using the very latest in 'twist and tape' technology.

spacer.png

 

Yee-haw! 🤠

It gets fed the data from 'node-red' running on a Victron CerboGX via UDP packets over WiFi, updating as often as the data changes (approx 3 second intervals).  The LED changes colour according to state, so 'All OK' is green, 'You're getting very close to/exceeding the inverter output limit, so if you don't want to pay for grid, don't turn anything else on' is red, then blue for 'dumping power into the hot water tank'.

It's by no means silent in operation.  I originally made a single-servo version for just PV generation and coded it so that the meter movements were gradual (a kind of PID to get from one value to the next), but apparently it 'sounded like we have cockroaches' when it made it's ticky-scratchy transitions between values, so the big version just jumps between values with a 'zzziiiiiup!' sound.

It's actually quite reassuring to have an audible indication when the sun comes out for 5 seconds, or it starts charging at night.

I'd also put a little radar sensor in there, with the aim of having it detect when there was nobody around, so it could stop displaying to save power/noise.  Unfortunately, that meant that every time you entered the room, all 6 needles would suddenly move at the same time, making you jump out of your skin and spill your horlicks, so we just leave it 'on' all the time now.

There's also a basic web UI, so you can see the same data on your phone or whatever, plus it's useful for troubleshooting:

spacer.png

 

I had fun and learned loads making it - and now it's become a family game to try to cook dinner without making the red light come on. 🙂

 

Libraries used are 'ESPUI' and 'servo', plus 'arduinoOTA'.  Code, FreeCad file for the gearbox & stl file for the arrow-head needle are all in the attached zip.

Power_meters_v2..zip

Link to comment
Share on other sites

31 minutes ago, HedgeSlammer said:

I'd also put a little radar sensor in there, with the aim of having it detect when there was nobody around, so it could stop displaying to save power/noise.  Unfortunately, that meant that every time you entered the room, all 6 needles would suddenly move at the same time, making you jump out of your skin and spill your horlicks, so we just leave it 'on' all the time now.

🤣
This is the freaking most awesome project I have seen in ages... Well Done... Love it!

Link to comment
Share on other sites

5 hours ago, Energy-Jason said:

Could you send a video of it in action?

Cheers!  I'm just glad it amuses someone else, too.

Video (with 'Ziiiiurp!'), as requested:

Booting up: https://sendvid.com/in7wrlwm

'Test' mode: https://sendvid.com/v0ax5cka

Kettle on: https://sendvid.com/evb63wvq

Charging from grid: https://sendvid.com/q79l236l

5 hours ago, WannabeSolarSparky said:

I tried getting my wife to use all my graphs, she said the data is just too much for her.

Yep, we had an old Android tablet stuck to the wall for a while (OK, so it's still there) with the 'Victron Remote Console' displayed, then a Grafana dashboard.  The thing just kept turning itself off after a while (no matter what I did), so it was never on when you looked at it.

Then I made this rough-as-rats LED meter to display SOC:

spacer.png

But it's pretty ugly... I figured that six of them would be (at least) six times as ugly.

Like I said, I got pretty lucky with the RC servos - despite some of them being different makes, hence the slightly differing arcs of travel seen in the videos... also, making the 23-toothed internal splined bit of the bigger gear was a challenge... but you can get the smaller servos for a couple of GBP each and they would do the job, I reckon.  The first (single servo, no gears [so only 90°] PV generation) meter I made just had a cable tie end as the needle.  But if anyone wants a crack at making something similar, I'm happy to help where I can.  I've attached a zip below with all of the .stl files (for 3D printing), including a 'drilling template' to help get the holes in the face in the right place.

I've an idea for my next project (visualisation again)...

Basically, a hardware rendition of the 'animated power flow lines' as displayed on some inverter front panels, the Victron VRM/Remote Console and @slipxs' beautiful Home Assistant cards.

Using an ESP8266 (or 32) to drive a ton of 74HC595N 8-bit shift registers to light LEDs in sequence, with the speed/direction/intensity(maybe?) proportional to the live system data.  The thing I'm stuck on is how to make it NOT look like that LED stick above...  I tried some of that twin-wall extruded PVC shower panel material (it's like a bunch of square tubes next to each other), then only poking the LEDs through one wall, but the light leaks too much.  I thought about clear PVC tube (for that 'Buck Rogers' vibe), but too many wires unless I manage to stuff the shift register chips in there, too.

I'll find something, though. I always do. 🤔

 

15 minutes ago, Energy-Jason said:

"Horlicks" haha! That still available?

Oh, yes!  It goes really well with a dash of Brandy... so well that you can get away with buying the cheap stuff. 😉

Power_meters_v2_All_STL_Files.zip

Link to comment
Share on other sites

Well done. I have wanted to do this for the longest time, but never get around to it.

Being a full fledged tech junky, there is just something so satisfying about mechanical dials.

Try putting some vaseline on the gears to reduce sound, and maybe a sound deadening attempt with some foam? Just an idea.

Link to comment
Share on other sites

Thanks Gary & Pho3niX...

I did give the gears a good dosing of white lithium grease when I put it together, but it could probably do with another dollup.  I've got some sticky backed acoustic foam somewhere, so - if I can locate it -  I might try sticking some of that to the back of the board to dampen it a little as you suggest.  I could also have taken a lot more care in making the gears!  But really, the noise isn't a problem for us.

The new 'LED flow meter' project will be completely silent, though.

I think I've settled more-or-less on how to do it...

A 3D printed 'frame' - essentially a strip of plastic of whatever shape and length with a slot the width of the LEDs (5mm) in it.  This is laid face down on a silicone mat, then hot glue fills the slot.  Before it sets, another (previously prepared) 3D printed part, the same shape and size but with individual holes for the LEDs (rather than a slot) filled with the LEDs is pressed into the glue.

The idea is that the (set) milky-white glue acts as a diffuser for the LEDs, as well as holding it all together.

Here's a test piece I made up with 8 LEDs to try it out, just running off an arduino:  https://sendvid.com/5ay3wpud

I think I might try making the glue a bit deeper, so as to increase the diffusion effect.

For running the LEDs themselves, I looked at 3 options.  Neo pixels (individually addressable LEDs) would be cool, but aren't that cheap, although they might be easiest to work with - especially for wiring.

I2C port expanders (PCF8574 etc) would do the job, but again, not that cheap and I would need a few.

The there's the 74HC595N 8-bit shift registers...  I have loads of them already, they're cheap as chips (heh) and I can cascade them as much as I like.  So that's what I'm going with.  They need 3 pins (clock, data and latch), but I think I can get away with sharing a single clock between 4 of them (or rather 12... 4 channels of 3 chips, 24 LEDs on each channel).  It will take me into unfamiliar territory as far as coding goes, which isn't a bad thing.

Both of the above last two options lack the ability to dim individual LEDs (well, except the 74HC595N will if you want to use a special library which interferes with all sorts of other things), which is quite important if I don't want the thing to look all 'blinky' like a '70s star ship.  A smooth transition between adjacent LEDs will make it look more 'flow' like.

So the idea I (and likely thousands of others, if I searched Github) hit upon is to have two negative 'buses', with alternate LEDs connected to each (so no two adjacent LEDs are on the same bus), then I can use PWM on the negatives to have one getting brighter, while it's next door neighbour is getting dimmer.  This way I can control the intensity of as many LEDs as I like, but only use 2 of my precious PWM-capable pins (per 'line') on the ESP.

The two PWM pins ramp up and down, but opposed (one is going up while one is going down) at a rate proportional to the rate the LED 'positives' are switched on in sequence (only ever 2 on at any time).  So LED 1 is turned on and ramps up, then LED2 is turned on and ramps up while 1 is ramping down, 1 turns off, then 3 is turned on and ramps up as 2 ramps down and so on.

You can see this principle working in the video above (8 LEDs), or a little better in this one (24 LEDs): https://sendvid.com/gddno1tj

I'm quite please with that, but if I can figure out a way to do 3 PWM negative channels (x4), so have one dimming, one on and one ramping up, all the better. 🤔😁

Anyway, have a good Christmas or whatever you're having.  Comments/suggestions most welcome! 🙂

Link to comment
Share on other sites

The 'arms' - about 150mm long.  Might need to be a couple of mm wider/deeper to accommodate the 74HC595 chips at the back.

spacer.png

 

The whole display will be around 500mm x 500mm...

spacer.png

Not sure about the 'inverter' thing in the middle... might just do a model of the Victron Multiplus II, and reproduce the status LEDs from the front panel.

I hope Santa brings me some more hot glue sticks. 😁

Link to comment
Share on other sites

On 2023/12/21 at 12:59 AM, HedgeSlammer said:

Using an ESP8266 (or 32) to drive a ton of 74HC595N 8-bit shift registers to light LEDs in sequence, with the speed/direction/intensity(maybe?) proportional to the live system data. 

@HedgeSlammer Maybe try ws2812b led's, then you do not need all those shift registers only single data pin needed. And if you set the intensity to low/mid range then the esp8266/esp32 will easily handle up to 300 of those led's before needing any power injection.

Edited by WannabeSolarSparky
Link to comment
Share on other sites

I am going to give this a go 🤣 I am waiting for my BMS PCB's from China so quite bored...

My initial mockup using 100cm X 70 cm footprint.

esp32, 9x mini SG90 180d servos driven by pca9685 16 channel and using ws2812b led's for the flows and battery SOC
For a change all the parts were available locally at decent prices, should get delivery on Friday 🤞 and bonus is the servos were on promotion at botshop for 2x 5 pack (R260)

servo-retro-dashboard.thumb.jpg.3788c3c5d39de3bfbabe71d7d6df5c01.jpg

 

 

Link to comment
Share on other sites

19 hours ago, WannabeSolarSparky said:

Maybe try ws2812b led's

I agree, the neopixels (WS2812) would simplify matters immensely - I only need to spend about £11 GBP to get 1 metre of tape with 144 of the WS2813 (better, faster version?) on it.

I did kind of like the idea of kludging it together with the shift registers, and while initial tinkering looked promising, I've run into an issue with the dimming - which needs to look right to get the desired 'flow' effect. 

Specifically the timing:  To write non-blocking code that regulates ramping the PWM up and down in between switching the LEDs in sequence, I'm down in the world of  microsecond timings (especially when it's 'flowing' fast).  The ESP32 has an annoying quirk whereby I can write (blocking) code with 'delayMicroseconds(interval)' which looks fine at high flow rates, but when I use a non-blocking 'if (micros() - timer > interval)', it takes WAY longer.  Apparently this is due to the number of clock cycles it need to calculate 'micros()'... Ironically, 'millis()' takes less time, as it's being read straight from a register.  Pah.

I've been fiddling with making the 'steps' in the PWM ramps larger, proportional to the value being displayed.  While this sort of works with the one string of 24 LEDs, by the time I've added another 3 or 4 strings to the mix, dealt with the incoming UDP packets etc, I think I'll have found the limits of the ESP32, if not my coding ability and patience.

Pity, as I'd just found a 40106 hex schmitt inverter lurking at the back of a drawer, which freed up 4 PWM pins, as I realised that I can use just 1 PWM pin per string instead of 2 by simply inverting the PWM signal for the other half of the LEDs.

But yep, the neopixels will be a lot more flexible, faster, easier to wire and likely look a lot better... Plus the ability to change the flow colour will be useful.  I guess I'll have to get my head round that 'FastLED' library.  But I'll probably still use a shift register or 2 to display battery level or something, just for old times sake. 😏 

-

Your mockup looks epic!  Servos at ~£1 GBP each is pretty good, too... and they're 180°, so no need for gearing.  Looking forward to seeing it. 🙂

How are you planning on getting the data into it?  I used UDP from node red on the Cerbo GX... in node red, I added an offset of 1,000,000 for one variable, 2,000,000 for the next and so on, then at the ESP end did a simple 'if it's more than 1,000,000 and less than 1,999,999 : subtract 1,000,000 to get the value', etc.  It seemed to be the simplest/fastest way of doing it, but I'm sure there are others.

I had to order my neopixels from China, so I'm just waiting on speedpak now.  I found a good resource on 'fastled' patterns (c/w videos of each effect) which I can stare at while I'm waiting... I'd like to do something between 'cylon' and 'comet', I think. 😁

Edited by HedgeSlammer
add link
Link to comment
Share on other sites

2 hours ago, HedgeSlammer said:

How are you planning on getting the data into it?

I am using mqtt so I can get the data from any of my existing sensors without need to re-code anything, idea is so that anyone can make some small tweaks and then have their data populate the display. Many people use HA so they will/should be able to use their data easily. ( THAT'S THE THEORY ANYWAY ) Will see how that goes with the programming 🤪

2 hours ago, HedgeSlammer said:

WS2812

I had a spare 5m roll of 300 led 60/m WS2812B in a drawer gathering dust, i am putting that to good use now for the flows 🤣
Programing it is a bit of a bitch, as I am using 1 single string segmented to 13 pixels per segment or whatever size is needed at each location
Took all afternoon to get the scale worked out, now I just need to use the scale and do all the rest of the flows.
All the segments will be cascaded together into a single string.

Using fastled patterns and palettes make the programing reasonably slick.

servo-retro-dashboard-to-scale.thumb.jpg.69da6eae308b0d1c7806398a38e0e3aa.jpg

Here you can see 2 segments of 13 pixels each working nicely independently from each other.

Colours and directions change nicely according to the data received from mqtt

 

 

Link to comment
Share on other sites

I am close, just need to do a test print to make sure I got the scale correct.

There are 8 Flow segments, one battery level segment and one matrix segment.
Total LED's 105 in the segments and 256 Led's in the matrix.

With the coding so far it ended up being better/easier to split the segments from the matrix, so ended up using two data pins.
The 9 Servos will use I2C
Wifi will call mqtt to populate the display data.
Overall the esp32 is going to be doing some actual work for a change 🤣

servo-retro-dashboard-to-scale-1st-print-test.thumb.jpg.5a1d5943065f3d9f7a08133f8ea65c4e.jpg

 

Link to comment
Share on other sites

Nice. 😎

I was going to ask: Why a single string?  Splitting them up into multiple strings wouldn't make wiring any more complex - it might make it simpler... all those pins on the ESP32 going to waste!? 

From what I understand, it doesn't take any longer to display than a single string... they all get their data in sequence, then a single 'FastLED.show();' call to display everything?

I've not had the chance to use the library yet, but I'm quite looking forward to it... the 'blur' and 'fade' looks good, plus the inbuilt non-blocking timers sound like bliss. 🤓

What are you thinking for the dial faces and the loadshedding/geyser indicators?

Link to comment
Share on other sites

1 minute ago, HedgeSlammer said:

From what I understand, it doesn't take any longer to display than a single string... they all get their data in sequence, then a single 'FastLED.show();' call to display everything?

It should not make too much difference either way. Also I have some other ideas that will use up some more of those pins 😉
It is more just a personal preference to use a single string which I can segment in software. My coding is DIY/hobby level so I learn as I go 🙃 if it becomes too dirty I will certainly try splitting the string and seeing if it makes the coding easier or harder.

12 minutes ago, HedgeSlammer said:

I've not had the chance to use the library yet, but I'm quite looking forward to it...

It's the only one I found that gives me the functionality I need for this use case.
Yes, it has a ton of effects.

13 minutes ago, HedgeSlammer said:

What are you thinking for the dial faces and the loadshedding/geyser indicators?

Will start looking at options/styles for the dial faces and needles on the weekend.
Not really given thought to the indicator led's yet either.

Again, thank you for the inspiration to give this a good try :)

Link to comment
Share on other sites

You're welcome.  Please convey my apologies to your wife. 😁

It just occurred to me that I didn't mention how I made the big LED in the OP...

I had a bunch of these 16mm push buttons:

spacer.png

..which are not very good at being push buttons.  In fact, they are the worst buttons I have ever come across.

But with the button and plastic back removed (way easier than it should be), placed face-down on a silicone mat and filled with hot glue, then a 5mm tri-colour LED pressed into the back of them, they become big diffused indicators with a fetching chrome bezel. 🙂

Link to comment
Share on other sites

11 hours ago, HedgeSlammer said:

You're welcome.  Please convey my apologies to your wife. 😁

It just occurred to me that I didn't mention how I made the big LED in the OP...

I had a bunch of these 16mm push buttons:

spacer.png

..which are not very good at being push buttons.  In fact, they are the worst buttons I have ever come across.

But with the button and plastic back removed (way easier than it should be), placed face-down on a silicone mat and filled with hot glue, then a 5mm tri-colour LED pressed into the back of them, they become big diffused indicators with a fetching chrome bezel. 🙂

Great use of otherwise wasted hardware :)

Link to comment
Share on other sites

I am thinking about the board to put everything on...
Leaning towards white opaque 5mm correx boards, which is great to print on (dials etc) and the flows leds can shine/glow through and be nicely diffused without too much extra work. Will need get a sample board to test that theory 1st.
And on the back can maybe add some foam board for sound dampening. The servos should/could then be isolated from the front correx so sound/vibration should be a lot less as the front board will/should have less chance of amplifying the vibrations.

correx.jpg.001369edcbd7d14f1c4ae4aa8d86a185.jpg

Link to comment
Share on other sites

That's pretty much the stuff I used (I called it 'twin-wall extruded PVC shower panel material' earlier).  Mine's maybe a bit thicker walled, with a horrible 'marble' pattern on one side.

I found when testing it (with 5mm LEDs pushed through holes in one side) it bled the light along the direction of the 'tubes', so changing direction of the LEDs by 90° (from horizontal to vertical) just looked a bit messy.

I'm currently messing about with ways to diffuse the LEDs a bit, but still prevent 'bleed' (between the segments of the 'battery', for example - blurring on the 'flows' is fine).

spacer.png

The best result so far is with white PETG 3D printed shapes with 1mm thick walls, filled with hot glue.  I've tried a test with a 10mm cube (or rather, 2 joined together) and a standard 5050 RGB LED:

spacer.png

When the LED is off, it's just opaque white.  For the curvy 'legs' that contain the flowing strips, I was hoping to be able to stick the LED tape on the inside side wall (vertically) to avoid having to kink the tape/PCB, but that leaves one side shadowed by the PCB... so I'll have to wait and see, there.

Don't forget that without the need for (crudely made) gears, you'll likely have much less of an issue with the noise...  You'll just have to wait until tomorrow to find out! 😆

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...