-
Cellphone to CANbus
10/19/2018 at 18:27 • 0 comments[nebk] wrote in with a project that used a CANbus dongle (originally a design by Hackaday's own Eric Evenchick!) to read the vitals of an experimental competition car.
CANbus is actually pretty versatile, and the transceiver chips take care of a lot of the hassle for you for very little money. You probably don't want CANbus for a single sensor, but once you get past a few, it might make sense. Of course, if you're doing automobile stuff, it's a good fit.
"My freshman year we moved to a CAN interface based (http://canable.io/), we had to recompile the Linux kernel in order to get CAN to work with the tablet, but since the tablet was a Nexus 7, it wasn’t too bad as far as I know. From there the team wrote a custom QT app to display the sensor data in a dashboard and stream it back to the server (https://github.com/HEEV)."
-
WiFi + Websockets + ESP
10/19/2018 at 15:33 • 0 comments[murilopolese718523034] suggested WiFi + Websockets + ESP32 running Micropython.
Websockets are great b/c you could code the app on the phone side as a webpage, which makes it more portable and relatively easy to hack together if you know HTML / JS. It's also (relatively?) low latency, at least compared to HTTP. Which is faster, Bluetooth/Serial or WiFi/Websockets?
I also like this b/c the hardware side is pretty easy to handle. Just an ESP32 and you're done. Let its HW peripherals handle the SPI or I2C or ADC or whatever.
What's missing is a protocol/API.
Micropython here or there, this is a promising approach to tacking fairly high quality GPIO onto a phone.
Pros: cheap, readily available, super-flexible hardware
Cons: battery drain from WiFi, flexible -- protocol implementation needed
This is the angle I'm going to chase down. I've got some ESP32 breakouts just asking to be used...
-
Bluetooth
10/19/2018 at 15:26 • 0 commentsBluetooth is obvious. You can easily put out serial data to a cheapo BT modem, and pass that off to a microcontroller.
Pros: simple, portable, flexible, not a super power hog
Cons: slow, high latency, flexible -- need to develop own protocol
[Eric Mockler] says: I use Basic for Android and the BT for serial access.
https://www.b4x.com/b4a.htmlSee the bead-sorter project for another example (Droidscript + Arduino).
[MartinR] says: For making Android apps take a look at MIT App Inventor 2 http://ai2.appinventor.mit.edu Totally insane GUI programming but gives access to Bluetooth and BLE.
So many ways to go here, and a Bluetooth serial terminal is always handy...
-
FTDI 232H
10/19/2018 at 15:18 • 0 comments[scatterbrained2] suggests that some Android phones will recognize the FT232H chip, which has GPIO as well as the normal serial modes.
I have a 232H board with some onboard EEPROM, and it can be configured to do fast SPI / I2C / JTAG, passing all that over USB. This would be a powerful/fast interface if it worked with a phone. But I think it set me back $20. More than a Pi Zero, less than a Pi 3B.
-
Android Open Accessory
10/19/2018 at 15:14 • 0 comments[jonsmirl] and others suggested AoA -- which mostly seems to be an Android-side API to interface with USB devices. Not a bad idea, but what do we use for hardware?
Well, there's the official dev kit which doesn't exist anymore. Google/Android now wants you to tether the phone to a Raspberry Pi. LOL, thanks. The whole point of a cellphone/hardware interface was replacing the Pi.
Arduino made an ADK board for a while. Looks to be discontinued.
It looks like you can still get the IOIO board from Sparkfun, so that's good news. It's $40. Bummer.
So DIY? It looks like AOA needs a USB host attached to it. So you'd better like coding up USB host firmware. (I don't.)
I haven't looked hard enough into AOA -- If I'm missing something here, please let me know!
-
Cellphone-powered Bead Sorter
10/19/2018 at 15:01 • 0 commentsIf you want to know what I'm talking about, it's this!
[Aaron Christophel] took a project that was done with a RasPi and camera, and subbed in a cellphone, Bluetooth modems, and Arduino. The vision is done on the phone, coded up in Droidscript (JS dialect targeting Android OS). The phone talks serial via Bluetooth to an Arduino that drives the servos that make it go.
[RÖB] and [Aaron] note that Droidscript is a friendly stepping-stone to Android-flavored Java, so learning it isn't a waste of your time if you want to start off quick on the phone side. Now [Aaron] uses the SDK directly.