Automatic Bike Light (with light sensor and motion sensor)

Discussion in 'The Projects Forum' started by keabler, Apr 17, 2013.

  1. keabler

    Thread Starter New Member

    Apr 17, 2013
    Hi all,

    My project idea:
    I want to build an automatic bike light that detects when it is dark and when I am moving (so I don't have to turn it on or off).

    My Background:
    I am in my last semester of physics so I have some experience in building circuits and the general theory behind how many of the electronic components in a circuit work; however, I don't have much experience in designing circuits.

    Where I'm at:
    I know that I need an accelerometer, photo-diode, LED's, and a battery. What I'm unsure about is how I can design a circuit that will compare the output from the accelerometer and photo-diode to control whether or not the LED is on or off.
    - Do I need to use a transistor circuit, or is this more easy to accomplish with a microcontroller?
    - How would I design a delay into the circuit (so that the light wouldn't turn off when I'm stopped at a stop light or when a car passes me)?

    Thanks everyone and I apologize for my noobness, but building electronic circuits is something I would like to get into. I've even built an audio tube amplifier for my final project in electronics lab, but I didn't design that circuit.
  2. poopscoop


    Dec 12, 2012
    Omit the accelerometer, use a switch or pressure sensor in the seat instead. Infinitely simpler. Incorporate an RC time constant to control shutdown. This will solve the passing headlights and stand-up problem in one fell swoop.
    keabler likes this.
  3. keabler

    Thread Starter New Member

    Apr 17, 2013
    Thanks, I wanted to house every thing for this build inside the stem of my bike so that the only visible modifications form the outside would be the 2 LED's that would shine through a hole in the handle bars and maybe a charging port at the bottom of my stem (out of sight, I have a pretty "nice" bike and want to keep my light modifications as incognito as possible). If I used a pressure pad on the seat I would have to figure out a way to conceal cables from my seat to my stem which is doable but somewhat involved.

    If I put a switch on my bike I wouldn't need the light sensor or accelerometer since I could just turn the light on and off when I needed it.

    Also, I do have some experience with microcontollers and accelerometers. I've programmed a PID controller for a segway project I worked on for fun. However, I don't have much experience with electronics and am open to suggestions. Maybe a switch operated system would be best.
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    If you are putting in a charger then you have an effective sensor for "in use:" the generator output voltage itself.

    I'm a micro controller guy, and this screams USE A MICRO to me. While it is possible to do with discrete parts, it will be a cleaner design with a micro. With a micro you should not need any switches at all.

    Plus you can add lots of other tricks for virtually nothing.
    keabler likes this.
  5. keabler

    Thread Starter New Member

    Apr 17, 2013
    Thanks, I'm just starting to think about this project (all though I have purchased some 3 watt LED's and an appropriate rechargeable lithium battery so I can have a switch operated system while I work on the automatic system).

    Do you have any suggestions for a microcontroller that would work well for this? I've used an arduino before, but I don't think I need any thing that "elaborate" for this project.