motrcycle turn signal

Hello,

was hoping to get some suggestions or help with my project...

I have an UNO, and need to *detect when the turn signal (and/or brakes) is activated/on.

Can I just take the cable from the turn signal light and use it as and input?
Do I need to add some sort of resistors etc.?

any help would be greatly appreciated!

Generally you will need to provide some sort of voltage divider for each signal you want to bring to the Arduino. To determine the values of the resistors you'd first need to know the maximum voltage your bike's electrical system will get up to (but just a 10K trimpot would do). What are you wanting to do with the Arduino?

@DirtBiker - thanks for the response. I'm basically wanting to drive some led strips off/on.

so I can connect: brake light -> trimpot -> arduino input pin?

Will give it a shot tonight. :astonished:

so I can connect: brake light -> trimpot -> arduino input pin?

Do you have a multimeter? I'd "feel better" if you can measure the output of the trimpot before connecting the Arduino.

And with a pot, you'll need to measure the voltage (or resistance) to adjust it properly anyway.

@DVDdoug - never really used the multimeter (yes, I'm a noob). but I can try and check the readings and post and update.

I'm just looking to get a high or low signal from the input pin.

Here is a little preview of my project:

can i use this trimpot @ 0:56 of the video?

Multi meter is easy :> See the big "V"

Turn it to the "20"

lol Okay a pro should chime in here that's all i know :>

After some *research I guess I need to...

  • connect the turn signal power cable to the the Red wire of the multimeter.
  • Then connect the black wire of the turn signal to the Black wire of the multimeter.
  • then turn multimeter to "Vdc" 20
  • then initiate turn signal
  • this should give the reading I need to proceed?

the manual for the motorcycle (actually, its a scooter :grin:) reads:
Turn Signal Bulb 12v/10w
Brake Light Bulb 12v 21w/5w

wholeo:
so I can connect: brake light -> trimpot -> arduino input pin?

I suggest that it would be better to use plain old resistors rather than a trimpot. A trimpot has an infinite number of wrong settings, and could easily be set wrong or disturbed by accident, and they're mechanical devices which aren't particularly robust. All you need is a pair of resistors in series, and you can easily calculate the ratio of resistances you need to produce your required output voltage range. I suggest you design for an input voltage of around 15V (to allow for the full range of voltages typically seen in car electrical systems) which conveniently means you just need to reduce the voltage by a factor of three - any three identical resistors in series will do that for you.

@PeterH - thanks for the info! I will give that a go. I've created a rough schematic. Is this how it should go?

Possibly with code similar to this:

int ledPin 	= 13; 			// LED connected to digital pin 13
int inPin 	= 7;  //or A0?  	// brake light connected to input pin (digital or analog??)
int val 	= 0;    		// variable to store the read value

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin 13 as output
  pinMode(inPin, INPUT);      // sets the digital pin 7 as input
}

void loop()
{
  val = digitalRead(inPin);   // read the input pin
  digitalWrite(ledPin, val);    // sets the LED to the inPin value
}

Please don't connect an LED directly between an I/O pin and ground without a current-limiting resistor - you risk damaging the LED and/or the I/O pin. In any case there is already an on-board LED connected to pin 13.

The resistors shown are not connected correctly. You need to have the three resistors connected in series (you have that part right). One end of this chain need to be connected to ground. The opposite end needs to be connected to your 12V signal. (This means the signal is grounded through your three resistors.) The Arduino's ground needs to be connected to the 12V ground, too, to complete the circuit.

With the connections described above, you now have two intermediate junctions between the three resistors. The one closest to ground will see one third of the 12V signal. This is the one you want to connect to the Arduino's input pin. Check the actual voltage here before you plug it in to the input pin since a mistake in the circuit could cause this to be above 5V in which case it would damage the Arduino.

@peterH - Thanks for the feedback!!

Here is an updated schematic... is there looking more correct?

I still haven't quite figured out how to check the signal/voltage coming from the brake light.

wholeo:
is there looking more correct?

No.

Connect the three resistors in series. This gives you two end points and two intermediate junctions.

Connect one end to Arduino ground, which should also be connected to vehicle ground.

Connect the other end to the 12V signal provided by your switch.

Connect the Arduino input to the intermediate junction which is closed to the ground end. Before making the connection, measure the voltage at this junction and confirm that it is 5V or less.