Custom smartphone App / Data logger

Lightweight / Folding / Portable EVs - seats optional
Post Reply
User avatar
benj   100 W

100 W
Posts: 242
Joined: Jun 06 2013 3:32am

Custom smartphone App / Data logger

Post by benj » Dec 18 2013 7:43am

Hey everyone,

Seeing as I make mobile apps for a living, I decided to combine my job with my hobby, and I started making a custom iPhone app and hardware for some data logging.

The overall plan is to try and make something really useful and the end goal is to open source everything talked about here :)

It all started with Apple's new iBeacon technology which I was playing with, then I glanced over at my board, and had the eureka moment. With some pretty basic tinkering, I have the following setup all working:

- Turn on my electric longboard
- It automatically wakes up your phone with a notification, and tells you the current battery voltage, charge %
- Tap the notification, and it launches the app. You can see battery stats and estimated range.
- Tap Start button, and it records your GPS route, displays it on a live map, and shows speed graph. Tap Stop and your session is saved.

So far, it's very cool. It's so great to have the phone wake up when the board is turned on :) Here are some pics:

Image
This picture is old - I don't use an Uno and shield anymore - see below.....
Image

The current list of hardware is super simple:
- Arduino Uno
- Red Bear BLE Shield
- A few wires

Note: As of June 2014 I ditched the Uno and Red Bear shield in favour of a LightBlue Bean. It's much smaller and hugely better!:
http://www.punchthrough.com/bean

Now comes some trickier stuff, and I'd love anyone to help and get involved. I'm no good with circuits and I think this project could benefit from someone who is!

Currently, I only measure one lipo cell through the balance plug. This is good enough for people who balance charge, but I'd love to monitor each cell and feed that back to the app.

I would also love to see currents/amp draw coming through, but no idea on how that would work. I've seen some ESCs with great data logging, like temperature, motor RPM. I'm not trying to compete with ESCs like that - this is just a fun project!

Open to all suggestions - what would you like to see being reported back? And what other killer features would you want in something like this?
Last edited by benj on Jun 20 2014 9:35am, edited 1 time in total.

Murfix   100 W

100 W
Posts: 153
Joined: Apr 24 2013 6:51am
Location: Belgium

Re: Custom smartphone App / Data logger

Post by Murfix » Dec 18 2013 8:04am

Nice project.

Check http://endless-sphere.com/forums/viewto ... 2&start=25
Things did amazing things there, but I don't think he's still very active on here.

I'd love to learn about this stuff! Can someone recommend me a course or manual or something to get started? I have basic electronics knowledge. Maybe on coursera.org or edx.org ?
Memo to myself: Screw it, just do it!
1 Apr 2013 - Start pre-engineering my first EV build!
6 Aug 2013 - Ordered all parts for my Emtb 8s 2x2kW 270kv Alien ESC setup.
3 Sept 2013 - All parts have arrived: on to the build!
23 Sept 2013 - First test ride: AWESOME!
7 Feb 2014 - Upgrade finished: 3kW motors, 12S Alien ESC, entire new drivetrain and LED's!
Build topic: http://endless-sphere.com/forums/viewto ... 35&t=52390

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: Custom smartphone App / Data logger

Post by torqueboards » Dec 18 2013 11:13am

Wow those would be an awesome project. Once it's fully finished, I will definitely try to implement it.
DIYElectricSkateboard.com Electric Skateboard Kits

Jan Christian   100 W

100 W
Posts: 129
Joined: Oct 26 2013 4:36am

Re: Custom smartphone App / Data logger

Post by Jan Christian » Dec 18 2013 1:06pm

It would also be cool to film with a phone with live speed stamped on the film..

User avatar
superpef   100 W

100 W
Posts: 126
Joined: Jul 28 2013 4:31pm

Re: Custom smartphone App / Data logger

Post by superpef » Jan 29 2014 12:04pm

Jan Christian wrote:It would also be cool to film with a phone with live speed stamped on the film..
Check "Vidometer" on the App Store..

dirkdiggler   10 kW

10 kW
Posts: 599
Joined: Oct 18 2012 1:31am

Re: Custom smartphone App / Data logger

Post by dirkdiggler » Jan 30 2014 12:18pm

Couldn't find vidometer on android. I found alaprecorder and alaprecorderhd which looks like it is used for racing cars, might work. They don't look to have been updated since 2011 though. I guess if it works why change it.

bose   100 W

