Pages: 1 [2]   Go Down
Author Topic: Combining analog input  (Read 1722 times)
0 Members and 1 Guest are viewing this topic.
Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 437
Posts: 23688
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31395
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31395
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Quote
that combine the voltage regulator and capacitors
No.
Logged

Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 07, 2011, 05:08:11 pm by DragoslaV » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31395
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

SW Scotland
Offline Offline
Edison Member
*
Karma: 13
Posts: 1316
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
void setup() {
  Serial.begin(9600);
  pinMode(19, INPUT);
  digitalWrite(19, HIGH);
}
« Last Edit: March 19, 2011, 02:43:34 pm by DragoslaV » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31395
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes that should do it.  smiley

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.
Logged

Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright! Thank you very much again for your help! smiley

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?
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31395
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sweet  smiley-cool Thanks for the info! Time to get this working now smiley-grin
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 45
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

http://www.maxim-ic.com/datasheet/index.mvp/id/1339

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.
« Last Edit: March 22, 2011, 09:43:50 pm by Cintax » Logged

Pages: 1 [2]   Go Up
Jump to: