Go Down

Topic: Combining analog input (Read 8679 times) previous topic - next topic


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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


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



Mar 07, 2011, 10:59 pm Last Edit: Mar 07, 2011, 11:08 pm by DragoslaV Reason: 1
Thanks alot for pointing out that noob mistake :smiley-sweat:
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.


Mar 19, 2011, 08:34 pm Last Edit: Mar 19, 2011, 08:43 pm by DragoslaV Reason: 1
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)?

Code: [Select]

void setup() {
 pinMode(19, INPUT);
 digitalWrite(19, HIGH);


Yes that should do it.  :)

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! :)

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 :D


Mar 23, 2011, 03:34 am Last Edit: Mar 23, 2011, 03:43 am by Cintax Reason: 1
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.

Go Up