100 W
Posts: 122
Joined: Sep 28 2010 11:49am
Location: Sweden

Re: Custom smartphone App / Data logger

Post by bose » Jan 31 2014 3:48am

You can always add a current sensor to show present current and also integrate it over time to get used capacity (Ah). http://dx.com/p/30a-acs712-current-sensor-module-158589 can be used for up to 30A, for higher currents go for Allegro ACS756 or ACS758.

User avatar
benj   100 W

100 W
Posts: 242
Joined: Jun 06 2013 3:32am

Re: Custom smartphone App / Data logger

Post by benj » Jan 31 2014 4:25am

Thank you Bose, that's really helpful for an electronics idiot like myself :) Seems great for the job. I see the ACS758 goes up to 200A and the price is very good.

I'll also be looking at some thermistors, one on the ESC and one for the motor, something like this: https://www.sparkfun.com/products/250.

Just need some time, life got busy and not much hobby time right now!

User avatar
Giovanni LiCalsi   100 W

100 W
Posts: 182
Joined: Sep 05 2013 8:42pm
Location: ALAMEDA, CALIFORNIA 94501

Re: Custom smartphone App / Data logger

Post by Giovanni LiCalsi » Jan 31 2014 4:44am

It would be great to use this with an EV.
Kind regards,
Giovanni

Stanley Rocket EV
http://www.steamcar.net/stanley/fastest.pdf

bose   100 W

100 W
Posts: 122
Joined: Sep 28 2010 11:49am
Location: Sweden

Re: Custom smartphone App / Data logger

Post by bose » Jan 31 2014 9:17am

You can also use a linear temperature sensor like this: https://www.sparkfun.com/products/10988 http://learn.adafruit.com/tmp36-tempera ... r/overview or LM35 or something alike.

User avatar
fechter   100 GW

100 GW
Posts: 14070
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: Custom smartphone App / Data logger

Post by fechter » Jan 31 2014 9:34am

Cool idea.

Current sensing is a key parameter. From this, you can accurately estimate range based on the battery capacity. Remaining battery could be displayed like a gas gauge or bar graph. Starts blinking red when you get low.
Individual cell voltage monitoring would be cool, but probably difficult to implement and generally not so important if the pack has its own BMS.

Don't most phones have some kind of accelerometer? Not sure how important that is, but might be good to data log and compare to power consumption.

Speed could be determined from sensing one of the motor hall lines or from a bike speedometer sensor. I'm not sure how accurate the speed from GPS is on a phone.
"One test is worth a thousand opinions"

Murfix   100 W

100 W
Posts: 153
Joined: Apr 24 2013 6:51am
Location: Belgium

Re: Custom smartphone App / Data logger

Post by Murfix » Jan 31 2014 9:44am

Dude I'm buying the Arduino Uno!

It's on sale on conrad in Belgium at the moment :)

Are you willing to share your stuff later on? :) because I'm new at this.
Memo to myself: Screw it, just do it!
1 Apr 2013 - Start pre-engineering my first EV build!
6 Aug 2013 - Ordered all parts for my Emtb 8s 2x2kW 270kv Alien ESC setup.
3 Sept 2013 - All parts have arrived: on to the build!
23 Sept 2013 - First test ride: AWESOME!
7 Feb 2014 - Upgrade finished: 3kW motors, 12S Alien ESC, entire new drivetrain and LED's!
Build topic: http://endless-sphere.com/forums/viewto ... 35&t=52390

bose   100 W

100 W
Posts: 122
Joined: Sep 28 2010 11:49am
Location: Sweden

Re: Custom smartphone App / Data logger

Post by bose » Jan 31 2014 9:46am

You need a BLE/Bluetooth 4.0 shield as well.

User avatar
benj   100 W

100 W
Posts: 242
Joined: Jun 06 2013 3:32am

Re: Custom smartphone App / Data logger

Post by benj » Jun 20 2014 9:33am

Finally got some spare time again for an update to this project.

I've ditched the Arduino and Red Bear BLE shield in favour of this little beauty:

http://www.punchthrough.com/bean

It's a tiny Arduino with Bluetooth 4.0 (BLE) built in. It's also got a battery, accelerometer and thermometer on it - all in a tiny board about the size of your thumb :) I highly recommend it, so far I'm very impressed. It runs standard Arduino code, and makes Bluetooth stuff super easy.

I've got it wired up to an AttoPilot Voltage and current sensor:

https://www.sparkfun.com/products/10644

