Pages: [1]   Go Down
Author Topic: arduino controller circuit  (Read 1299 times)
0 Members and 1 Guest are viewing this topic.
germany
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey there!

i was wondering if i can build up a little circuit for reading data from switches, potentiometers and piezo (and ive included leds that i want to control via pwm) like this (i uploaded a bad sketch i just did, i hope you can see what i mean, its a bit chaotic...):
http://i54.tinypic.com/ogbc6v.jpg

im really a beginner... some main questions are:
- can i use the 5v-output-pin for all of the components and, at the same time, use the digital pins for 5v output, like you see in the picture?
- did i choose the right resistor values?
- can i use the same ground pin for all of the GNDs in the picture?
- why do i have to put a resistor between the switch and the arduino ground? the digital pins do have a built-in resistor, don't they?

in case you can't recognize everything: i give 5v from arduino to 5 potentiometers, 5 switches (4 footswitches and a "handswitch") and the piezo. i read the data from the potentiometers into analog inputs A0-A4, from the piezo into analog A5, from the switches into digital pins 7, 8, 12 and 13, and i connected 4 LEDs to the digital pins (using those as an output) 5~, 6~, 9~ and 10~, also for pwm.

the resistors are 25k for the potis, 1M for the piezo, 1K for the LEDs and the switches

i use the arduino uno.

thanks a lot - also for tolerating my beginnerness

greetings,
jan
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31332
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can i use the 5v-output-pin for all of the components .....
Yes
Quote
did i choose the right resistor values?
No, use 220R (that's 220 ohms)

Quote
can i use the same ground pin for all of the GNDs in the picture?
Yes

Quote
the digital pins do have a built-in resistor, don't they?
No, if you didn't have the resistors you would short out the supply, you can't leave an input unconnected.
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html
Logged

germany
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks a lot for the link you gave me, mike, those are nice tutorials for beginners!

Quote
No, use 220R (that's 220 ohms)
what do you mean? where should i use 220R? everywhere? why?

Quote
No, if you didn't have the resistors you would short out the supply, you can't leave an input unconnected.
okay, so in the down right switch example, it doesn't matter if i put the resistor before the input pin or before the ground, right?
but does it matter if i put it before or after the switch? i mean i'm still talking about pull down switching...
Logged

germany
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

alright, i looked things over again, i changed my switches to pull-up switches, and the whole thing now looks like this:

http://i53.tinypic.com/2cmxm42.jpg

@mike: did you mean i should replace the 1 kOhm resistors between pwm-output and LEDs with 220 ohm resistors? i put in 470 ohm resistors now, because my LEDs forward voltage is 2 V and their forward current is 7,5 mA: http://www.fulcrum.ru/LineCard/Displays/PDF/LY_5469.pdf

1. are the 470 ohm resistors okay now?
2. are the switches okay that way?
3. im just repeating the question from my previous post here:
Quote
okay, so in the down right switch example, it doesn't matter if i put the resistor before the input pin or before the ground, right?
but does it matter if i put it before or after the switch? i mean i'm still talking about pull down switching...
4. i wasnt sure about the zener-diode-piezo-thing with the 1M resistor i read about in a tutorial... is it right this way or do i have to turn the zener or do i have to put the A5 (analog input) behind zener and resistor?

is there anything that you would do in a different way?

thanks a lot for any answers!

jan
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31332
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The zenner thing is wrong. You should put the petizo between A5 and ground, you should do the same thing for both the zenner and the 1M.
The resistors are right if you only want a small current in the LEDs, most LEDs take 20mA.
Logged

germany
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well, concerning the piezo, i did some huge mistake...
the piezo doesnt need to get the 5v, i want it to work as a sensor, kind of as a knock sensor
think i'm just gonna use it like this: http://www.arduino.cc/en/Tutorial/Knock
---> but there's the diode missing, could you tell me where exactly to put it then?
(if found this: http://www.arduino-tutorial.de/wp-content/uploads/2010/08/piezo.jpg - i'm talking about the right piezo, it's confusing me, i don't get the connections...)

---> if i lowered the resistor values of the ones before the LEDs to raise the current to, lets say, 20mA, wouldn't i draw 80mA from the arduino as i do this 4 times?

---> could anyone answer my switch-questions i asked in the previous post here? i'm still a bit confused about that

is there anything that speaks against using body contacts instead of the piezo for the analog input A5?
what i mean is:    5v --------thumbtack             thumbtack-------A5-----1k-resistor----GND
so that if you touch both thumbtacks, you have a voltage at A5, with your skin working as a resistor. people use that in diy circuit bending toy hack actions a lot and i wondered if i could use this to control software stuff.
---> is it dangerous for me - arduino will still be plugged into usb while in use? is it dangerous for the arduino? is it right to connect it like this?

thank you
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31332
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i'm talking about the right piezo, it's confusing me, i don't get the connections.
That is because there is a wire missing and one in the wrong place. The wire missing is to connect the ground to the diode cathode and the 1M and the piezo. The wire in the wrong place is the short circuit across the diode and 1M.

Quote
lets say, 20mA, wouldn't i draw 80mA from the arduino as i do this 4 times?
Yes, the arduino can source up to 200mA of current not more than 40mA from each single output so 80mA is well within this.
Quote
5v --------thumbtack             thumbtack-------A5-----1k-resistor----GND
You are exposing the arduino input directly to potentially lethal static. You might want to put a 100R in series with the input and put a 5V1 zenner across the input to protect it. It might work well enough but you will probably have to lick your fingers first. There is no danger to you doing this.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 547
Posts: 45973
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
you will probably have to lick your fingers first. There is no danger to you doing this.
Depends what you have on your fingers...
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31332
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

 smiley
Logged

Pages: [1]   Go Up
Jump to: