-
Gutting the gauge
11/27/2014 at 15:45 • 0 commentsIt came apart very easily actually. You can tell it was designed to be maintained.
The original coil and resistor:
So without these in, it's time to think about hooking the needle up to a servo motor.
Currently, as this is in the proof of concept stage, I'm going for the cheapest options. I needed a servo that's small enough to fit behind the dial. This is a little tricky as most servos seem to be too large. And at this point, I'm not really sure how I'm going to link it up.
A cruise around eBay and I've ended up with a 'Tower' sub-micro RC servo. I've never done RC before, and apart from a university project a few years ago, I've never used an RC servo in a project.
Time to do some research on how to drive RC servos then!
-
Adventures with Python
11/26/2014 at 15:52 • 0 commentsI'm not a programmer. I can stumble through C and MATLAB, but it's never elegant.
While I could do this in C, from what I've heard about Python and web scraping with Beautiful Soup, it could make this project a bit easier. So I set out to write a simple script to just grab the webpage and display the wind speed on the command line.
So armed with web tutorials on Python and Beautiful Soup, I attempted to grab the webpage.
This turned out to be harder than I thought. Firstly, the site in question www.bramblemet.co.uk displays the windspeed as an image. Not helpful. I did have the thought though that it appears that the site hasn't been updated since the mid 90's. I tried on a whim to see if there was a WAP version of the site. I was rewarded by finding: www.bramblemet.co.uk/wap
However. Firstly, there's a re-direct with a random string generated per session inserted in the URL. Secondly, the information I need is on the second page. Because of the random string inserted in the URL, I can't go straight there. Attempts to do so just redirect to the first page.
So, I need to access the site to get the string in the URL, and then follow the link to page 2. Once I'd got the page, it can be passed into Beautiful Soup and then the pertinent number grabbed.
I'm really pleased I used Python for this, as despite being a complete beginner in the language, even with these redirects and links, within an hour I had a working solution.
Here's my v 0.01 code:
#Grab windspeed from bramble met, display on the command line
#mechanicalsquid 2014from bs4 import BeautifulSoup
import requestsr=requests.get("http://www.bramblemet.co.uk/wap/") #Get the first page
data=r.text
soup=BeautifulSoup(data) #Pass to beautiful soup
link=soup.find('a') #Extract linksp=requests.get(r.url[:-18]+link.get('href')) #Get second page, including random string in URL from page 1
windpage=p.text
soup=BeautifulSoup(windpage) #Pass to beautiful soup
windspeed=int(soup.prettify()[309:315]) #Grab the numbersprint("The current windspeed in the Solent is: "+ str(windspeed)+" Knots")
-
Driving the coil directly
11/26/2014 at 11:08 • 0 commentsA quick trip down to my local hackerspace (SoMakeIt) to strip it and try driving the coil directly.
Turns out, it needs 48VDC directly to the coil to get full deflection on the gauge. It also consumes about 5W. It will of course consume this continuously to maintain the needle deflection.
While it's possible to drive this, it's not a simple solution, and I don't like the idea of chewing through 5W continuously.
I'm going to try stripping out the innards and using a servo motor for movement instead.
-
Driving the gauge
11/26/2014 at 10:10 • 0 commentsSomehow, I need to drive this thing.
Given that it's a 250V gauge, I could drive it with 250V AC and modulate with PWM to vary the needle position.Or, I could drive the coil directly, which will probably get full deflection at a much lower voltage.
First thing then - a strip down.