Show Posts
|
|
Pages: [1] 2 3 ... 7
|
|
3
|
Using Arduino / General Electronics / Re: Choosing the right Capacitor for right Applications
|
on: April 01, 2013, 03:40:03 am
|
Ok i did get it now, thanks for the understanding. The led (with the 330 ohm resistor) can be connected to a pin of the Arduino. You don't need a transistor driver for that.
I know it can be connected directly, as for now it it connected like this, im simulating my output with leds only up to now. Since im having a power supply with 5.1 V and 24 V both, im driving the led voltage through the transistor, for i to reduce the current consumption to the max on my Uno board. Is that not neccessary ? I do also have 3 inputs in total, my LDR, Temp sensor and Soil Moisture sensor. Im using the external 5.1 V to power all my input and leds, reducing the current consumption on the Arduino, any suggestion if im right? The 1N4749 has no use at that point, please remove it.
Should i be using the flyback diode in that position instead. I don't know the HJ A42, what is that ?
http://www.hz-dz.net/UploadFiles/2009527102924201.pdfCan i use the same transistor, A 42 to drive my both fans? as you right about the IRF 540N, i dont know how i came up to here ..  I shall be looking over the links you posted here, and grasp a good understanding of things. Thanks taz
|
|
|
|
|
4
|
Using Arduino / General Electronics / Choosing the right Capacitor for right Applications
|
on: April 01, 2013, 01:27:53 am
|
|
Hello,
My question is how to choose the right capacitor, for the right application. I admit its kinda of very basic question here, i a bit confused with some of my search i did until now.
Im controlling a pump with my arduino, driving a transistor to supply a 24V power to the pump , i know i should be connecting a capacitor in parallel to the pump.
I did navigate on how to choose a proper capacitor, whereby i did learn that the capacitor voltage to be chosen must be equal to the voltage supply or higher, in terms of charging voltage. I also came across, that a resistor in series is also a good practise as to reduce the high current initially to the capacitor. Can anyone confirm if im right?
How do i still choose the capacitance value for my circuit. From ohms law, we should be using Q = CV. Bearing in mind that 1 amp is a charge of 1 coulomb past a point in 1 second, with the data i have in hand how should i calculate my farads value?
Voltage supply = 24V Pump current rating = 0.35A
I attached my circuits here, for a view on what im doing.
Thanks! taz
|
|
|
|
|
5
|
Using Arduino / Programming Questions / Re: Last stage debugging - Help !! [solved]
|
on: March 20, 2013, 02:42:47 am
|
|
Hello everyone,
Would like to thanks all of you who brought me much help in understanding and debugging my codes.
I did put it under observation for almost 1 week and found it working as expected. moving towards circuit building now.
Thanks again for your time.
Regards
Tazlim.
|
|
|
|
|
6
|
Using Arduino / Programming Questions / Re: need help with writing a program
|
on: March 15, 2013, 11:38:52 pm
|
Hello, About which jimboza, explained is really nice, printing your readings without using any input. that also me you understand difference between void setup and void loop .. The for loop concept is introduced,which can be use later for many many applications.. if you did understand this so far, you can try moving with your code with an input this time, like a potentiometer. an example as u suggested : // declaration of variables int ctr;
// declaration of I/O const int pot = 1; // potentiometer connected to pin 1 of analog pins on your arduino.
void setup {
Serial.begin (9600); // start serial communication at 9600 bps.
void loop {
int ctr = analogRead(pot); // read value of potentiometer and save it to the variable ctr you created above.
Serial.print (" Pot Read ="); Serial.println(ctr); // print values from your pot, will be 0 to 1023 wen playing with the pot.
// if statement :
if (ctr >= 1) {
Serial.print ("Reading 1"); }
if (ctr >= 8) {
Serial.print ("Reading 2"); }
// you can add whatever lines you want to print depending on your condition of ctr with the if statement ..
}
cheers ...
|
|
|
|
|
7
|
Using Arduino / Programming Questions / Re: Last stage debugging - Help !!
|
on: March 15, 2013, 03:56:11 pm
|
Hello everyone, It seems i undertood the philosophy behind the pump control, and why it was not working, and how it did work as present.  The thing i observed is before adding up the conditional function as displaying active and inactive onto the lcd. It did work very well, that is pump run for 7 secs and goes off, if moist percentage still under 85%, it runs again. Since my probe was kept in the air, my led would flashed off after a duration of 7 sec.
Today i did observed the real scenario taking place, as such, my Soil percentage value on lcd displayed around 83 %, with my led for pump lighted on, part of code concerned : void pumpControlON (){ if ( percentage_Moist <= 85.00 ){ digitalWrite(pump_Active,HIGH); pump_Status = true; } }
void pumpControlOFF (){ if (( millis() - lastPump >= timerRateX ) || (percentage_Moist >= 90.00)){ lastPump += timerRateX; digitalWrite(pump_Active,LOW); pump_Status = false; } }
Here is the control philosophy: If percentage moisture is < 85%, my pump is set to ON, and my timer start counting until 7 secs, if after this time duration, my percentage moisture is > 85% (we should not get confused here with the upper threshold of moisture percentage 90% set), my pump would go off after the counted millis algorithm reached its 7 secs. Remember i did underline that pump did go off, with the led flashing off, before adding,conditional function for displaying active and inactive onto the lcd, as reference to the above quote, i was wrong in pointing out the culprit  . At that time i was still running under code GreenHouse_Rev_F_04, where i noted that my serial port was still opened and running all my Serial commands.. These Serial.commands; explained why my led will flashed off after the 7 secs even when moisture percentage was showing 0 %, while my probe was in the air. As far as i did understood the cycle of the code, with the serial command lines running, the Uno(slowed) would have time to process the 7 secs millis algorithm, until it updated its percentage moisture. With program running under code GreenHouse_Rev_F_05, where the serial port communication is disabled, the Uno response time increased, the moisture percentage reading get updated before 7 secs millis algorithm is processed, and since % is reading < 85%, there will be no led flashed off, NO Pump Off . .  as mentioned above in the control philosophy. I did observed this whole situation, with the real scenario occuring today, where my soil moisture percentage was displayed with the value in the range of 83 to 87 % , this time i was not simulating dry soil in placing the probe in the air. Edit: Before resorting to serial, just using a pot to get a simulated moisture reading might help.
we were close . . .  Any suggestions, views and analysis are welcomed towards the observation made to confirm if i did understood it correctly. Thanks taz . . .
|
|
|
|
|
8
|
Using Arduino / Programming Questions / Re: Last stage debugging - Help !!
|
on: March 15, 2013, 01:17:57 am
|
|
I added the code lastPump = milli(); in the pumpControlON() while first commenting the line //lastPump += timerRateX;, to test if things changed, but unfortunately it remained the same..
So i commented it out, to return my code to original to see if there was any contrast between the change.
No change in behavior detected, but the thing which keeps tickling me,is how come it worked before I added the timer for the LCD, i did try to remove the timer for LCD to see if it works, but to no avail . . .
|
|
|
|
|
9
|
Using Arduino / Programming Questions / Re: need help with writing a program
|
on: March 14, 2013, 03:38:16 pm
|
You need to define variables where you will store any of your reading or values. Like jimboZA suggested. Before any "else if", there is always an "if", curly brackets follows your "ifs". As for printing on the serial port, you need code lines like Serial.print(" name of your variables"); Serial.println(variable);
Remember any single expression counts in the programming language. // ---> used for commenting anything you'd like to : you will observe that with the IDE, changing the line color to light grey, meaning inactivated. // Any comments goes here.
taz
|
|
|
|
|
12
|
Using Arduino / Programming Questions / Re: Last stage debugging - Help !!
|
on: March 13, 2013, 10:23:23 pm
|
Hello, I did try the change in updating lastPump to millis, when my pump is set to on, here also its not working as it should. changes brought to code: void pumpControlON (){ if ( percentage_Moist <= 85.00 ){ digitalWrite(pump_Active,HIGH); pump_Status = true; lastPump = millis(); } }
void pumpControlOFF (){ if (( millis() - lastPump >= timerRateX ) || (percentage_Moist >= 90.00)){ //lastPump += timerRateX; digitalWrite(pump_Active,LOW); pump_Status = false; } }
The thing i observed is before adding up the conditional function as displaying active and inactive onto the lcd. It did work very well, that is pump run for 7 secs and goes off, if moist percentage still under 85%, it runs again. Since my probe was kept in the air, my led would flashed off after a duration of 7 sec. May be there are too much things going on in parallel, like displaying percent moist, displaying if pump is active or inactive and checking if threshold value is reached. Any suggestion ?
|
|
|
|
|
13
|
Using Arduino / Programming Questions / Re: button trouble?
|
on: March 13, 2013, 02:39:22 am
|
|
Hi ,
I will suggest you to see the debounce state of push button using delays() first to get a good comprehension of the thing. and then move on with using millis().
Try using conditional functions as if ( reading == HIGH) { --- } instead of assigning everything to variables, just to grasp what happening behind the code.
....
taz
|
|
|
|
|
14
|
Using Arduino / Programming Questions / Re: Last stage debugging - Help !!
|
on: March 13, 2013, 02:21:27 am
|
Minor but you can remove some some code in that -
'lcd.begin' performs a ''lcd.clear'' 'lcd.clear' sets the cursor position to 0, 0
Will remove some codes as explained above... It looks to me as though you should set lastPump to millis() when you turn the pump on, not adjust it when you're turning it off.
As if i can see that working ..  , anyway i shall test it in the afternoon and update the post here. Thanks Regards Taz ..
|
|
|
|
|