Shop OBEX P1 Docs P2 Docs Learn Events
Electric motor bike with BASIC Stamp — Parallax Forums

Electric motor bike with BASIC Stamp

redcomet782redcomet782 Posts: 1
edited 2012-11-29 06:17 in General Discussion
We're doing the project is to develop an electric motor bicycle to assist the bike rider going up steep hills. In our project, we modified a bike with combination of electric motor, goniometer sensor and micro controller (BASIC Stamp). We develop this device is only assisting the bike rider and the rider still have to paddling when going uphill.

When going uphill, the goniometer sensor will sense the change of gradient and sent a signal to the micro controller. The micro controller will connect the battery(24V, 10A/hr) to the motor when received the signal. When the motor is on, the rider should feel no difference between riding uphill and on the flat ground.

Additionally, because the rider will be paddling regardless if the motor is working; to prevent the interference between the peddling and the motor, we will be installing two freewheel to accomplish our design.


We've done the mechanical part, put the battery and motor on the bike, then it works, but without a sensor.

I was keep working on the programming part and searching the way that how the sensor works, and I found that the goniometer is not the appropriate one for our project.
We need the Accelerometer, instead. And we still need the switch.

* Could you share any idea that which accelerometer and switch fit for this project?

* What will the circuit design and the programming code be?

* Or if we don't use any microcontroller, is there any good way that the sensor works on this bike?


Thanks.

Comments

  • BeanBean Posts: 8,129
    edited 2012-11-28 05:15
    For a simple system you could use something as simple as a tilt switch that controls a relay which in turn controls the motor.

    For a more complex system use a Basic stamp with the Memsic 2125 to do the sensing and a PWM motor controller to control the motor. Then you can tweak the amount of power going to the motor depending on the steepness of the hill.

    Bean
  • Mark_TMark_T Posts: 1,981
    edited 2012-11-28 07:47
    Yes, a goniometer would need a reference direction, an accelerometer will find gravity vector for you.
    There will be a lot of vibration in this application, so good low-pass filtering is needed, analog or digital -
    cutoff frequency perhaps sub-Hz - here only 2 axis accelerometer is needed if that helps.

    Note that actual forward acceleration of the bike will appear like uphill tilt to the accelerometer so it will
    automatically help out on starting from standing!
  • GadgetmanGadgetman Posts: 2,436
    edited 2012-11-28 11:42
    Hm...

    As someone who rebuilt his own bike to Electric assist this year, I would like to butt in...

    Use a motor built into the hub. These are typically Brushless types and have freewheeling and sensors built in already.
    (This should simplify the design a bit)

    In fact, you can get all the parts you need online; motor, battery pack and controller/sensors easily.
    ( www.goldenmotor.com has a lot of neat stuff )

    Why not get hold of a complete kit and take it apart to learn how it works and then rebuild it to it your requirements?

    Note that there may be rules for these kinds of bikes where you live.
    Here in Norway we use the EU regs; max 250W motor, assist only with a cap at 25Km/h. Motor should stop withing 1.5Second after user stops pedalling. And there needs to at least one 'kill switch' connected to a brake handle.

    Going beyond the local regs may mean the bike suddenly gets classified as an unregistered, NON-type-approved motor vehicle.
    That generally translates into fines, bans against use and possibly confiscation.

    EDIT:
    Most available controllers use the speed you pedal at as part of the equation to decide how much 'help' to give. Pedal quickly and it gives a lot of help and so on. So in steep uphills all you need to do is to shifft down to get more help.
  • ercoerco Posts: 20,259
    edited 2012-11-28 13:42
    For parts, also see http://tncscooters.com and http://electricscooterparts.com

    This great and simple concept is difficult to execute. Per Mark_T. accelerometers will be hard-pressed to filter out vibration. Mercury switches bounce. Just getting an accurate measurement of hill incline while moving is tough with simple sensors. GPS could yield elevation change, divided my distance travelled, can swag the gradient. Might be worth a shot.

    Also, it might be worth just putting "cruise control" on a bike. As long as the "go" button is pressed, the motor maintains the bike at a certain minimum speed. That way, it would automatically work harder on hills as the rider needs motor assist.
  • GadgetmanGadgetman Posts: 2,436
    edited 2012-11-29 06:17
    Note that cruise control would put the device into the 'moped/motorcycle' bracket and a whole heap of pain if authorities gets interested.
    (Depending on local law, of course. In that area, its definitely easier to ask first)

    GPS or possibly gyros would be he way to spot inclines.
Sign In or Register to comment.