wind_station/README.md

72 lines
3.1 KiB
Markdown

# Cardboard Wind Station
This project is a wind direction sensor made of scraps I happened to have. Feel free to use better and nicer looking materials.
Estimated time: a few hours? idk, depends how neat you want it.
## Objective
The purpose of this device was really just an excuse for me to build a rotary encoder. But I do also want to investigate the feasibility of making a DIY wind turbine for charging things, so the data generated by this could be used to figure out a good location for that. Although wind speed is more relevant than direction.
## Materials & Tools
As previously noted, these materials are just scraps I had, exact measurements and type are not important. If you have access to a 3D printer or laser cutter and MDF, that would likely give a neater result, but you'd have to model the parts first.
- soldering tools
- glue - I used hot glue but [wheat paste might be a better alternative](https://www.youtube.com/watch?v=45JhacvmXV8)
- compass (the drawing tool)
- sharp knife
- black marker
- white paper
- 10kOhm resistor x3
- photoresistor x3 (TODO detail)
- Raspberry Pi Pico W/WH
- bearing 25mm diameter
- large, opaque plastic box
## Construction
### encoder pattern
TODO
### encoder plate
- Cut 3 pieces of cardboard big to fit the encoder pattern with comfortable margin
- glue 2 of them together with perpendicular grain directions
- cut a hole through the center, just big enough to friction-fit the bearing
- glue the third piece to the others, again with perpendicular grain to the side you stick it to
- cut the outside into a rough circle, the same size as the encoder pattern
- attach the patern to the plate on the side with a hole, as concentric as possible. Use masking tape to make it slightly adjustable
### encoder
TODO
## Computer setup
I used VS code but you only need a terminal for building this.
### Pico firmware
Requires the following software: `git`, `make`, `cmake` and a C compiler
```
(TODO make sure pico-sdk is a submodule)
git clone https://git.crispypin.cc/CrispyPin/wind_station --recursive
```
Now edit the file `pico/src/wifi_cred.h` and update the values accordingly.
Finally build it with:
```
cd wind_station/pico
make
```
Then plug in the pico while holding the bootsel button, and copy `pico/bin/wind_station.uf2` onto it.
### Server software
Install [`rust`](https://rustup.rs/), then run `cargo run` in `wind_station/server`
## "Platform"
I chose not to use any premade IoT platform, to reduce external dependencies, security risks and overall energy impact of the system.
I believe that our collective reliance on gigantic tech stacks and corporations is Very Bad, and do my best not to worsen the problem further by handcrafting all my software with as few dependencies as possible.
Further reading: https://permacomputing.net/principles/ :3
## Code
TODO
## Connectivity
Data is sent every TODO seconds over WiFi, using a raw TCP pipe. Since the data is so simple, I figured there was no point using MQTT or HTTP, since I have nothing else to connect to it. A less complicated protocol means marginally lower power usage, and easier implementation without dependencies.
## Presenting the data
TODO