holymarder:
if it's enough how do you calculate or figure it out?
Questions to be answered:
Do I have enough I/O? Look at example sketches for each sensor and determine the I/O required. The MQ sensors require a single analog input, dust and DHT are digital with multiple pins for the DHT (I could be wrong about this), LCD is I2C so 2 digital pins, etc . . . You should be ok here, but I haven't done the math.
Do I have sufficient power for the sensors? Look at the power requirements for each sensor and see if you have the voltages with sufficient current to power them all. The MQ sensor heaters are fairly high current so you're going to need an additional source of power for these at least.
Does my code fit? This depends upon what your code does, but you could get a plausible upper bound by compiling example sketches for each sensor and totaling the resources required.
Do I have enough I/O? Look at example sketches for each sensor and determine the I/O required. The MQ sensors require a single analog input, dust and DHT are digital with multiple pins for the DHT (I could be wrong about this), LCD is I2C so 2 digital pins, etc . . . You should be ok here, but I haven't done the math.
Do I have sufficient power for the sensors? Look at the power requirements for each sensor and see if you have the voltages with sufficient current to power them all. The MQ sensor heaters are fairly high current so you're going to need an additional source of power for these at least.
Does my code fit? This depends upon what your code does, but you could get a plausible upper bound by compiling example sketches for each sensor and totaling the resources required.
yes i think i have enough I/O. i can run the lcd module and RTC, SCL and SCA on both same line right?
I ran all these together. it doesn't power up all the modules properly. however when i add the usb cable it lights up all of it. but i dont think the wifi shield are connected because i ran this;
/* Grove - Dust Sensor Demo v1.0
Interface to Shinyei Model PPD42NS Particle Sensor
Program by Christopher Nafis
Written April 2012
http://www.seeedstudio.com/depot/grove-dust-sensor-p-1050.html
http://www.sca-shinyei.com/pdf/PPD42NS.pdf
JST Pin 1 (Black Wire) => Arduino GND
JST Pin 3 (Red wire) => Arduino 5VDC
JST Pin 4 (Yellow wire) => Arduino Digital Pin 8
*/
#include <WiFi.h>
#include <Ubidots.h>
#include <SPI.h>
char ssid[] = "freewifi";
char pass[] = "aintfreewifi";
String api = "f193f9efa08c7fc1ae7ab0da56b6fc8b375b15a0";
String dust = "556ec1737625425fb28692d5";
Ubidots ubiclient(api);
int pin = 8;
unsigned long duration;
unsigned long starttime;
unsigned long sampletime_ms = 30000;//sampe 30s ;
unsigned long lowpulseoccupancy = 0;
float ratio = 0;
float concentration = 0;
void setup() {
Serial.begin(9600);
pinMode(8, INPUT);
starttime = millis();//get the current time;
boolean response;
int status = WL_IDLE_STATUS; //we need to define first a WL_IDLE_STATUS for the network
Serial.begin(9600); //9600 baud for serial transmision
response = ubiclient.WifiCon(ssid, pass, status, api); //this function is to connect to your wifi network
Serial.println(response);
}
void loop() {
duration = pulseIn(pin, LOW);
lowpulseoccupancy = lowpulseoccupancy + duration;
if ((millis() - starttime) > sampletime_ms) //if the sampel time == 30s
{
ratio = lowpulseoccupancy / (sampletime_ms * 10.0); // Integer percentage 0=>100
concentration = 1.1 * pow(ratio, 3) - 3.8 * pow(ratio, 2) + 520 * ratio + 0.62; // using spec sheet curve
Serial.print("concentration = ");
Serial.print(concentration);
Serial.println(" pcs/0.01cf");
Serial.println("\n");
lowpulseoccupancy = 0;
starttime = millis();
}
// sensorValue = analogRead(sensorPin);
if (ubiclient.save_value(dust, String(concentration))) //this function is to post to ubidots and return True or False depending on the connection status
{
Serial.println("The sensor value " + String(concentration) + " was sent to Ubidots"); //print the sensor value
}
}
and on serial monitor it displays that "the wifi shield are not connected".
how do i calculate the amount of power needed? each of these modules requires 5v to run them.
Yes, can be done. Might need more current then the on board 3.3V and 5V regulator can supply (~150mA from 3.3V, and maybe 500mA from 5V is 7.5VDC is used at the Mega barrel jack).
May need some 3.3V to 5V, or 5V to 3.3V adapters.
Read the sensor datasheets to see how much current is needed.
Those gas sensors alone look like they hit the limits of the board on their own and wifi is typically pretty power hungry too when transmitting. So you're going to need an auxiliary power supply...
"The MQ7 requires a heater voltage that cycles between 5v (60s) and 1.4v (90s), drawing approximately 150mA at 5v which exceeds the power capacity of the Uno.. "
You should have enough sensor inputs. but you will need and extra 5 volt power source for all the sensors. Basically connect all the sensor outputs to the arduino inputs, but the sensor Vcc and GND, hook to an auxiliary power source (and tie all the grounds together. Adding the LCD and the other missing gadget you may be over 1.5A
You could make 2-3 independent 5 volt sources with 7805's (one powers some sensors, the other powers the other, and so on), but again hook the grounds together. If you make your own 5 volt supply, make sure you size your transformer and rectifier accordingly.
"The MQ7 requires a heater voltage that cycles between 5v (60s) and 1.4v (90s), drawing approximately 150mA at 5v which exceeds the power capacity of the Uno.. "
Kindly guide me, im getting confused as i read more into electronics
if you cannot find all the data from one data sheet, look for another. preferably the manufacturer's sheets.
the MQ-7 is a carbon monoxide detector.
uses 1.4 volts, rises with higher concentrations.
the sensing material, SnO2, will adsorb the gasses and become inaccurate.
you heat it with 5v for time period to burn off the gasses and then start again.
for power :
Heating resistance 33Ω
Heating voltage (high) 5V
ohm's law, V=IR or, in this case I=V / R
current = 5 / 33
current = 0.1515 amps
current - 151.5 mA
so im not sure if im doing this right but so far i calculated that i need at least 1.3A to power all these 5v modules.
The RF transmitter requires 12v for maximum transmitting.
If i use an LM7805 to power arduino and these modules, i can't provide sufficient amps because lm7805 only provides 1A at max.
correct me if im wrong.
probably better to get a 3 amp 5v supply and power everything from that.
not sure what power you intend to provide, but if you use 12VDC and an LM7805, expect it to get hot.
probably need more than one. keep the load under about 80% of maximum.
KrisKasprzak:
You should have enough sensor inputs. but you will need and extra 5 volt power source for all the sensors. Basically connect all the sensor outputs to the arduino inputs, but the sensor Vcc and GND, hook to an auxiliary power source (and tie all the grounds together. Adding the LCD and the other missing gadget you may be over 1.5A
You could make 2-3 independent 5 volt sources with 7805's (one powers some sensors, the other powers the other, and so on), but again hook the grounds together. If you make your own 5 volt supply, make sure you size your transformer and rectifier accordingly.
that's a good idea. how about an LS7805?
dave-in-nj:
if you cannot find all the data from one data sheet, look for another. preferably the manufacturer's sheets. https://www.pololu.com/file/download/MQ7.pdf?file_id=0J313 http://www.dfrobot.com/image/data/SEN0132/MQ-7.pdf
the MQ-7 is a carbon monoxide detector.
uses 1.4 volts, rises with higher concentrations.
the sensing material, SnO2, will adsorb the gasses and become inaccurate.
you heat it with 5v for time period to burn off the gasses and then start again.
for power :
Heating resistance 33Ω
Heating voltage (high) 5V
ohm's law, V=IR or, in this case I=V / R
current = 5 / 33
current = 0.1515 amps
current - 151.5 mA
thank you! i understand now
dave-in-nj:
probably better to get a 3 amp 5v supply and power everything from that.
not sure what power you intend to provide, but if you use 12VDC and an LM7805, expect it to get hot.
probably need more than one. keep the load under about 80% of maximum.
i thought of using a 5v 3amp power suppy but the RF module requires 12v for maximum transmission power.
edited: can i link both RTC's and LCD's SDA-SDL line on the same port?