Pages: [1] 2   Go Down
Author Topic: I am new to the Arduino  (Read 1030 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I wonder if anybody might have a clue to what has happened ? I am trying to run a 12 volt vehicular relay off an arduino uno and am using the 13 pin and the ground pins (2)  on the power out! I am running the pin 13 through a 330 ohm resistor and an optocoupler to a mini relay and the vehicle relay from this (mini relay) the idea is to programme the vehicle relay to fire (high) at say 4 secs and then (low) off for say 10seconds. I have programmed the arduino with an LED using the ground and 13 pin adjacent on the pin 13 bus and when I connect the relays etc in to the Arduino, the veh relay works (happily clicking on and off) but it only works at the same timing as the standard Uno indicator light speed ie around .5 high and say .5 low? can you please tell me have I blown something or should I re-programme the arduino to read relay instead of Led? and call the new programme something else? if so any advice re any new programme would be very gratefully recieved Thanks in anticipation, Rob, UK junction 9,M25
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

can you post the code ( highlight it and click on the # button to display it in a panel )
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

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

Hi Karma8  I am like many "new to Arduino users" I suspect, and am totally over-awed by its capability and flexibility. I now have it working as I want it to, thankyou so much for your kind offer. What I think happened, is that somehow the Aeduino didn`t recognose (as its own) the port that I usually use for it ie port 5 ( the easiest for me as iuts in the front of my PC) and it automatically thought it should be in 1? and I missed that, so as soon as I changed it to 5 it fired up OK and I managed to reprogramme it.

As I am a novice to the programming, I wonder if I can take you up on your kind offer, (I don`t know how to paste the programme as yet to the forum, but will soon find out I guess) I won`t waste your time I assure you,

What I am doing with the Arduino is using a single unit to operate a "burst" pump system using a solenoid valve "teed" off a peristaltic high (ish) pressure system and it works fine with a small 555 timer system at present, but I need to be able to change the bursts timing as the system calls for it ie micro secs etc I have as yet to sort the needed Arduino inputs etc and its early days as yet . Thanks again for your kind offer and help KIndest regards Rob.   
Logged

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

I am not sure how those two posts relate to the request for your code.

When asking a question it is best to use sentences with full stops at the end at leasrpt.
In case you have run out of them here are some to copy and paste
..................................................
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

our US members might find  ".................................................." an explanation of the "Grumpy" Mike  ???   :-)

(for others ,  English speakers call them "full stops" )
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12520
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have programmed the arduino with an LED using the ground and 13 pin adjacent on the pin 13 bus and when I connect the relays etc in to the Arduino, the veh relay works (happily clicking on and off) but it only works at the same timing as the standard Uno indicator light speed ie around .5 high and say .5 low?

Pin 13 is connected to the onboard LED to the LED will light whenever pin13 is high. If it's blinking at 0.5 seconds high and 05 seconds low then presumably that's what the sketch is telling it to do. Arduinos typically come with a 'blink' sketch preloaded so it is easy to just plug it in and see it do something, but when you want to define your own behaviour you would need to write and upload your own sketch. Have you done that? If so, please post the code.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

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

int ledPin = 13;                 
void setup()
{
  pinMode(ledPin, OUTPUT);     
}
void loop()
{
  digitalWrite(ledPin, HIGH);   
  delay(1000);                 
  digitalWrite(ledPin, LOW);   
  delay(1000);
}

.................................................Full Stops (if needed).................................................
The above code seemed to work after the initial problem with the port selection,  but now I would  seem unable to change the low and high periods?  from what I initially set them at, around:- low 10 secs and high 1 "sec" (thats short for seconds, GM) Any Ideas as to what I may be doing wrong? Other than grammatical errors? would be most gratiously recieved. Thanks in anticipation.
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

  digitalWrite(ledPin, HIGH);     // switches on the LED
  delay(1000);                     //    waits for 1000 milliseconds = 1 second, then :-
  digitalWrite(ledPin, LOW);   // switches off the LED
  delay(1000);                    //  waits for 1000 milliseconds again = 1 second,
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

California
Offline Offline
Faraday Member
**
Karma: 88
Posts: 3350
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The above code seemed to work after the initial problem with the port selection,  but now I would  seem unable to change the low and high periods?  from what I initially set them at, around:- low 10 secs and high 1 "sec" (thats short for seconds, GM) Any Ideas as to what I may be doing wrong? Other than grammatical errors? would be most gratiously recieved. Thanks in anticipation.
So the posted code works, you made modifications to it which you aren't going to show and the new code "doesn't work"? Start by posting the code that doesn't work using the CODE tags, telling us what you are expecting it to do and what it is doing.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 285
Posts: 25630
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Apologies for the confusion.
I split the topic when I thought (wrongly) the second post related to a different topic.
@OP, calling other members by their karma rating is tricky, for karma ratings, unlike stock prices, can only stay the same or go up.

@GM, the M25 is a fractal because, although it bounds a finite area, it take an infinite time to traverse, meaning it must be infinitely long.
« Last Edit: November 17, 2012, 12:49:38 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@AWOL

I thing junction 9 is the number of one of the parking bays in the M25 car park.
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

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

Boffin 1,  you are right Junction 9 is almost a car parking space off the M25 motorway smiley.
I think that I have it sorted now? code wise, however I am not completely sure. What I would like to do is programme the recipient relay to fire more than once,  i,e, fire four times in quick succession (say 0050) and then rest for say 8(ooo)  secs, but am not sure how to build multiple delays into the programme. The fast talking and very capable US lads in their tutotials ( AKA Mr Blom mainly) leave me behind from the start. Doh! I guess I`m just thick. Is there an existing site where I can copy and paste a similar existing programme and doctor it to suit?  thanks for your help so far.
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

  digitalWrite(ledPin, HIGH);     // switches on the LED
  delay(50);                     //    waits for 50 milliseconds = 0.02second, then :-
  digitalWrite(ledPin, LOW);   // switches off the LED
  delay(50);                    //  waits for 50 milliseconds again = 0.02 second,   digitalWrite(ledPin, HIGH);     // switches on the LED
  delay(8000);                     //    waits for 8000 milliseconds = 8 second, then :-
  digitalWrite(ledPin, LOW);   // switches off the LED
  delay(1000);                    //  waits for 1000 milliseconds again = 1 second,
delay ( 60000 );  //  wait 1 minute

and so on
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

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

Thanks so much for that "Boffin 1" I am nost grateful! I will copy and paste (deleting the indication statements) and let you know what Happens, thank you so much once again Kind regards Rob.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 285
Posts: 25630
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
waits for 50 milliseconds = 0.02second
Novel.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1] 2   Go Up
Jump to: