Show Posts
|
|
Pages: 1 2 [3] 4 5 ... 35
|
|
31
|
Using Arduino / Programming Questions / Re: LED Control using Cosm and ENC28J60 as ethernet shield.
|
on: May 08, 2013, 11:38:55 pm
|
|
He doesn't use HttpClient either. Both of these are for use with the W5100 shield, while the Ethercard handles the ENC.
It is noteworthy that there is an increasing number of determined heroes using the ENC on cosm. Now that I have a W5100 to fall back on, I am considering putting an ENC module on a proto board and joining tham. This is simply because it will fit easier in the box I have.
|
|
|
|
|
32
|
Using Arduino / Displays / Re: 4 digit display help
|
on: May 08, 2013, 11:30:03 pm
|
But all the pins have wires.
I meant the sockets on the Arduino. If that is what you mean too, then that is your next problem, hence my comment. I can't comment on the segment not turning off, other than that with all those transistors and resistors around, you are unlikely to have done any damage.
|
|
|
|
|
33
|
Using Arduino / Displays / Re: 4 digit display help
|
on: May 08, 2013, 09:49:13 pm
|
|
Well, that's a relief - and a good job well done.
Now might be a good time to count the pins without any wires in them, and then have a look at at that MAX7221 article.
|
|
|
|
|
34
|
Using Arduino / Displays / Re: 4 digit display help
|
on: May 08, 2013, 07:15:15 pm
|
The third way i don't really know anything about.
I'm afraid this is what you do need to know about. The tutorial you allude to uses the microcontroller to do that. Your display is common cathode, like mine. The digits are selected by grounding their cathodes. In short, you don't mess with the pins, that's Arduino's job, as shown ion the bottom diagram. No ground wire needed, unless you want to make the arduino redundant.
|
|
|
|
|
36
|
Using Arduino / Programming Questions / Re: Millis overflow
|
on: May 08, 2013, 09:18:43 am
|
if all your time calculations are done as: if ((later_time - earlier_time ) >=duration ) {action}
then the rollover does generally not come into play.
Thanks (No harm in resurrecting this, I guess) Are there instances where the rollover does come into play?
|
|
|
|
|
37
|
Using Arduino / Sensors / Re: Would this wind meter idea work?
|
on: May 08, 2013, 08:45:49 am
|
|
About the dumbest idea I have ever heard. You can be sure that, it was a good idea, everybody would be doing it and the regular anemometers would all be scrapped. Why don't you try an ultrasonic gas flow meter? I suspect it's not much smarter, but you might get a result.
|
|
|
|
|
38
|
Topics / Home Automation and Networked Objects / Re: Energy logging
|
on: May 07, 2013, 07:47:21 pm
|
i am desperate about the gas and the water I tried on both meters the get a signal with a sensitive hall sensor, but no succes. Also tried to read a number-wheel with a IR emittor-receiver but I cannot get a clear pattern from it. Here I ask for help : are there suggestions to be able to read those meters? Is there a possibility to read the strips at a number-wheel with a fine beam emittor en a receiver?
I submit that you might as well put your own sensor in the pipe, rather than mess around with somebody else's. I am using the same water flow turbines as Vittorio. They are working fine. You test their operation by gently blowing through them. Therefore they can work as gas meters as well. While this proves the point, I don't know how suitable they are in terms of operating range. You might find that a turbine designed for a low flow rate like this http://www.omega.com/Manuals/manualpdf/M5171.pdfmentioned here http://arduino.cc/forum/index.php/topic,164794.0.htmlis more suitable. Another is the Swissflow. Indeed there is a swag of small hall effect turbines around that are no good for mains water pressure but may actually be better suited for gas. The type Vittorio mentioned is only about $15 and thus may be worth getting just to try it out.
|
|
|
|
|
39
|
Using Arduino / Sensors / Re: ds1307 in arduino
|
on: May 07, 2013, 11:20:39 am
|
Two codes one to set //Arduino 1.0+ Only //Arduino 1.0+ Only // pre-set the time in the void then use reset button to set it!
#include <LiquidCrystal.h> #include "Wire.h" #define DS1307_ADDRESS 0x68 byte zero = 0x00; //workaround for issue #527
LiquidCrystal lcd(8,9,16,5,6,7);
void setup(){ Wire.begin(); Serial.begin(9600); lcd.begin(16, 2); lcd.clear(); setDateTime(); //MUST CONFIGURE IN FUNCTION printDate(); Serial.println("loopstart"); }
void loop(){ lcd.clear(); printDate(); delay(1000); }
void setDateTime(){
byte second = 30; //0-59 byte minute = 24; //0-59 byte hour = 0; //0-23 byte weekDay = 5; //1-7 byte monthDay = 19; //1-31 byte month = 4; //1-12 byte year = 13; //0-99
Wire.beginTransmission(DS1307_ADDRESS); Wire.write(zero); //stop Oscillator
Wire.write(decToBcd(second)); Wire.write(decToBcd(minute)); Wire.write(decToBcd(hour)); Wire.write(decToBcd(weekDay)); Wire.write(decToBcd(monthDay)); Wire.write(decToBcd(month)); Wire.write(decToBcd(year));
Wire.write(zero); //start
Wire.endTransmission();
}
byte decToBcd(byte val){ // Convert normal decimal numbers to binary coded decimal return ( (val/10*16) + (val%10) ); }
byte bcdToDec(byte val) { // Convert binary coded decimal to normal decimal numbers return ( (val/16*10) + (val%16) ); }
void printDate(){
// Reset the register pointer Wire.beginTransmission(DS1307_ADDRESS); Wire.write(zero); Wire.endTransmission();
Wire.requestFrom(DS1307_ADDRESS, 7);
int second = bcdToDec(Wire.read()); int minute = bcdToDec(Wire.read()); int hour = bcdToDec(Wire.read() & 0b111111); //24 hour time int weekDay = bcdToDec(Wire.read()); //0-6 -> sunday - Saturday int monthDay = bcdToDec(Wire.read()); int month = bcdToDec(Wire.read()); int year = bcdToDec(Wire.read());
//print the date EG 3/1/11 23:59:59 Serial.print(month); Serial.print("/"); Serial.print(monthDay); Serial.print("/"); Serial.print(year); Serial.print(" "); Serial.print(hour); Serial.print(":"); Serial.print(minute); Serial.print(":"); Serial.println(second);
lcd.print(monthDay); lcd.print("/"); lcd.print(month); lcd.print("/"); lcd.print(year); lcd.setCursor(0,1); lcd.print(hour); lcd.print(":"); lcd.print(minute); lcd.print(":"); if(second <10) { lcd.print("0"); } lcd.print(second); } The other to run //Arduino 1.0+ Only //Arduino 1.0+ Only
#include <LiquidCrystal_I2C.h> #include "Wire.h" #define DS1307_ADDRESS 0x68
// set the LCD address to 0x27 for a 20 chars 4 line display LiquidCrystal_I2C lcd(0x27,20,4);
void setup(){ Wire.begin(); Serial.begin(9600); lcd.init(); // initialize the lcd
// Print our characters on the LCD lcd.backlight(); //Backlight ON if under program control lcd.setCursor(0,0); //Start at character 3 on line 0 // Print a message to the LCD. lcd.print("Today it is "); }
void loop(){ printDate(); delay(1000);
}
byte bcdToDec(byte val) { // Convert binary coded decimal to normal decimal numbers return ( (val/16*10) + (val%16) ); }
void printDate(){
// Reset the register pointer Wire.beginTransmission(DS1307_ADDRESS);
byte zero = 0x00; Wire.write(zero); Wire.endTransmission();
Wire.requestFrom(DS1307_ADDRESS, 7);
int second = bcdToDec(Wire.read()); int minute = bcdToDec(Wire.read()); int hour = bcdToDec(Wire.read() & 0b111111); //24 hour time int weekDay = bcdToDec(Wire.read()); //0-6 -> sunday - Saturday int monthDay = bcdToDec(Wire.read()); int month = bcdToDec(Wire.read()); int year = bcdToDec(Wire.read());
lcd.setCursor(12, 0); switch (weekDay) // Friendly printout the weekday { case 1: lcd.print("MON "); Serial.print("MON "); break; case 2: lcd.print("TUE "); Serial.print("TUE "); break; case 3: lcd.print("WED "); Serial.print("WED "); break; case 4: lcd.print("THU "); Serial.print("THU "); break; case 5: lcd.print("FRI "); Serial.print("FRI "); break; case 6: lcd.print("SAT "); Serial.print("SAT "); break; case 7: lcd.print("SUN "); Serial.print("SUN "); break; }
Serial.print(monthDay); Serial.print("/"); Serial.print(month); Serial.print("/"); Serial.print(year); Serial.print(" "); Serial.print(hour); Serial.print(":"); Serial.print(minute); Serial.print(":"); Serial.println(second); lcd.setCursor(0,1); lcd.print(monthDay); lcd.print("/"); lcd.print(month); lcd.print("/"); lcd.print(year); lcd.print(" "); lcd.print(hour); lcd.print(":"); lcd.print(minute); lcd.print(":"); if(second <10) { lcd.print("0"); } lcd.print(second);
} All you need............
|
|
|
|
|
43
|
Using Arduino / Displays / Re: 4 digit display help
|
on: May 06, 2013, 11:24:30 pm
|
Ohh i meant as in, i saw how a single digit segment display was wired. So i took that and expanded it on what i thought the 4 digit segment display should be like. If i'm correct or not, idk.
OK just make sure you are using limiting resistors. If they are not in the kit, it doesn't mean you don't need them. it would be better if i did a diagram. Any software to lay it out easily?
Probably correct. I'm an architect so I just use my workaday CAD and I don't know about the dedicated stuff, but it is around. There is that Fritzing thing people use. I believe it is a freebie.
|
|
|
|
|
44
|
Using Arduino / Displays / Re: 4 digit display help
|
on: May 06, 2013, 08:28:32 pm
|
Would you care to elaborate on the wise but pointless?
You say you wired individual digits the same. This means you will have four digits displaying the same, rather than their own, data. However you also appear to have paid attention to the current requirements, thereby engaging on a pointless exercise, but not fatal. How would that guide help?
Don't ask, just read. If it's not particularly relevant now, it will be soon. Smaller and clearer? Want me to rearrange the wires
At the moment you have a huge picture that takes time to load and is tedious to view. Those silly enough to wait eventually find it says nothing, which is likely to piss them off mightily. When a wire disappears under a display, who knows where it's going? and those that don't know are not likely to care. You might have a better time of it if you just move the display down one row. A $2 kit of jumpers would give you some more colours. You won't regret that. I don't think the data sheet would have any differences just because they link the same data sheet for all 4 displays.
There may be minor differences in forward voltage with different colours, hence different current limiting resistors. I don't think this is particularly critical, just something you ought to be aware of.
|
|
|
|
|
45
|
Using Arduino / Displays / Re: 4 digit display help
|
on: May 06, 2013, 07:28:45 pm
|
i hooked my 4 digit display up the same except making adjustments for the increase in pin
Sounds like a wise move, but rather pointless. You might try checking here http://playground.arduino.cc/Main/MAX72XXHardwareAs you appear to have nothing like it. There are other methods, but this is about as simple as you can get. A smaller and clearer picture that is more representative of what is happening will get a better response. The data sheet you show may have a slight difference in the electrical characteristics.
|
|
|
|
|