Building DIY Sensor array for your E-BIKE based on Android
these are instructions on how to create your own sensor array kit for your ebike, which include a current sensor, voltage sensor and speed sensor. with it you'd be able to see EXACTLY how long you have untill the battery runs out what is' the current load on your engine, and what is the most efficient throttling for increasing speed.
i should note that there's allready a similar device called cycle Analyst which has the advantage of being a standlonish device (which is in case your'e unfortunate to have an iPhone, this guide isn't for you).
the advantages of having an android as the CPU instead of a closed device are numerous, first and foremost, it's rather easy to develop using just java. you can add lots of your own functionality and integrate with your phone's other sensor's (like tilt and gyro's for uphills)
i'm going to divide this guide into 3 major parts.
1. IOIO module
2. Current Sensor
3. Speed sensor
IOIO is a microcontroller board designed to integrate with you any android phone (version 1.5) , because all the major heavy lifting is done on the phone side, it allows the board to be tiny.
there are 3 major issues that need to be dealt with when preping IOIO as part of the current sensor
* connections. unlike arudino ioio doesn't come with built in female connectors which you just plug in cables, while it does allow it to maintain a low profile, your'e left with the task of soldering wires or headers into the board, or can you use solderless headers which can be plugged into ioio (although not very easily).
* power - forget the USB connector, this one actually SUPPLIES power to the phone (or you can use it as bluetooth connection), because the phone sees IOIO as the host. you either use one of the holes on top of the board (again with the headers) , or solder in a jst connector and then plug in jst connector with wires . personally i prefer the jst solution, as it seems more sturdy then the pins.
*power SOURCE - ideally you'd want to plug IOIO into your e-bike ,however IOIO has a voltage regulator which can accept up to 15V, and , last time i checked e-bike are just starting from 24V, so unless you wanna opt for some separate battery, (don't use 9V too weak), you'd need a DC-to-DC converter .
so let's see them all connected ..
as you notice, i've soldered 7 pins into IOIO, the pair on the left (further side) are for ground connections (for speed and current sensor) next to them you'll see a pair for data connection (into analog ports)
on the closer side you see a pair of headers plugged into ioio's power OUTPUT (for powering the sesnors) and the last pin is for the data from the speed sensor.
Current sensor - you don't have use the one I'm using. The principal is the same. Note however that if you choose to use the vsense to measure voltage, you'll need place in a voltage divider, in order not fry your IOIO.
pictured above is current sensor after i drilled 2 resistors, the right one is connected to the original vsense port, the resistors converge on the top (where the output for the ioio comes out) on the left you connect the ground. to get the right resistor values for you current sensor, you can use a calculator just remember that the maximum output voltage must not exceed the 3.3V.
this is how it looks connected to ioio. as you can see i've opted for cable footing connectos as this will allow me to easily connect the disconnect the whole thing.
pictured above is the connection setup of the bike, the top and bottom wires are the current wires, so you could either connect the cable footing to the sensor, or to each other, in case you wanna pull out the sensor for inspection.
the middle wire is the for the ground of the current sensor to be connected (the thick wire coming out of the voltage divider).
Speed Sensor - this is completely optional part, but i believe it to be useful to know your speed in parallal to you power consumption , i'm using this magnetic sensor there really isn't much to talk about, as this works the same way bycicle computers measure speed, EXCEPT one major important point, how the sensor should be aligned with the magnet:
note how the magnet and sensor are aligned on the same angle so the sensor would be exposed as minimally as possible to the magnet, if you try to place the sensor any other way , that will allow the magnet to pass ACROSS the sensor, it will screw up your readings.
Software - i've enclosed the link for the open source project to install on your phone (you may need to do some adjustments, especially regarding the voltage divider).