Hacker News new | ask | show | jobs
by wizdumb 2720 days ago
Based on the feedback from my previous experiment[1], I wrote an in-depth article about the accelerometer unit I built. In this article, I describe how I built it, how it works, and how you can build your own for under $50! The project is open-sourced and it uses off-the-shelf components. Data analysis was done using Python, Pandas, and Plotly.

I hope that this content is high quality enough to justify the time you spend reading it, and how much time it took me to create it!

I’d love to hear your feedback and answer any questions!

[1] https://news.ycombinator.com/item?id=18731322

1 comments

Is there any reason why you can't connect the accelerometer directly to the rpi?
You definitely could! I chose not to simply because I wanted to make it smaller. The Feather boards are a bit smaller than the Pi Zero.
You could try making it wireless rather than put the logging on the gun. Something like an Esp8266 might do it if you buffer the measurements. Also look at the Particle Photon which will do TCP out of the box. Squirt the data to a pi and do the logging on there.

Your problem is that you need to find some asynchronous storage or transmission method. For example in barebones avr, writing to the spi data register initiates a transfer, but you can do other things while you wait ~8 clocks for it to send. Interleaving like this can go quite a long way on 8 bit hardware.

In Arduino, there may be a lot of safety checking and blocking going on. Other chips (eg ARM) can do things like DMA where you can route data from eg a serial port straight into something else.

Thanks for the feedback! The Feather board I'm using actually has Bluetooth, but I have not explored using it yet. If it's faster to send data over BLE to an app, then that would make this project even more affordable and smaller because the SD card and RTC are no longer required.

I believe the Feather M0 board I'm using is also capable of running CircuitPython (fork of MicroPython). For this project, I wanted to keep it simple, so I opted for Arduino, though I am more familiar with Python.

If you have any specific advice or improvements you'd like to suggest, I'd love to get them in either PRs or Issues for the project over on GitHub! https://github.com/ammolytics/projects/tree/master/accelerom...

Will do!