Lex Fridman's posting
I wrote a quite long summary/description of what I did with the SmartBoard project, so makes sense to post it here as well! Project SmartBoard I've been longboarding for a while, and I really enjoyed Raspberry Pi (Zero W specifically, what a beauty) so to make my board much cooler I wanted it to have a perimeter of LEDs that would automatically respond to various actions (turning left/right, accelerating, etc.) with awesome light patterns. The following aren't necessarily in order: Part 1: Get an idea of the functionality I would like it to have. This resulted into: - Brain (Raspberry Pi) - Senses (Some sort of sensor to track movement) - Controller (Infrared controller I found in an old Arduino set) - Output (LED Strip) Part 2: Getting LED Strip. Quiet straightforward research, settled on WS2812B model since it was relatively cheap ($20-25), was waterproof, and had some documentation for RaspPi integration. Part 3: IMU sensor. To track movement I wasn't quite sure what I needed/what existed on the market. TLDR: I ended up purchasing 3 different sensors: - MPU6050 - cheap, only had 6 Degrees of Freedom (DOF) which I later found to be insufficient - MPU9250 - mid expensive, had 9 DOF (Gyro, Accelerometer, +Magnetometer) which in theory would have been very useful, as allows to track Earth's magnetic field as well, but turned out to be defective and ran out of stock - MPU9250+Built-In Kaplan filter - quite expensive for me at the time ($45), but it had a built in Kaplan filter, which I knew I needed from my experiments with MPU6050 (essentially data was very noisy - turns out riding a longboard isn't as smooth as it feels). Part 4: IR remote. I eventually realized that sometimes I want to trigger certain patterns manually, so I've added a remote controller I had lying around from some Arduino set (which was much more difficult than it sounds). Part 5: Raspberry Pi Brain + Circuit. As I'm assembling various components, I'm concurrently writing Python code to test circuits / sensors / led strip response. Since there is a lot to cover, I'll list the problems I overcame to make everything work: - Setting up RaspPi headless (establishing SSH and utilized the wifi capability of Zero W) - Integrating a power source as not to burn LED strip / Rasp Pi since both required very different voltages/currents - Attaching all the inputs/outputs to raspberry pi pins (+ software configurations) - Creating a case sturdy enough to not fall apart, hold all the circuit pieces and be developer-friendly (i.e. could assemble/disassemble easily) - Literally reading Chinese forums to figure out how to utilize the infrared controller - Writing code to interpret the movement signal (knowing if the board is turning is harder than it sounds) - Code to produce awesome led patterns (arguably the most important part) I'm sure there is something I'm missing, but since it's getting too long, I'll stop here, and hopefully, if you are interested, we could talk more about my journey. Again, all of it is documented in my github / blog / projects tab / silly youtube video.