Build a UV Level Monitoring Budgie - Using IoT and Weather Data APIs
by Hey Jude in Circuits > Arduino
11977 Views, 100 Favorites, 0 Comments
Build a UV Level Monitoring Budgie - Using IoT and Weather Data APIs
Meet Sonny the UV Budgie - an automata IoT bird who looks up online weather data from the Met Office API and announces the UV index for the day and the week ahead (in doing so, he flaps his wings automaton-style!).
The image of the display shows actual data in the UK heatwave where burn times were 20mins max. The Budgie warns the user of what the midday sun or 'Peak UV' will be (i.e. what's the most protection you need if leaving the house in the morning - when the UV might initially be low, but could get seriously high at noon!), and serves as a reminder that, for example, sun protection is still relevant on a cloudy day.
The UV Budgie was developed as a way to engage kids in becoming more aware of the importance of being ‘sun-safe’ by 'listening to Sonny's advice'. For the parents, it also gives more technical detail, like how long to stay out in the sun on a given day, as well as the days ahead.
The settings can be configured as you wish, as the entire project (Code and Build) is entirely open source. The project has been designed such that you may even wish to reconfigure the IoT device to look up other APIs such as Forest Fires, Air Pollution, or Flood Alerts. As the code is open-source, the device can be re-configured to suit the users’ skin tone, i.e. sun sensitivity.
Hopefully this is a great primer for kids (and big kids) to learn about 3D printing, IoT, mechanical design, and online data. Indeed, the wealth of data this generation now has access to (freely!) is extraordinary, and no doubt more projects like this will be 'plug n play' for the generations to come.
What would you do with a 3D Printer, some IoT protocols and a world of APIs/Data-Sources??
~ ~ ~
ICYMI: The hardware build is actually a 'Daughter' of the 'Mother' - The Good Air Canary - a project created for DesignSpark community of engineers and makers. (LINK). The software is of course entirely new, and full credit and much thanks to Pete Milne for his help on bringing it to life. Lastly, my 6 year old son provides 'lead vocals' of Sonny the UV budgie.
What would you do with a 3D Printer, some IoT protocols and a world of APIs/Data-Sources??
ICYMI: The hardware build is actually a 'Daughter' of the 'Mother' - The Good Air Canary - a project created for DesignSpark community of engineers and makers. (LINK). The software is of course entirely new, and full credit and much thanks to Pete Milne for his help on bringing it to life. Lastly, my 6 year old son provides 'lead vocals' of Sonny.
Supplies
As mentioned, the hardware is essentially the same as the Canary, but has some small upgrades (such as a Demo button), making it easy for kids to press at home... or indeed, if in a public space like a school - this might be a nice interactive project for education!
The intent of this project is that it uses readily available microcontrollers (Arduino for IoT, Adafruit for Audio and Servo control), and 3D printing held together with affordable fixtures. It can be hand soldered using generic 'protoboard'. The only 'exotic' part is really the e-Ink Display, which at the time of creation was common in industry, but less so in the maker community. I'm rather fascinated by it's potential to be low-power, as the 'ink' remains even when no electricity is passed through it, making if perfect for slow-changing screens, as well as having a 'calmness' not using light, as I find illuminated screens a bit glaring at night if in the same room as you sleep.
3D Printing:
- 3D Printer (or able to print files via LINK below).
- White PLA Filament (832-0223)
- (+ 1 Alternative Colour, e.g. Yellow (832-0232)
- Printer Nozzles of 0.6mm, though 0.4mm will also be fine.
Fixtures & Fittings:
- Brass Inserts - 1x 100 pack (027-8534)
- Hex M3 x 6mm Screws - 1x 50 pack (028-0981)
- CSK M3 x 6mm Screws - 1x 50 pack (304-4788)
- 4mm (dia) x 1mm (thick) Magnets (LINK)
Electronic Components:
- Servo 9g (215-3180)
- 2.9” Waveshare B/W eINK Screen (LINK)
- 5V Linear Voltage Regulator (168-6612)
- 1N4001 Diode, 1A, 5V (628-8931)
- 330nF Multilayer Ceramic Capacitor (801-5390)
- 100nF Multilayer Ceramic Capacitor (538-1203)
- DC Power Adaptor 9V, 1A (121-7145)
- DC Power Socket (048-7832)
- 3x Momentary Buttons 4.9mm (479-1485)
- Toggle Switch (734-7066)
- 3W Speaker (LINK1)(LINK2)
SBCs/Boards:
- Arduino Nano 33 IoT (192-7589)
- Adafruit 16-Channel 12-bit PWM/Servo Driver (LINK)
- Adafruit Audio FX Sound Board + 2x2W Amp (LINK)
- 70x90mm Double Sided Protoboard (LINK)
- 20x44mm Double Sided Protoboard (Likely as part of any set/stock of the above)
Consumables:
- Wire for PCB Wiring-up.
- SuperGlue (1x3g tube will be ample).
- Sellotape / Masking Tape.
- Cocktail Sticks.
- Sandpaper (suggested 400, 600, 1000 grit)
Generic Tools:
- Soldering Iron, Soder, etc.
- Mini Hand Files - Flat, Round, Square (for metal, and plastic filing).
- Mini Blowtorch (or soldering iron) - to insert Brass Inserts.
- Hex 2.5mm Key / Driver (for Screws).
- Scalpel / Craft Knife.
- Calipers.
- Hot Melt Glue Gun.
- Drill/Handdrill with 1.5mm, 3.0mm, 3.5mm, 4.0mm drill bits.
GitHub:
- GitHub Repo: https://github.com/milnepe/uv-budgie-controller
- Download all files.
Timelapse Video Overview of the Build
If you want to get a feel for what the build will entail - check out this video! I think this can be built in a weekend or two for someone familiar with 3D printing and basic workshop skills. (Pete Milne, who did the code for this, made his from this video, so it can be done!). Safe to say, the PCB work does not lend itself to time-lapse, so that you will need to build from the circuit digram and/or the guide below.
White 3D Printed Parts
These parts are can be thought of as the 'base' colours, with the 'alt' colours below to give contrast. Safe to say you can print them any way you like, but this grouping gives you the default setup.
I recommend printing them on a 0.6mm nozzle or ideally 0.4mm if you can spare the time (at standard layer height).
I personally have an Ender 3 printer, and this has a bed of 235x235mm, and I was able to print these in 2 builds.
Take a little note of the build orientation in the photos. As a general rule 'visible faces' and cylindrical forms are face down.
Downloads
Blue/Yellow/Alt-Coloured Parts
I recommend printing these parts after purging the nozzle first with some of the coloured filament. Given that the first layer will be the most 'contaminated' - and will also be the 'visual face' for many of the parts, I would take time to really ensure it is clean.
Indeed, parts I would consider doing first to be certain are the 'Base Strip' and 'Wire Restraint' as these are internal pieces and not especially visually critical.
Blow-Torching to Finish Plastic Parts
Once you've printed the parts, clean off any defects, and sand/cut off any imperfections.
I also use a Blow-Torch to quickly 'singe' any of the cobweb like wisps of filament that are left from printing. Take care not to linger (or you'll burn it) and of course keep your fingers clear.
Remove Build Support
The parts have been designed to need almost no build support, and at a push could be printed without any. However, if you do leave this option on (for slightly better curves), be sure to remove the supports as shown (examples) - especially in the holes for brass inserts.
Drilling / Reaming to Size
The holes in the various parts will print just slightly smaller than they need to be, e.g. a 4mm hole for a brass insert, will likely be around 3.8-3.9mm when printed. This is deliberate, as it is better to have excess material and finish to 'fit'.
Although not an exhaustive list, if you look at the images, you'll see they follow increasing size. I suggest you begin small, that way you'll not accidentally over-size anything:
Yellow - 1.5mm (Used only for the screws of the Servo Motor).
Red - 3.0mm (Used for many of the hones M3 bolts will pass through with high tolerance).
Blue - 3.5mm (Used for any holes M3 bolts pass through, but which benefit from a little slack or wiggle-room).
Black - 4.0mm (Any holes which have a M3 Brass Insert to be fitted later).
Start drilling slowly, if the piece 'bites'/'jams', try to reverse and try again (perhaps start with a smaller bit).
Finishing Touches
If you have a set of Needle Files, use them to 'true-up' the edges of the pieces as shown, and make the Shadow Gaps more clearly defined, if you like. Clear out any square holes as shown also.
If you do not have such files, you can get pretty far by super-gluing some sand paper onto a accordingly sized piece of wood.
The countersunk screws in the base plate will benefit from having a countersink tool clear out any swarf / smooth off. But if you do not have this, you can use a larger drill bit (like a 9-10mm), even if it is not technically 45degrees it'll help you set the screws in place so they are flush. Often 'DIY box sets' include a 'CSK' drill bit.
If you have the patience, you should also file out the holes slightly of the speaker grill with a round file.
Threaded Brass Inserts
If you've seen any of my other 3D printed projects, you'll know I'm a bit obsessed with Brass Inserts. I picked up the technique when I worked at Dyson, as it is a create way to avoid stripping threads in plastic parts when dis/re-assembling things again and again when testing. I have continued this in my own projects since as it is a great way to develop prototypes, as it allows easy upgrades of localised parts, without needing to rebuild everything. Glue is fine, but it can mean you have to throw everything out unnecessarily.
I did a short video on this here, from a project where I made a Solder Feeder, but you can likely see from the images you are heating up the Insert, and letting it melt its way into the plastic. You can do this with a soldering iron or blowtorch.
As a reminder - if you pre-drill with a 4mm bit, you will have less excess plastic 'splurge; out the edges.
Circuit Diagram
Here's One I Made Earlier
So, all being well this is what you should end up with.
If you are a seasoned Maker / EE, you probably can skip the next bit, but if like me, you prefer a bit of guidance, I've added some steps of how I built up the board....
If you're a more pro maker, you may even want to send off for your own PCB - the gerber files are on the GitHub and are pretty straightforward.
Tools & Components
These are listed up in 'Supplies' at the start of this guide. With the exception of BluTack - which is super handy! Get some!!
Add Header Pins / Connectors
The Female Header Connectors can be scored with a knife, and simply 'snapped' by hand. Be sure to cut in the middle of a terminal (after the number you need, e.g. if you need 6 - but the 7th), as this is the weakest point.
Use BluTack to hold in place whilst you solder the Socket's pins in place.
The two boards in the first image - Arduino Nano and the Adafruit Audio FX boards are pretty straightforward. Leave to one side. The Servo Board, however, is a little more involved!
(The main reason I put these boards on header pins is that if you made a mistake, you'd have to solder some 50+ pins, and that is never fun! So better to have them removable).
Servo Board Hack (Optional - But Recommended)
This is basically a bit of a 'hack' to make a 'slide in' header-pin connector. You can actually just solder this in, without doing this step, as unlike the 28/30-odd pins of the other two boards, you can always desolder 6 pins relatively easily!
If you fancy a go at this, it's quite satisfying when it works. Take note of the board orientation!
Steps as follows:
- remove plastic spacer with pliers.
- push a female socket onto pins.
- bend the pins whilst in the socket.
- bend the terminals of the socket also.
- trim pins on the *other* side.
- check fit, so they poke through a shown.
- check alignment of the female socket's pins, and the male pins as shown - in relation to the protoboard's holes.
- with that position held firmly, keep in place with some BluTack or putty.
- solder (sorry - this image is missing, but you get the idea!)
- remove board.
You are now able to remove the Servo PCB, should you need to!
Boards Assemble!
A small tweak is advisable with the Audio Out Pins, simply bend them up and slightly angled as shown.
Then, with the female (socket) headers added, you can insert the 3 boards as shown.
Pin-Outs (Screen and Buttons)
These are 'straight' header pins, but I suggest bending them at 45-35 degrees from the board, as shown. Do this carefully as shown, and solder in place (use Blutack if you need it).
Linear (Voltage) Regulator
I recommend positioning the Linear Regulator first, and then soldering wires and tracks subsequently.
The Linear Regulator reduced input voltage to 5V. It is recommended to be at 9V (but not lower). Test your input on the circuit and the output also. This might sound obvious, but good to have this 'checked' before you add any expensive PCBs to it!
You can also solder the heatsink (big metal tab) down also, though I have not noticed much heat on mine.
Attach wires to Power Socket and Toggle Switch as shown.
Wiring: Audio Board Circuit
Add wires as shown. Take note that you need to connect the Ground to the 'UG' pin also.
(I actually overlooked this, and it does in fact matter!).
Wiring: Servo Board Circuit
Add wires as shown. Note - this is a good example of running the wires behind, to ensure space is left for the Servo Board to slide in place.
Wiring: Arduino Board Circuit + Button Out Pins
To begin, add the resistors as shown, and the header pins (out) for the Buttons.
Add sequentially the wires as shown. The colours are not 'accurate' and are just for easy contrast, with the exception of Red for + and Black for -/GND.
I recommend testing with multimeter again, before adding boards and powering up.
Breakout PCB for Buttons
The first picture shows the 'destination' of what you're going for.
To begin, check the fit of the buttons, and remove any material with a file as needed.
Place Buttons as shown on a small piece of protoboard. You may need to trim this in size, using a saw or file, as shown, and add the bolt-slots. Solder buttons in place a shown, before adding the wires/circuit in red and black wires.
Check with the final layout of the PCB, (perhaps check with multimeter also), and then screw into place.
Upload Code
You can now 'flash' the code on the Arduino Nano, and upload the Sound Files to the Adafruit FX boards.*
The files and instructions are over on GitHub: (Link).
Do take note of updating all drivers and libraries!
Now that you have checked the code is all working, you are ready to integrate into the rest of the build.
*Note: You need to disconnect the Sound FX Board from the PCB 'motherboard' you made when uploading, (otherwise it will not mount). The Arduino 'does not mind either way', but I would advise doing it to avoid any mishaps.
Adding the Servo Motor
Screw in the 'self-tapping' screws that usually come with the Servo, as shown.
Then flip over to screw in the 'horn' as shown. It need not be tight, as you will take it off later, more to avoid misplacing it!
Test Fitting
I found that it's worth fitting the PCB for the buttons, and the 'top' of the assembly (white) shown, as if these parts need any adjustment (sanding down etc.) it's best to do it now.
Core Assembly X Screen
The (white) core assembly can now be screwed together, and then screwed together with the two M3 bolts as shown.
Just as with the step above, it's worth checking alignment and filing back anything that needs a small adjustment: Both parts should be flush at the base. Ensure this is right now (takes 5mins max) to avoid fiddly reworking later.
Screen
Slide the Screen into position, as shown. Lay it over the Screen Support, and screw it into the same boss that holds the PCB in place. (Again, check the buttons work nicely). I’ve shown the Speaker Wall in place here - just to show you how the screws go, (with the speaker out of the way for clarity), but of course, fit it with the speaker as shown.
Speaker
It is recommended that you shorten the length of the wires from the speaker - as this reduces the resistance, and gives a better sound. Do this as shown at a length of around 15cm. Although I found that my speaker ‘friction fits’ onto the studs if you want to you can add a tiny bit of hot-melt to hold in place. (In industry they often use what is called a ‘heat stake’ - which would melt the protruding yellow studs down over the speaker - like a rivet, but although you can do this, it’s a bit permanent for my liking!).
PCB Installation
Install the PCB ‘Motherboard’ as shown. Take care not to over-tighten the PCB into place. Screw in the Cable Restraint as shown (unscrew the screws, then add back in place).
Power Circuit
Wire up your Switch and Socket as shown.
End Plate
Add the yellow Right Wall as shown. There is one annoyingly hard-to-access screw (middle image) that requires some fiddly manoeuvring of the ball-nose Hex Key to get into place. In all honesty, the assembly will cope without it, but it can be done with patience.
Plug in Cables
Plug in the Servo Lead as shown. Take care to observe orientation. Likewise part close attention to the wires of the eINK Display. Attach the Speaker Cables as shown.
Prepare Discs
Unscrew the Horn from the Servo. Drill / File the discs to fit.
Fit Horn to Disc
Take the Horn and press firmly into the Housing. You may need to file down the hole - but it is designed to be a snug fit, not loose, as this keeps it centred. Add Brass Inserts if you have not already done so.
Fine Tuning Mechanism
This is a useful part as it allows you to fine-tune the angle of the wheels without needing to dismantle everything. Install at ‘full lock’ in one direction, and then install the full extent of the Servo in the full extent of its rotation. Screw the Horn Screw back into the Servo as shown.
Assemble Calibration Disc
Install the 3-hole Calibration Disc as shown. Slide in the Axel - and screw into place.
This is quite hard to explain in words, but the point of this Calibration Disc is to be able to move around in vertical and horizontal directions - this to take up any build/3D print errors over the length of the axel, and so you can get it perfectly straight from the servo-side to the other side. This will become more obvious when you start seeing the wings of the canary move, but I’ll be honest it’s more of the Engineering Nerds to get it ‘just so’ and I’m sure the Budgie will work pretty well without it! But if you’re reading this far, you probably are that person - so enjoy the calibration!
The Budgie (or Canary)
As you may have gathered by coming this far in the build (and if you’ve seen RadioGlobe) - I have a quirk of wanting to hide all screws as much as possible - with the exception of ‘user serviceable/adjustable’ screws. As all 3D Printers differ slightly and accounting for differences in human building skills, the Budgie and Automata Mechanism are exactly the sorts of things that you will need to tweak and get working ‘just right’. For those of your who are not looking to just complete a jigsaw or ‘paint-by-numbers’ style project, this is where it gets fun: Each of these elements allows you to interchange the aesthetics (you can switch out the wings, print colours, adjust movements in code), and give the project your own flourish. Perhaps you might even put an entirely different Automata creation on top of the IoT base unit.
So please consider the following steps the ‘default’ - and enjoy making them your own.
Centre Hole for Pivot (Foot X Perch)
Drill out the centre-hole of the Budgie Foot, and carefully remove the build support. Lastly, insert the Brass Insert as shown. (This later becomes a 'tilt adjust' to lean the bird forwards/backward to your taste).
Connect Feet to Body
Take some 1.0mm Stainless Steel Wire (or Large Paperclip Wire will do fine also), straighten out, and cut two short lengths around 30mm long, and superglue one side into each hole as shown. If you need to clean out the holes with a 1.0mm drill bit (shown in a Pin Vice) I recommend doing this, as it means you can fit it with less effort. Once you have everything set up, you can then trim the wires and fit them into the body of the Budgie.
Add Beak, Eyes and Breast (White)
With the feet added, you can now add the Beak, Breast and Eyes as shown. I strongly suggest checking the fit first, and using a scalpel and file to get the fit just right, as these are some of the most visible parts of the build - so are worth getting right.
Wing Pivots
The 13mm Wing Pings are a deliberately tight fit into the Budgie Body. This is because they are prone to effort if free to move. Firmly press them in (against a clean surface/object), and use the back of a set of Callipers to check they are protruding equal distances at all 4 points. Once you have this, using a minimal amount of Super Glue, fix it in place.
Prepare Wings to Flap
Using a 1.0mm drill bit drill through the holes as shown, and ‘wiggle around’ to make the holes slightly larger than the drill bit, so it runs smooth. Next (like the Feet) but 2x 30mm sections of straight wire. If it’s not straight, use pliers to ensure it’s as straight as you can get it. File the tips, and insert as shown.
Add Wing Magnets
File off any defects in the smallest holes of the wing’s 7 holes. Insert one of the Magnets 4mm (dia) x 1mm (thick) magnets into the top level of the hole shown. Then *flip* the stack of magnets over (to reverse the polarity), and insert the second in the corresponding mirror location. (The wings should now ‘attract’ each other.
Glue in Place
The magnets should stay in place with friction (i.e. tight fit)... if not, add a tiny bit of Hot Melt as shown. (Hot melt still allows you to move the magnets if you wish later). Take care not to burn yourself, but a pro tip is to use saliva-on-your-finger to press the bead of glue down to smooth out and fill any gaps. Do not do this with large volumes of glue, as this only works if the thermal mass of the glue is tiny, relative to the saliva on your finger. (Or wear lab gloves if you have sensitive skin, or are worried).
Perch / Stand
To create the stand, glue as shown - taking care to ensure the protruding ‘foot rest’ faces backwards. Use some paper (or a set square) to check it is perpendicular - get this right, otherwise, your Budgie will not roost straight!
Perching Pretty
To make the ‘Perch’, (which is essentially fake, but allows the canary to have a rotational axis to pivot), heat up the head of an M3x16 Hex Bolt - and insert as shown. Add the Brass Insert to the corresponding perch with the smaller hole. These should then thread through the assembly. If the motion is sticky, file down, and add a tiny bit of pencil lead inside (graphite is a lubricant), and if too slack, add a fine layer of Super Glue - let dry - then file down again to get a close fit, that still moves freely.
Cam-to-Wing Struts
Drill Out the holes in the Arms as shown - with a 3.0mm bit. Do this very slowly and with minimal pressure so as not to shatter them. If in doubt - use the circular file. Insert 1.0mm wire (or paper clip) as shown - and trim to around 15-16mm protruding from the end of the 3D printed material. It is better to have ‘too long’ and trim back, than too short.
Articulation Rods
Screw the Arm in place as shown - allowing it to move freely. The brass insert should probably hold the bolt in place, but if too loose add some PTFE tape, Hot Melt (or threadlocker if you like) - to keep it in place. Next, fit the tip of the wire into the hole under the Magnet. When you rotate the wheels below (manually using the key or using the code) it should tip forward and then fall from the perch - as the Arms ‘break free’ from the Magnet’s hold. Move the Arms back into the starting position to re-attach the wings.
Starting Servo Position
You should now have something looking like this. Below is a close up of the Automata ‘Discs’. Use the Key to turn *gently* the Servo anticlockwise, so that it stops. This is your starting position.
This close-up shows how I have set things up, ready for the unit to be powered up:
- The Servo Mounting Disk - is slightly off from ‘full lock’ by about 40 degrees.
- The Two Main Wheels are spaced such that the Arms move freely.
- The Two Main Wheels are set such that the screw bosses are 180 degrees from the Servo screw boss.
- The Bolts holding the Arms are positioned at about ‘10 O’Clock’ should you look from the side with the Key.
This is pretty close to the ideal starting position, but turn the key Clockwise 180 degree to see if the canary goes through flapping to falling to ‘disconnecting’ the Arms so it is fully ‘dead’. If this all works, the code should work pretty close the first time.
It is at this point you may wish to stop with the build, and skip to the code part. The reason being is that you still need to access the Arduino and FX Soundboards - using their Micro USB Connections - and to do this, you need the Base and possibly Back panels removed. However, if you’re ok with simply removing these again later, then press-on and finish the build...
Base and Back Plate
Having checked the fit of the Back and Base Plates (file to fit if tight), and checked fit with screws - you are now ready to cut small sections of PETG (1.0mm thick) or other transparent plastic - and tack in place with Hot Melt Glue. If you want to make this much stronger, I suggest sticking in with Epoxy - not Super Glue, as this tends to ‘boom’ (frost white).
I suggest placing the assembly over the edge of the table as shown - this is to ensure the Budgie is not bent out of shape when working on screwing the Back Plate in. You may notice you need to remove the two screws shown, and then reinsert them. Continue adding screws to secure both plates - Hex M3x6mm for the back, and CSK (countersunk) M3x6mm for the base.
Final Assembly
Like the RadioGlobe project - you should have a nice visual side, with a clean aesthetic - but that can be rotated to show off a cool ‘pop-the-bonnet’ style internal view of all the IoT electronics.
You are now ready to upload the Code if you have not done so already. Yep - you need to remove the Back and Base sadly...I had contemplated putting a small slot in the bottom, but as this model needs to be kids-proof for my home, (and for RS who will likely have it at a trade show or such like, I declined to do this), as you’re unlikely to be regularly updating the software (I hope!). However, the files are all open source, so feel free to contribute an upgrade!
Demo Button
If you want the Canary/Budgie to be 'prompted' by a button that is either closer to your kid's reach, or indeed if you want to display it in a school / public space, where the bird is in a display case and inaccessible, having a 'remote control' is helpful. This is a small case which houses a 12x12x6mm button - which are very generic and widely available (LINK). Simply solder some wires to the terminals, and then use header-pins on the other side to connect to the backplate as shown.
GitHub & API Setup
As mentioned, head over to GitHub to follow the guide on getting started with APIs. (LINK1). (LINK2)
If you are in the UK, this is good news as the Met Office is dedicated to the UK, but if elsewhere you may wish to use other APIs, if they don't 'zoom-in' on your specific town/region (LINK1) (LINK2) - but chances are, they might be 'good enough'.
Fundamentally you are setting up a 'API key' to a given website, and so long as you don't make too many 'requests' for data per day, it's free (this project is very 'minimal' in that regard).
To find your Station ID, run the python code to get the ID for your area using the API Key.
API Key / Secrets
Add these two numbers to "arduino_secrets.h" as shown above, along with your WiFi data.
You can now flash your Arduino.
Skin Tone and UV Index
From the GitHub you'll find 6 files that you need to flash onto the FX Board. T00.ogg to T05.ogg. These correspond to increasing levels of UV Index information. They say the lines as shown above (Voice Over by my son), but you can of course change these to whatever you like - but the only thing to note is you need to save the files as .ogg - as it turns out .mp3 is not open source.
You can of course record in mp3, but you need to convert to .ogg using software, VLC is good for example. Simply open the file and Save As... / Export... and select file type.
Please be reminded that sun protection recommendations vary based on skin tones (I referred to Cancer Research UK among other relevant organisations when developing this project). You may notice that I put a sunhat and a t-shirt icon for high UV index, as UV 6-7 is considered high exposure and skin protection needed for most skin tones. Nevertheless, if your skin burns more easily than most, please do keep this in mind!
As someone who is mixed race, and who's wife and son tan differently to me, I respect there is never a 'one size fits all', which is why we used the 'UV Index' being output as a numeric value, allowing people to act accordingly based on their skin sensitivity to the sun.
This is where making your own audio warnings (e.g. on the phone) that resonate best with your own household can be fun! (using reliable sun-protection recommendations of course!) For the code wizards out there, the code can even be adjusted to 'shift' the response up or down depending on your skin type (that is if your household shares the same skin type, or like mine - you err on the side of 'most at risk', so all will be safe.).
Daily/Hourly Notifications
I found that I wanted a reminder at 8:15 just as we're getting ready to leave for school, and so by 'resetting' or switching the Budgie on at this time, it will take this as time=0. By then setting the FCST_INTERVAL as 1 day (in milliseconds), this comes round to remind me 24hours later. Of course this is not split-second accurate, but is pretty close day-to-day I've found.
Adding More Character to Sonny
Pete has created a great system to 'animate' the automata budgie. This can be found in the second tab UVBudgie.cpp
You can see that there are 6 cases (0-5), and each of these corresponds to the increasing level of 'urgency' or 'severity' of the UV Index accordingly.
The sequence show in yellow is an example:
Flap - the start of the command.
WINGS_DOWN - this is pulling the command from the next tab UVBudgie.h where the 'position' is set to 490.
WINGS_UP_A_BIT - this then moves in the opposite direction, again calling a preset value of 370.
FAST - sets the speed of this movement, you can change this to SLOW or VSLOW also.
2 - Lastly, this is the number of repetitions of the above lines of code.
---
You may note in case 5, there is a command line below which call the 'PassOut' subroutine, which makes the bird tip forward - but not totally detach from the magnets (ie 'die'). If you wanted to make this so, you can change the value to 150.
---
In case you're wondering what these numbers relate to, it's the position of the servo. The servo move through about 180 degrees, but these are mapped from around 500 (start) - 140 (end) as 'positions' in the arduino driver code.
This means the winds down starts at 495, and 'peaks' at about 445, then goes down again on the other side to about 370. If this makes little sense, open the serial monitor whilst the Arduino is connected to your computer, and you can watch the servo readings change as it moves.
Hope this makes sense - I've added some images (albeit from the Canary) as reference.
Birds of a Feather, Flock Together!
I hope you're enjoyed this 'twist' on the Good Air Canary, to create something that gives a fresh perspective on the nature of the IoT Bird, to go from alerting you to Air Quality to now UV Index. Arguably one could try to combine all these into one device, but we found this would require a bigger processor than the Arduino Nano 33 IoT, but in many ways, we felt the discrete / singular use of a given job for a given bird worked better as a product to live with.
Indeed, we hope to explore how we might get other APIs working with the same 'bird alert' hardware, but looking up different data, and creating specific interfaces and experiences for that. What this does show is that the 'foundational' hardware of the Canary, (with it's IoT data capability, sound output, motor output, and energy efficient display), is that it is a versatile platform that can be adjusted by a competent coder to do a range of tasks.
For me, this is the most intriguing aspect of the project - asking how would you live with connected devices, and how do we make them more interesting and fun than just a generic object with a few lights? I'd love to hear your thoughts on what IoT devices you think deserve a fresh look, or indeed, what data feels out of reach but should be more a part of our lives? Thanks for reading, have fun making this (or making something entirely new from it!).