This can read up to 50 volts and 180 amps, so should suffice for most eBoard projects!

Here's a pic of my quick and very dirty setup to test everything is working:

Image

A few lines of code and I now have amps and volts going wirelessly back to my iOS app for datalogging :D A quick test was reporting 0.2 amp draw when stationary and about 6amps on WOT with wheels in the air. That sounds about right....anyone got any ideas how I can test for accuracy?

Next job is to plastidip the AttoPilot and fix it up to the Bean properly. Then it's time for some testing, which means riding my board some more :)

furp   100 W

100 W
Posts: 201
Joined: Jun 30 2013 2:44pm
Location: Germany

Re: Custom smartphone App / Data logger

Post by furp » Jun 20 2014 5:10pm

wow, great work :) you should get together with galp for his GalWii.

User avatar
onloop   10 kW

10 kW
Posts: 600
Joined: Jun 24 2013 5:24am
Location: Australia
Contact:

Re: Custom smartphone App / Data logger

Post by onloop » Jun 22 2014 5:14am

this is really cool...

so could it control throttle of speed controller using BT?

User avatar
benj   100 W

100 W
Posts: 242
Joined: Jun 06 2013 3:32am

Re: Custom smartphone App / Data logger

Post by benj » Jun 22 2014 3:01pm

Yep, indeed it could. It runs Arduino code and has pretty much the same pins as a standard Arduino and we've seen plenty of work here lately on getting ESCs working with that platform.

The only possible problem is that these aren't fast chips and doing more than one thing can be hard. Especially when you have to have precise timing to pulse an ESC. I reckon it would be fine though

whereswally606   100 kW

100 kW
Posts: 1130
Joined: Jun 19 2011 2:11pm
Location: Cheshire, UK

Re: Custom smartphone App / Data logger

Post by whereswally606 » Jun 23 2014 11:30am

Hey benj could this bean blue radio be used to pair with some other ble radios which transmit data from their cell sensing data. See flytron icell. So the icell normally transmits to an iPhone but i want to create a standalone arduino solution instead of the expensive phone on your handle bars idea. I hope you understand my question.
Distributing "Lebowski" FOC Controller PCB (Through hole) since 2016
Moped: Emax 110s 2009

User avatar
benj   100 W

100 W
Posts: 242
Joined: Jun 06 2013 3:32am

Re: Custom smartphone App / Data logger

Post by benj » Jun 23 2014 4:09pm

Hi, yep I understand. That iCell is pretty neat.

I don't think this is possible. The Bean is not able to act as a Bluetooth host so the iCell wouldn't connect to it. It might be possible in the future as the Bean is still being developed....fingers crossed.

I'm sure you could use the Bean and some other circuitry to do cell monitoring like the iCell. That's a bit beyond me right now but I don't think it would be too hard.

User avatar
onloop   10 kW

10 kW
Posts: 600
Joined: Jun 24 2013 5:24am
Location: Australia
Contact:

Re: Custom smartphone App / Data logger

Post by onloop » Jun 23 2014 6:40pm

benj wrote:Yep, indeed it could. It runs Arduino code and has pretty much the same pins as a standard Arduino and we've seen plenty of work here lately on getting ESCs working with that platform.

The only possible problem is that these aren't fast chips and doing more than one thing can be hard. Especially when you have to have precise timing to pulse an ESC. I reckon it would be fine though

PLEASE TELL ME THIS WILL WORK!

Zeemote JS1
Image

The Zeemote JS1 is a Bluetooth joystick with a thumb joystick and 4 buttons with assignable actions. It looks like a Wii nunchuk. You can use it as two joysticks, for example, one to aim and one to move. Its battery life is excellent.

The Zeemote is compatible with any Android from 2.1. It also has a free app for setup and configure bluetooth on your smartphone.
source: http://www.techulator.com/resources/993 ... evice.aspx

Image


Image

Image

MAYBE YOU DON'T EVEN NEED THIS BIT?
Image

Image

ANY SPEED CONTROLLER?
Image

Image

Image

User avatar
benj   100 W

100 W
Posts: 242
Joined: Jun 06 2013 3:32am

Re: Custom smartphone App / Data logger

Post by benj » Jun 24 2014 4:03am

Haha!! Nice use of images there :)

That zeemote looks promising, but I think its using Bluetooth 2 and the Bean is Bluetooth 4 only....I'm gonna research that a bit more because I'm not 100% sure on that

Post Reply