PDA

View Full Version : [Question(s)] USB controller suggestion that can be programmed with C# for electric bike?



srb31513
08-06-2012, 09:27 PM
Hello all,


First of all my appologies if this is off topic, but I don't know enough about electronics to even start looking in the right place...


I'm hoping the experts here can point me in the right direction, and solve this puzzle:


Essentially I need to interface an electic bike with a C# software running on a netbook via USB to do few rudimentary tasks. I'm not sure what this


USB controller is or if it even exists, but here is what this controller \ "thing" needs to do:




1. Pass some kind of input to software that approximately represents speed of wheel turning (accuracy / MPH not imporant...relative is fine)..I was


thinking about using a cheap bicycle dynamo that lights a 6 volt bulb or something similar..that I can wire to the controller "thing" that will feed


info back to software.


2. Outputs voltage regulation...so that I can limit output that goes to bicycle wheel..for example if I want to stop all current to wheel via


software. I'm not concerned about power details here..i will find a way to modulate / contorl power, but just need something that will alow me to do


it from software.


3. Software should light 6 different leds. For example if i click button on netbook I need a led to light...simple.


4. Softoware should respond to 5 buttons mounted on the bicycle frame...if i press button software get's an event and shows message on screen.


The key here is for software to handle all the events/inputs/outputs for speed, buttons, leds, and voltage regulator....etc i just dont know what the


USB "thing" is that has drivers and that I can program against and use to inteface with the electonics.


Can someone suggest what usb controller / "thing" would be appropriate for this setup? Or an adaptor or two that I can use to accomplish the same?


Again, my applogies for pre-newb questions...any help would be much appreciated. Thank you in advance for any and all help...


-Stan

defwheezer
08-06-2012, 11:21 PM
Look into the following: http://www.roboticsconnection.com/c-5-robot-controllers.aspx

These can be controlled through the USB port and lots of C# code is available for interfacing just about anything.

However... using a netbook to run the C# code that runs an interface board that lights LEDS, does speed monitoring, etc. seems somewhat of overkill.... maybe a simple Arduino would do- once programmed, you do not need a netbook, which would decrease your total battery power consuption (something an electric bike would greatly benefit from- more power for the wheel(s)!).

jwatte
08-07-2012, 03:10 AM
A simple Arduino Uno can be used as the controller you want. You write an Arduino sketch to read the inputs, and drive the outputs, and send/take commands from the "serial port" (which is the USB port to the computer.) On the computer side, you simple read/write commands/status using a serial port class (built into .NET framework.)

For 5 buttons and 6 LEDs and 1 speed sensor and 1 speed modulator, you'll probably want to use the analog ins for the buttons, to have enough digital I/O for the power control. You can also use the analog-in to read the voltage of the dynamo, although I recommend you add a significant filter on that signal, and probably also a resistor ladder to make sure you don't over-volt. An alternative is to use something like a Hall effect sensor or similar that senses rotation of the wheel and/or spokes passing by.

Another alternative is to use a GPS module to read the speed :-)

The biggest problem is likely going to be the power modulation. Electric bikes typically range from 250W to 1 kW in power, which is a pretty serious amount of current to control.

srb31513
08-07-2012, 01:43 PM
Look into the following: http://www.roboticsconnection.com/c-5-robot-controllers.aspx

These can be controlled through the USB port and lots of C# code is available for interfacing just about anything.

However... using a netbook to run the C# code that runs an interface board that lights LEDS, does speed monitoring, etc. seems somewhat of overkill.... maybe a simple Arduino would do- once programmed, you do not need a netbook, which would decrease your total battery power consuption (something an electric bike would greatly benefit from- more power for the wheel(s)!).

defwheezer! Thank you so much for your help man! .. I hear you 100% on the netbook overkill, the only reason I'm using it is because I need other functionality..touchscreen, wifi, sound out etc. and it's easier for my to push that out via .net than through controller I've never worked with. I really appreciate your advice...thanks again! :)

srb31513
08-07-2012, 01:49 PM
A simple Arduino Uno can be used as the controller you want. You write an Arduino sketch to read the inputs, and drive the outputs, and send/take commands from the "serial port" (which is the USB port to the computer.) On the computer side, you simple read/write commands/status using a serial port class (built into .NET framework.)

For 5 buttons and 6 LEDs and 1 speed sensor and 1 speed modulator, you'll probably want to use the analog ins for the buttons, to have enough digital I/O for the power control. You can also use the analog-in to read the voltage of the dynamo, although I recommend you add a significant filter on that signal, and probably also a resistor ladder to make sure you don't over-volt. An alternative is to use something like a Hall effect sensor or similar that senses rotation of the wheel and/or spokes passing by.

Another alternative is to use a GPS module to read the speed :-)

The biggest problem is likely going to be the power modulation. Electric bikes typically range from 250W to 1 kW in power, which is a pretty serious amount of current to control.

JWatte...this is great advice...thank you so much for the details! Yes, power will be an issue, I have no idea how to approach that just yet. Can't thank you guys enough for the guidance. :)

SteamAutomaton
12-01-2012, 11:46 PM
May we get updates of your bike?