Combining analog input

I just dont get it why they didnt mention to put transistors between it in the playground

Sadly it is not a very good example, you will note there is no resistors in although the text now tells you to do this after some badgering from a few members. The lack of resistors and overwriting of the outputs probably meant the display looked ok. There is a train of thought that goes, it is only a demonstration and people will not run it for long so overload dosn't matter.
However I think that it is important to get it right as people, like you, go on and use the circuit as a basis to expand into their own design. If you start off with the right idea you don't have to relearn old stuff.

Thanks everybody and thank you Mike for clarifying that out!

Based on your input and based on this schematic, I have created a new schematic for myself including the multiplex and transistors. The transistors used in this schematic is a '2N3904'. Could I also use this for my setup??

Also I would love to hear if I made a(nohter) mistake in my schematics! :smiley:

The big block labaled transistors represents 6 more of the NPNs above?
You are missing the resistors between the arduino and the base pins as shown in the example you cite.
Need them to limit current out of arduino pin.

You might also look at ULN2803, 8 transistors all packaged up with needed resistors.
High input pin, output pulls LED cathode low.
http://focus.ti.com/lit/ds/symlink/uln2803a.pdf
ULN2803 is 46 cents at dipmicro.com

Yeah, that block should have represented 6 more of the NPNs like above. To be honest the new program I was using is frustrating as hell to work with so I just made it one block :roll_eyes:

Also thank you a thousand times for the ULN2803A tip! This will definitely save me time and wires! I'm now off to the store to buy the 4051 and the ULN

I heard there are no stupid questions compared with not asking at all so is the COM pin on the ULN2803A the same as the Emitter?

Or is this schematics correct?
(sorry the upload directory was full)

No, Ground is the pin that all emitters are connected to.
COM is the pin that would to go motor V+ if you had motors, or relay coils, etc.
You should be good as drawn.

Ahh, I think I get it now.
Thank you CrossRoads!

My only reservations are all the sensors going into the 4051. These have to have an output that is less than 5V. If the output ever goes above this then it will fry something. Given that it is a 12V system there is a danger that this voltage will be present on the sensors.

You're absolute right Mike, I should work out the v12 to v5.
This is my schematics of a single v12 input:

(hell yeah! I love Eagle already)

Quick question: are there any parts around that combine the voltage regulator and capacitors?

Do not use a voltage regulator to cut down a signal from a sensor into an arduino, it is totally the wrong thing to do.
You need to use either a potential divider, transistor or opto isolator.

that combine the voltage regulator and capacitors

No.

Thanks alot for pointing out that noob mistake :sweat_smile:
What is the best practice for a nooby?

Also let me remind you that the indicators are no sensor, just plain v12 battery going to a lamp.

Take the sensor output put it through a 10K resistor into the base of a transistor. The connect the emitter to ground and the collector to the input. Finally in the software enable the internal pull up resistor.

You might also want to consider fitting decoupling capacitors (0.1uF) across Vcc and Gnd on each of the chips to prevent noise affecting operation of the signals. These should be fitted as near the chips as possible.
jack

Sorry I been away for a while. Thanks for the replies!
If I understand you correct Grumpy_Mike I will get the follow result (in a nutshell)?

void setup() {
  Serial.begin(9600);
  pinMode(19, INPUT);
  digitalWrite(19, HIGH);
}

Yes that should do it. :slight_smile:

The transistor will get the pull up it needs through the multiplexer.

If it were me I would also put a 4K7 resistor from the collector of the transistor to 5V but this is not essential. It is just it would make the transistor behave correctly even if it weren't switched through to the arduino.

Alright! Thank you very much again for your help! :slight_smile:

I will also put the 4K7 resistor between it. Also I was reading that only the digital pins has pull-up resistors? So its wise not to connect it on pin #19 but on #13 and below?

only the digital pins has pull-up resistors

No all the I/O pins on the processor have internal pull up resistors, even the analogue ones.
You can also put external pull up resistors on analogue inputs.

Sweet 8) Thanks for the info! Time to get this working now :smiley:

You can free up almost all the I/O you are using to drive the LED matrix with a MAX7219 or MAX7221 for each display.

Also, keep in mind that you are not expressly using 12V here. Most charging systems actually sit around 14.5V to 15.5V. Motorcycles use a stator and rectifier which doesn't work in exactly the same as the alternator in your car to generate power. You will have voltage fluctuations at lower RPMs with charging (15.5V) occurring after 5000RPM.

Check your manual or measure voltage at different RPMs for exact values.