<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Gauges Archives - Digital Urban</title>
	<atom:link href="https://www.digitalurban.org/blog/category/open-gauges/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.digitalurban.org/blog/category/open-gauges/</link>
	<description>Data, Cities, IoT, Writing, Music and Making Things</description>
	<lastBuildDate>Thu, 06 Nov 2025 15:15:54 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.digitalurban.org/wp-content/uploads/2012/07/Dulogosm-1.png</url>
	<title>Open Gauges Archives - Digital Urban</title>
	<link>https://www.digitalurban.org/blog/category/open-gauges/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Make a Lightsaber Realtime Wind Speed Gauge</title>
		<link>https://www.digitalurban.org/blog/2023/11/09/lightsaber/</link>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Thu, 09 Nov 2023 09:55:58 +0000</pubDate>
				<category><![CDATA[Making]]></category>
		<category><![CDATA[Open Gauges]]></category>
		<guid isPermaLink="false">https://connected-environments.org/?p=7469</guid>

					<description><![CDATA[<p>The post <a href="https://www.digitalurban.org/blog/2023/11/09/lightsaber/">How to Make a Lightsaber Realtime Wind Speed Gauge</a> appeared first on <a href="https://www.digitalurban.org">Digital Urban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
		<div id="fws_6970764bbcaa9"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row top-level"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding inherit_tablet inherit_phone "  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
<div class="wpb_text_column wpb_content_element " >
	<div class="wpb_wrapper">
		<p>Imagine wielding the power of the Force, not to fight Sith Lords, but to display real-time data &#8211; in our case, wind speed, but the code/build can be adapted to any data feed. Using a NeoPixel strip inside a lightsaber tube, we can create a stunning visual representation of wind speeds. In this post, we&#8217;ll look at the build and dive into the code and the concept, helping you turn a lightsaber blade into a unique data meter. The build is part of the ongoing <a href="https://connected-environments.org/portfolio/opengauges/">Open Gauges Project,</a> which provides code and 3D print files to build several open-source data gauges.</p>
<h2><img fetchpriority="high" decoding="async" class="aligncenter size-large wp-image-7479" src="https://connected-environments.org/wp-content/uploads/2023/10/LightSaberTitle-1024x497.jpg" alt="" width="1024" height="497" /></h2>
<h2>Why a Lightsaber?</h2>
<div id="attachment_7490" style="width: 161px" class="wp-caption alignright"><img decoding="async" aria-describedby="caption-attachment-7490" class="size-large wp-image-7490" src="https://connected-environments.org/assets/img/blog/202311-lightsaber/lightsabervertical-151x1024.png" alt="LightSaber Data Tube" width="151" height="1024" /><p id="caption-attachment-7490" class="wp-caption-text">LightSaber Data Tube</p></div>
<p>Aside from it being just plain cool, the lightsaber&#8217;s blade offers a perfect medium for light diffusion. This means that each individual LED&#8217;s light on the NeoPixel strip spreads out, blending smoothly with its neighbours, ensuring that the entire saber glows uniformly. This makes it easier to visualise and read the data as the light is distributed evenly across the length of the lightsaber.</p>
<blockquote>
<h3>Whether you&#8217;re a Star Wars fan, a weather enthusiast, or just someone looking for a cool project, this NeoPixel Lightsaber wind meter offers a fun and educational experience. May the winds be with you!</h3>
</blockquote>
<h2>The Hardware</h2>
<p>The main tube comprises a <a href="https://thesaberarmory.com/collections/neopixels-led-strips/products/1-thin-walled-trans-white-polycarbonate-tube-1-metre">1&#8243; OD Thin Walled Trans White Polycarbonate Blade Tube</a> with a <a href="https://thesaberarmory.com/collections/neopixels-led-strips/products/1-thin-walled-neopixelled-strip-foam-diffuser-1-meter">one-metre-long Foam Diffuser Tube</a> to add to the diffusion level. The diffuser tube is also wrapped in a length of <a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fthesaberarmory.com%2Fproducts%2Fblade-diffusion-film&amp;data=05%7C01%7Cafroditi.tampakopoulou.20%40ucl.ac.uk%7Cfba3e538d32f4d92f29c08dbe08e3eaa%7C1faf88fea9984c5b93c9210a11d9a5c2%7C0%7C0%7C638350673755388695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=1KsUPV7zE60Kibzelrku2%2BOx7uGZvat0BncuSH%2BZasw%3D&amp;reserved=0">Blade Diffusion Film</a>. All of these are sourced from the excellent <a href="https://thesaberarmory.com/">https://thesaberarmory.com/</a> in the UK.</p>
<div id="attachment_7485" style="width: 399px" class="wp-caption alignleft"><img decoding="async" aria-describedby="caption-attachment-7485" class=" wp-image-7485" src="https://connected-environments.org/wp-content/uploads/2023/11/plasma-stick-2040w-3_10228028-64a8-4dad-ade7-07b88aa5cb57_1500x1500_crop_center-e1699438729378-1024x358.webp" alt="Plasma Stick 2040W" width="389" height="136" /><p id="caption-attachment-7485" class="wp-caption-text">Plasma Stick 2040W</p></div>
<p>We put a standard 144 WS2812b Neopixels inside the foam tube<a href="https://www.amazon.co.uk/dp/B01CDTEGGO?psc=1&amp;ref=ppx_yo2ov_dt_b_product_details"> in a one-metre strip</a>. This is subsequently wrapped in the Blade Diffusion Film, which fits inside the Polycarbonate Tube. This is how most lightsabers are made; a strip of Neopixels inside a diffuser to make for smooth fluorescent-like lighting inside the tube. To power it, we use a Pi PicoW. Any Pi Pico will do, but Pimoroni makes one precisely for Neopixels, the <a href="https://shop.pimoroni.com/products/plasma-stick-2040-w?variant=40359072301139">Plasma Stick 2040W PicoW Aboard</a>.</p>

<p>The lightsaber tube is mounted onto a 1.25-metre length of timber using a top and bottom end mount, which are 3D printed; all the 3D printed files are available in the GitHub Repository. The bottom part is a holder for both the Light Saber tube and the PicoW, with a screw on the bottom lid allowing easy access to the wiring.</p>
<div id="attachment_7486" style="width: 1034px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7486" class="size-large wp-image-7486" src="https://connected-environments.org/wp-content/uploads/2023/11/Screenshot-2023-11-03-at-11.11.46-1024x258.png" alt="Lightsaber Data Tube Holder - Fusion 360" width="1024" height="258" /><p id="caption-attachment-7486" class="wp-caption-text">Lightsaber Data Tube Holder &#8211; Fusion 360</p></div>
<p>The following YouTube clip from the Saber Armory provides an excellent guide to assembling the sabre. We use a flexible neopixel strip and, of course, different mounts, but the build is similar:</p>
<p><iframe loading="lazy" title="KR Sabers How To: Make A Lightsaber NeoPixel Blade Using KR &#039;Pixel Stick&#039; PCB 2020" width="1080" height="608" src="https://www.youtube.com/embed/5U_wD-h-i2Q?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>&nbsp;</p>
<h2>The NeoPixels</h2>
<p>NeoPixels are individually addressable RGB LEDs. These are LEDs where you can control the colour and brightness of each individual light diode on the strip. With a long strip of these LEDs inside a lightsaber tube, we can represent wind speeds by lighting up different portions of the strip in varying colours.</p>
<h2>How Do We Represent Wind Speed?</h2>
<p>We divide the range of possible wind speeds into sections. In our code example, these sections are represented by colors:</p>
<ul>
<li>0 to 10: <strong>BLUE</strong> (Low winds)</li>
<li>10 to 20: <strong>GREEN</strong> (Fresh winds)</li>
<li>20 to 30: <strong>YELLOW</strong> (Moderate winds)</li>
<li>30 to 40: <strong>ORANGE</strong> (Strong winds)</li>
<li>Above 40: <strong>RED</strong> (Above Gale Force)</li>
</ul>
<p>As the wind speed increases, more of the strip lights up, moving through the colors as it progresses. Additionally, the highest wind speed measured is indicated with a <strong>RED</strong> pixel, serving as a max wind marker. This resets at midnight and provides an at-a-glance view of the maximum wind gust for the day.</p>
<h2>Let&#8217;s Dive into the Code</h2>
<p>All the files required are available in the GitHub Repository. We have aimed to make it as simple as possible to understand and edit. As such, we break down the code below. If you want to, you can simply copy across all the files from our GitHub to your PiPicoW, edit the config file for your wifi and our example should happily work. However, if you want to know more about the workings &#8211;</p>
<p>The heart of our project is the NeoPixel library and the MQTT protocol to receive wind speed data (we explore this in more depth below). We use MQTT as it allows real-time data to be effectively streamed to the Lightsaber blade. It also means the data can be swapped for other feeds as needs be, such as Air Pressure, Air Quality, Temperature etc &#8211; indeed any numerical data stream you can find. Our MQTT stream is provided by a Davis Vantage Pro 2 via Weewx on a Raspberry Pi which outputs the MQTT stream.</p>
<p>First, we set up the NeoPixel strip:</p>
<div class="bg-black rounded-md">
<div class="flex items-center relative text-gray-200 bg-gray-800 gizmo:dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md">python</div>
</div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">from neopixel import Neopixel 

# Set up NeoPixels numpix = 144 pixels = Neopixel(numpix, 0, 15, "GRB") pixels.brightness(255)</pre>
</div>
<div class="bg-black rounded-md">
<div class="flex items-center relative text-gray-200 bg-gray-800 gizmo:dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md">We have 144 LEDs on our strip. We initialize it and set its brightness to maximum.</div>
</div>
<p>Next, we define our wind speed ranges and corresponding colors &#8211; this can be edited according to the wind speed range you want to use.</p>
<div class="bg-black rounded-md">
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">colors = {
    'BLUE': (0, 0, 255),
    'GREEN': (0, 255, 0),
    ...
}

WIND_SPEED_RANGE = [0, 60]
multiplier = numpix / (WIND_SPEED_RANGE[1] - WIND_SPEED_RANGE[0])


</pre>
</div>
<div>The update_pixels function is the heart of the color-mapping logic. It translates wind speed values into color changes on the NeoPixel strip:</div>
<div class="flex items-center relative text-gray-200 bg-gray-800 gizmo:dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md">
<ul>
<li>A gentle breeze is shown in <strong>blue</strong>, indicative of calm weather.</li>
<li>As the wind picks up, the colors transition to <strong>green</strong>, a universal symbol of &#8216;go&#8217; or safety.</li>
<li>When winds grow stronger, the color shifts to <strong>yellow</strong>, suggesting caution.</li>
<li>Higher wind speeds are shown in <strong>orange</strong>, and finally,</li>
<li>Potentially dangerous wind speeds are indicated with <strong>red</strong>, universally associated with warnings and danger.</li>
</ul>
<p>This gradual change of colors not only represents the data but also provides an intuitive sense of the wind&#8217;s intensity.</p>
<h4>Dynamic Updates</h4>
<p>The script dynamically updates the NeoPixel colors as the wind speed changes. By using a threshold, minor fluctuations are filtered out preventing the display from changing too frequently and thus improving the readability of the data. Only significant changes in wind speed result in a color change, ensuring a clear and comprehensible visual output.</p>
</div>
</div>
<h4>Tracking the Peak Wind Speed</h4>
<p>The script utilizes global variables to keep track of the current maximum wind speed (max_wind) and the previous maximum  (prev_max_wind). The function sub_cb updates these values as new wind speed messages are received via MQTT (we explore MQTT more in the next step):</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">if wind &gt; max_wind:
    max_wind = int(wind)
</pre>
<p>This simple logic ensures that only the highest wind speed is showcased as the maximum.</p>
<h4>Visualizing the Maximum Wind Speed</h4>
<p>The maximum wind speed is visualized distinctly by coloring a specific NeoPixel in red. This is handled in the set_pixel_colour function:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">pixels[max_wind] = colors['RED']  # Update max_wind pixel
</pre>
<p>This code assigns the &#8216;RED&#8217; color from the colors dictionary to the pixel at the index corresponding to the maximum wind speed. This red marker provides an immediate visual indicator of the peak intensity of the wind speed for the current observation period.</p>
<h4>Dynamic Updates and Resets</h4>
<p>As the wind speed changes, the script continuously updates the display. If a new maximum is detected, it changes the appropriate pixel to red, and the previous maximum pixel reverts to its color that corresponds to its wind speed range. This dynamic updating gives real-time feedback about the wind&#8217;s behavior.</p>
<p>Furthermore, the script includes a scheduled reset at midnight:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">if current_time[3] == 0 and current_time[4] == 0:  # Check if hour and minute are both 0
    machine.reset()
</pre>
<div class="bg-black rounded-md">
<div>
<h3>Understanding MQTT in Our NeoPixel Lightsaber</h3>
<p>MQTT, which stands for Message Queuing Telemetry Transport, is a lightweight messaging protocol designed for low-bandwidth, high-latency, or unreliable networks. It&#8217;s become the de facto standard for IoT devices due to its simplicity and effectiveness. In our project, we use MQTT to receive wind speed data which then drives the NeoPixel display.</p>
<h3>How MQTT Works</h3>
<p>At a high level, MQTT operates over a publish/subscribe model:</p>
<ol>
<li><strong>Broker</strong>: A central server that receives messages from publishers (devices or applications that produce data) and routes them to subscribers (devices or applications that consume data). The broker manages active clients and topics.</li>
<li><strong>Topic</strong>: Think of it as a &#8220;channel&#8221; where data is published. Clients can subscribe to topics or publish data to them.</li>
<li><strong>Message</strong>: The data or information sent from the publisher to the subscriber.</li>
</ol>
<h3>Implementing MQTT in our Lightsaber</h3>
<p>In our code, the MQTT protocol is implemented using the excellent mqtt_as <a href="https://github.com/peterhinch/micropython-mqtt/tree/master">library</a>.</p>
<p>Setting up our MQTT client:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">from mqtt_as import MQTTClient, config

# Define configuration
config['subs_cb'] = sub_cb
config['wifi_coro'] = wifi_han
config['connect_coro'] = conn_han
config['clean'] = True

# Set up client
MQTTClient.DEBUG = True  
client = MQTTClient(config)
</pre>
<p>Subscribing to a topic &#8211; our topic provides wind speed data every 3 seconds. You can leave this topic in to test your system works, and then replace it with your own data, or any other data source.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">async def conn_han(client):
    await client.subscribe('personal/ucfnaps/downhamweather/windSpeed_mph', 1)
</pre>
<p>When a message is published to this topic, our sub_cb function is triggered.</p>
<h3>Processing Received Data</h3>
</div>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">def sub_cb(topic, msg, retained):
    ...
    wind_speed = float(msg)
    ...
</pre>
<p>We convert the received message into a number, which represents our wind speed. Depending on the wind speed value, the corresponding section of the NeoPixel strip is illuminated.</p>
</div>
<p>The main logic for setting the color of the pixels based on the wind speed is in the set_pixel_color function. This function checks if the wind speed has increased or decreased since the last measurement and updates the lightsaber&#8217;s glow accordingly.</p>
<p>The full code is below:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">from neopixel import Neopixel
from mqtt_as import MQTTClient, config
from config import wifi_led, blue_led
import uasyncio as asyncio
import machine
import ntptime
import time

# Set up NeoPixels
numpix = 144
pixels = Neopixel(numpix, 0, 15, "GRB")

colors = {
    'BLUE': (0, 0, 255),
    'GREEN': (0, 255, 0),
    'YELLOW': (255, 100, 0),
    'ORANGE': (255, 50, 0),
    'RED': (255, 0, 0),
    'OFF': (0, 0, 0)
}

pixels.brightness(255)
prev_wind = 0
prev_max_wind = 0
max_wind = 0  # Initialize max_wind

WIND_SPEED_RANGE = [0, 60] #actual is half this amount to allow the max wind marker virtually
multiplier = numpix / (WIND_SPEED_RANGE[1] - WIND_SPEED_RANGE[0])

UPDATE_THRESHOLD = 2  # Only update if wind speed changes by 2 or more

def set_pixel_color(wind, max_wind):
    global prev_wind
    
    if abs(wind - prev_wind) &lt; UPDATE_THRESHOLD:
        return

    while prev_wind &lt; wind:
        update_pixels(prev_wind)
        time.sleep(0.05)
        prev_wind += 1

    while prev_wind &gt; wind:
        update_pixels(prev_wind)
        time.sleep(0.05)
        prev_wind -= 1

    pixels[max_wind] = colors['RED']  # Update max_wind pixel

    pixels.show()


def update_pixels(wind_value):
    for i in range(1, numpix):
        if i &lt;= wind_value &lt; numpix:
            if i &lt;= 20:
                color = colors['BLUE']
            elif i &lt;= 40:
                color = colors['GREEN']
            elif i &lt;= 80:
                color = colors['YELLOW']
            elif i &lt;= 100:
                color = colors['ORANGE']
            else:
                color = colors['RED']
            pixels[i] = color
        elif i == max_wind:  # Use max_wind directly
            pixels[i] = colors['RED']
        else:
            pixels[i] = colors['OFF']
    pixels.show()

def sub_cb(topic, msg, retained):
    global max_wind, prev_max_wind

    print(f'Topic: "{topic.decode()}" Message: "{msg.decode()}" Retained: {retained}')
    wind_speed = int(msg)

    if WIND_SPEED_RANGE[0] &lt;= wind_speed &lt;= WIND_SPEED_RANGE[1]:
        wind = (wind_speed - WIND_SPEED_RANGE[0]) * multiplier

        if wind &gt; max_wind:
            max_wind = int(wind)

        if max_wind != prev_max_wind:  # Check if max_wind has changed
            print("Max Wind", max_wind)
            prev_max_wind = max_wind

        set_pixel_color(wind, max_wind)
    else:
        for i in range(numpix):
            pixels[i] = colors['OFF']
        pixels.show()


async def get_current_minute():
    try:
        ntptime.settime()  
        current_time = time.localtime()
        return current_time[4]  
    except:
        print("Could not get the time from the internet")
        return None

#Reset Wind Max and System at Midnight
async def reset_on_hour(): 
    while True:
        try:
            ntptime.settime()  # Get the current time from the internet
            current_time = time.localtime()
            if current_time[3] == 0 and current_time[4] == 0:  # Check if hour and minute are both 0
                machine.reset()
            else:
                await asyncio.sleep(60 - current_time[5])
        except:
            print("Could not get the time from the internet")
            await asyncio.sleep(60)  # Retry after 1 minute if time sync fails


async def heartbeat():
    s = True
    while True:
        await asyncio.sleep_ms(500)
        blue_led(s)
        s = not s

async def wifi_han(state):
    wifi_led(not state)
    print('Wifi is ', 'up' if state else 'down')
    await asyncio.sleep(1)
    if state:
        asyncio.create_task(reset_on_hour())  # Start reset_on_hour task after WiFi is connected

async def conn_han(client):
     # await client.subscribe('personal/ucfnaps/saber/config/', 1)
       await client.subscribe('personal/ucfnaps/downhamweather/windSpeed_mph', 1)

async def main(client):
    try:
        await client.connect()  # Ensure WiFi and MQTT connection before starting other tasks
    except OSError:
        print('Connection failed.')
        return
    
    n = 0
    while True:
        await asyncio.sleep(5)
        n += 1

# Define configuration
config['subs_cb'] = sub_cb
config['wifi_coro'] = wifi_han
config['connect_coro'] = conn_han
config['clean'] = True

# Set up client
MQTTClient.DEBUG = True  
client = MQTTClient(config)

asyncio.create_task(heartbeat())

try:
    asyncio.run(main(client))
finally:
    client.close()  
    asyncio.new_event_loop()

</pre>
<h2>Bringing it All Together</h2>
<p>We also provide two wall mounts which screw onto the back of the backing wood. This provides spacing so the Lightsaber Wind Gauge has a space off the wall as well as a hook for a standard nail or screw. The wood was dyed with Dark Oak wood stain and the wind speed indicators (text and numbers) were glued at the corresponding lengths along the lightsaber blade.</p>
<div id="attachment_7509" style="width: 1034px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7509" class="size-large wp-image-7509" src="https://connected-environments.org/wp-content/uploads/2023/11/WindNeoPixelLightSaberTube_2023-Nov-08_03-20-52PM-000_CustomizedView14012120140-1024x168.png" alt="LightSaber Data Tube - Fusion360" width="1024" height="168" /><p id="caption-attachment-7509" class="wp-caption-text">LightSaber Data Tube &#8211; Fusion360</p></div>
<p>To effectively space the numbers/text we changed the MQTT feed away from the realtime feed to a feed we can send data to (/saber/config). This allowed us to send the value from 5 to 60 and light up the tube, allowing us to visually see where the text/numbers are glued.</p>
<p>That completes the build, with the combination of the NeoPixel strip, MQTT for data transmission, and the aesthetic appeal of a lightsaber. We hope you agree that it makes for a unique and visually pleasing method to measure and display wind speed.</p>
	</div>
</div>




			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a href="https://www.digitalurban.org/blog/2023/11/09/lightsaber/">How to Make a Lightsaber Realtime Wind Speed Gauge</a> appeared first on <a href="https://www.digitalurban.org">Digital Urban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Open Weather Map NeoPixel Barometer &#8211; Open Gauges</title>
		<link>https://www.digitalurban.org/blog/2022/05/31/owmbarometer/</link>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Tue, 31 May 2022 12:53:33 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Making]]></category>
		<category><![CDATA[Open Gauges]]></category>
		<guid isPermaLink="false">https://connected-environments.org/?p=6532</guid>

					<description><![CDATA[<p>The post <a href="https://www.digitalurban.org/blog/2022/05/31/owmbarometer/">Open Weather Map NeoPixel Barometer &#8211; Open Gauges</a> appeared first on <a href="https://www.digitalurban.org">Digital Urban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
		<div id="fws_6970764bc0fb3"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding inherit_tablet inherit_phone "  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
<div class="wpb_text_column wpb_content_element " >
	<div class="wpb_wrapper">
		<div id="attachment_6540" style="width: 89px" class="wp-caption alignright"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6540" class="wp-image-6540 size-large" src="https://connected-environments.org/wp-content/uploads/2022/05/Owmbaroplain-79x1024.png" alt="Open Weather Map Barometer" width="79" height="1024" /><p id="caption-attachment-6540" class="wp-caption-text">Open Weather Map Barometer</p></div>
<p>The <a href="https://connected-environments.org/portfolio/6172/">Open Gauges project</a> aims to allow open-source data gauges to be built, modified, and viewed as both physical (3d printed) and digital gauges. Depending on the user’s preference the models can be made to run from any online data source with a data feed &#8211; from Weather Data with Air Pressure, Temperature, Wind Speed etc though to Air Quality Gauges, Noise Meters, Energy etc.</p>
<p>Part of the initial release, from the <a href="https://connected-environments.org/people/">Connected Environments Team</a> at <a href="https://www.ucl.ac.uk/bartlett/casa">The Bartlett Centre for Advanced Spatial Analysis</a>, <a href="https://www.ucl.ac.uk/">University College London</a>, and alongside the more traditional &#8216;dial style&#8217; gauges, is our new <em><strong>Neopixel Barometer, updated for Open Weather Map. </strong></em>Back in October we published the Weather Flow version, this new, open source version is specifically designed to use the free Open Weather Map API, making it easier to use.</p>
<p>Designed to be as simple as possible it is powered by a Raspberry Pi and uses the data feed from the Open Weather Map Single Call API, making it open to anyone with data available world world, according to your choice of location. So you could chose to display local Barometric Pressure or have a series of them on display showing locations around the world. Each gauges updates every 5 minutes with a Green Pixel to note successful data collection and Red for unsuccessful</p>
<p>Full code and files can be found in the <a href="https://github.com/ucl-casa-ce/Open-Gauges/tree/main/Contributed/OpenWeatherMapNeoPixelBarometer">Open Gauges Github Repository.</a></p>
<h3>Data Source</h3>
<p>The barometer uses the One Call API from Open Weather Map, provided as JSON.</p>
<h3><a id="user-content-data-displayed" class="anchor" href="https://github.com/ucl-casa-ce/Open-Gauges/tree/main/Contributed/NeoPixelBarometer#data-displayed" aria-hidden="true"></a>Data displayed</h3>
<p>The Neopixel Barometer displays current sea level air pressure (Mb) and the current pressure trend &#8211; Rising, Steady, Falling.</p>
<p>The data updates every five minutes with a sweep of blue/yellow neopixels on power up. The pressure trend is calculated in the Python script, as its not part of the API. As such it takes 3 hours to calibrate &#8211; with &#8216;Rising&#8217; shown initially and then changing to the current trend after 3 hours of data has been downloaded.</p>
<h3><a id="user-content-3d-printed-model" class="anchor" href="https://github.com/ucl-casa-ce/Open-Gauges/tree/main/Contributed/NeoPixelBarometer#3d-printed-model" aria-hidden="true"></a>3D printed model</h3>
<p>The main barometer markers &#8211; ie STORM, FAIR, CHANGE, as well as the numbers &#8211; 950, 960 etc are provided as separate .stl files to 3D print. This is to allow easy alignment with the Neopixel strip with the correct pixel.</p>
<p>The conditions come in a single section, again to be aligned once the Neopixel strip is mounted, the Trend titles are also provided. We also provide the end caps for the Acrylic Tube (optional, see below).</p>
<h3><a id="user-content-wood" class="anchor" href="https://github.com/ucl-casa-ce/Open-Gauges/tree/main/Contributed/NeoPixelBarometer#wood" aria-hidden="true"></a>Wood</h3>
<p>The Neopixel strip is can be mounted either onto a thin strip of wood approx 125 centimetres long by 4.5 cm wide using the fixings that come with the Neopixel Strip, or with a wider block. The Text/Numbers are 3D printed and glued on the wood. It is a standard wood strip that most DIY/Hardware stores stock. The use of wood/mounting is to allow flexibility &#8211; ie mount it however you like.</p>
<blockquote><p>
As an update to this post (June 22nd, 2022) we now include mounting &#8216;Feet&#8217; for a table top horizontal display &#8211; as illustrated below, angled at 30 degrees to provide a clear viewing angle of the air pressue.
</p></blockquote>
	</div>
</div>



<div class="img-with-aniamtion-wrap  custom-size" data-max-width="100%" data-max-width-mobile="default" data-shadow="none" data-animation="fade-in" >
      <div class="inner">
        <div class="hover-wrap"> 
          <div class="hover-wrap-inner">
            <img loading="lazy" decoding="async" class="img-with-animation skip-lazy " data-delay="0" height="446" width="1024" data-animation="fade-in" src="https://www.digitalurban.org/wp-content/uploads/2022/05/5fdffb70-fb04-4b13-b76d-882c537abd21-1024x446.png" alt="Digital Barometer Angled Stand" srcset="https://www.digitalurban.org/wp-content/uploads/2022/05/5fdffb70-fb04-4b13-b76d-882c537abd21-1024x446.png 1024w, https://www.digitalurban.org/wp-content/uploads/2022/05/5fdffb70-fb04-4b13-b76d-882c537abd21-300x131.png 300w, https://www.digitalurban.org/wp-content/uploads/2022/05/5fdffb70-fb04-4b13-b76d-882c537abd21-768x334.png 768w, https://www.digitalurban.org/wp-content/uploads/2022/05/5fdffb70-fb04-4b13-b76d-882c537abd21.png 1512w" sizes="auto, (max-width: 1024px) 100vw, 1024px" />
          </div>
        </div>
      </div>
    </div>
<div class="wpb_text_column wpb_content_element " >
	<div class="wpb_wrapper">
		<h3><strong>Acrylic Tube</strong></h3>
<p>For this updated version we adapted the model to allow the additional use of an 1m x 28mm Acrylic Tube, widely available it allows the LED strip to be mounted into the tube (we used a piece of conduit to straighten the led strip). This give the barometer a more &#8216;finished look&#8217; and provides more of a nod towards the mercury barometers of old.</p>
<h3><a id="user-content-hardware" class="anchor" href="https://github.com/ucl-casa-ce/Open-Gauges/tree/main/Contributed/NeoPixelBarometer#hardware" aria-hidden="true"></a>Hardware</h3>
<p>The hardware has been selected to be as low cost as possible &#8211;</p>
<ul>
<li>A Raspberry Pi &#8211; We used the Raspberry Pi Zero W</li>
<li>1 Meter 144 Addressable Neopixel Strip (NeoPixel/WS2812/SK6812 compatible) &#8211; <a href="https://thepihut.com/products/flexible-rgb-led-strip-neopixel-ws2812-sk6812-compatible-144-led-meter" rel="nofollow">Example here from The PiHut</a></li>
</ul>
	</div>
</div>




			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_6970764bc4cf4"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding inherit_tablet inherit_phone "  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
	<div class="wpb_raw_code wpb_content_element wpb_raw_html" >
		<div class="wpb_wrapper">
			<div class="sketchfab-embed-wrapper"> <iframe loading="lazy" title="Open Weather Map Neopixel Barometer" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" allow="autoplay; fullscreen; xr-spatial-tracking" xr-spatial-tracking execution-while-out-of-viewport execution-while-not-rendered web-share width="1200" height="480" src="https://sketchfab.com/models/e189b0e0d35f4c008e86936d1515c600/embed?autostart=1&camera=0&transparent=1"> </iframe> <p style="font-size: 13px; font-weight: normal; margin: 5px; color: #4A4A4A;"> <a href="https://sketchfab.com/3d-models/open-weather-map-neopixel-barometer-e189b0e0d35f4c008e86936d1515c600?utm_medium=embed&utm_campaign=share-popup&utm_content=e189b0e0d35f4c008e86936d1515c600" target="_blank" style="font-weight: bold; color: #1CAAD9;"> Open Weather Map Neopixel Barometer </a> by <a href="https://sketchfab.com/digitalurban?utm_medium=embed&utm_campaign=share-popup&utm_content=e189b0e0d35f4c008e86936d1515c600" target="_blank" style="font-weight: bold; color: #1CAAD9;"> digitalurban </a> on <a href="https://sketchfab.com?utm_medium=embed&utm_campaign=share-popup&utm_content=e189b0e0d35f4c008e86936d1515c600" target="_blank" style="font-weight: bold; color: #1CAAD9;">Sketchfab</a></p></div>
		</div>
	</div>

			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_6970764bc614f"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding inherit_tablet inherit_phone "  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
<div class="wpb_text_column wpb_content_element " >
	<div class="wpb_wrapper">
		<p>It is made to be mounted either vertically or horizontally &#8211; the 3D model above details the make (click and drag to examine the model/zoom in). The tabletop version with <a href="https://skfb.ly/ovCDN">30-degree angled legs can now be viewed directly on Sketchfab</a>.</p>
<h3>Code and library</h3>
<p>The full code/3d printing files etc are provided on the <a href="https://github.com/ucl-casa-ce/Open-Gauges/tree/main/Contributed/NeoPixelBarometer">Github page</a>, which also includes the other Open Gauges to 3D print and make.</p>
<p><strong>Libraries used</strong></p>
<ul>
<li>requests</li>
<li>json</li>
<li>time</li>
<li>neopixel</li>
<li>board</li>
</ul>
<h2 dir="auto">Digital model</h2>
<p dir="auto">The model is also provided in Fusion 360 for any edits to wording, sizing etc (note the Pi is not included due to separate licensing).</p>
	</div>
</div>




			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a href="https://www.digitalurban.org/blog/2022/05/31/owmbarometer/">Open Weather Map NeoPixel Barometer &#8211; Open Gauges</a> appeared first on <a href="https://www.digitalurban.org">Digital Urban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
