Show Posts
Pages: 1 2 [3] 4 5
31  Using Arduino / Project Guidance / Re: "Smart" Power Strip on: August 27, 2012, 09:45:37 am
Thanks, but I've found a suitable solution for the display meanwhile smiley. I still haven't implemented it in this project, but I have already successfully used a 2-wire connection through a shift register and the NewLiquidCrystal library. I'm even thinking of trying the one-wire solution but that will require a latching SR, which I don't have at the moment. I've much improved my soldering skills, also smiley-cool.

I also already have similar relay boards for my tests, but without the optocouplers. They were the cheapest I could find in the EU. I'd love to get yours (the 30A one in particular!) but I'm always afraid of customs duties when ordering abroad. I'm waiting for some SSR's from HK and I'm hoping they won't get hold of them smiley.

PS: Hope you liked Genova, it's quite close to where I live!
32  Using Arduino / Project Guidance / Re: "Smart" Power Strip on: August 27, 2012, 04:52:28 am
Hi again,

a preview of my project is now available at http://arduino.cc/forum/index.php/topic,120299.0.html.
33  Topics / Home Automation and Networked Objects / SmartStrip - Yet another web GUI for relay control on: August 27, 2012, 04:20:06 am
Maybe it's a bit early to announce this, but I need help, comments, suggestions, beta testers, whatever smiley-sweat:

Quote
SmartStrip is a sketch for Arduino meant to allow advanced control of relays through a web interface. SmartStrip currently supports always ON/always OFF and temperature-controlled relays, i.e.: a relay can be configured to turn on when the temperature goes above/below a given threshold (with a given hysteresis margin). The temperature is measured through a DS18B20 sensor connected to any pin of the Arduino.
https://github.com/SukkoPera/SmartStrip

Probably the most important feature is that SmartStrip is compatible with both the official Ethernet Shield and ENC28J60-based shields, which makes it able to run almost everywhere. To achieve this goal, SmartStrip uses a library I wrote that I'm announcing as well:

Quote
Sukkino is a collection of libraries for the Arduino platform. I originally wrote them for my own projects but I think many arduinists can take advantage from them. It contains a universael webserver capable of delivering dynamic contents, a method for writing runtime assertions and one for reading/writing arbitrary objects from/to EEPROM.
https://github.com/SukkoPera/Sukkino

So here we go. I'm very open to suggestions, collaboration, questions, so just reply with your ideas smiley.
34  Using Arduino / Programming Questions / Re: Increased code size with global/local RAM accesses on: August 25, 2012, 06:39:00 am
Thanks for all your comments.

@majenjo: Good idea but unfortunately I'm not proficient in Atmega assembly.

@GoForSmoke: thanks but your comment is totally off question smiley.

@ PaulS: I guess it's a matter of taste/style, at my previous job I had to deal with lots of code like the following:

Code:
somearray[someindex].track.geodata.latitude.value = ...

Repeated for tenths of attributes. This is just plain silly and unreadable, IMHO. Sometimes the lines were so long that the right side of the assignment was out of the screen and you had to scroll to understand what was going on. Plus, if someone renamed, for instance, "geodata" to "position", you had to change it all over the place. Using the reference avoids all of this and the fact that you're using an array is actually explicited in the reference definition.
35  Using Arduino / Programming Questions / Increased code size with global/local RAM accesses on: August 24, 2012, 01:01:10 pm
The title is not too proper, sorry. Please read on: I had the following piece of code:

Code:
Relay relay = relays[i];

relay.delay = atoi (param);

This wasn't working properly, since of course I'm modifying a new temporary Relay instance, while I should work on the instance contained in the array. To make a long story short, what I wanted to write was:

Code:
Relay& relay = relays[i];

relay.delay = atoi (param);

Basically I just wanted to avoid having to type
Code:
relays[i]
every time, so I defined a reference to save some typing smiley. I know it's just a few chars in this case, but this is something I often do, as I think it also makes the code clearer. Anyway, before making the fix, the binary size was 28294, after that it was 28516: an increase of more than 200 bytes! Is this something expected?

It doesn't make much sense to me. I mean: this is not directly due to the reference, since if I just remove it and replace
Code:
relay
with
Code:
relays[i]
everywhere the code size stays the same. So the actual question is: is the code to access a global array so much bigger than the one that accesses the stack?
36  Using Arduino / General Electronics / Re: Delay LCD backlight turn off on: August 23, 2012, 10:54:31 am
Thanks a lot. This thread has been very helpful for me! smiley
37  Using Arduino / General Electronics / Re: Delay LCD backlight turn off on: August 20, 2012, 03:53:14 pm
I'm not driving the LCD through i2c at the moment. I am using the New Liquid Crystal library by Francisco Malpartida and I don't think it allows me to control the backlight, so I am using an "external" wiring for it. I2C communication happend on A4/A5, if I'm not mistaken, which I can't access on my board.

@Tom: Thanks for the explanation, but I actually knew how the different types of capacitors are made smiley. I was rather willingly to know what the difference is on the practical side, but I seem to understand it's mainly a difference in the capacity range right?
38  Using Arduino / General Electronics / Re: Delay LCD backlight turn off on: August 20, 2012, 01:54:12 pm
Just to clarify: I'm perfectly fine doing the delay in software, it was my first thought and that's what I'm doing now. It was even a good excuse to use interrupts smiley.

The point is that I started testing this LCD stuff on a small side-project, where I have lots of spare pins, but the real goal is to use the LCD in another project, where unfortunately I've run out of pins. There the board is a KMtronic DINo, which drives 4 relays and an ENC26J80. It only exposes D0/D1 (Used for serial data exchange), D2 (which I use to read a digital thermometer) and A0/A1, which I'll be using to drive the LCD via a two-wire protocol through a shift register. It has no other pins. At the beginning I was planning to light the display through a button wired directly to Vcc, but it has the "inconvenience" that you have to keep the button pressed. Since I can add a delay with just € 0,50, I guess I'll go that way smiley.

39  Using Arduino / General Electronics / Re: Delay LCD backlight turn off on: August 20, 2012, 01:42:44 pm
I've built both versions with success! A couple pics:

http://db.tt/n3IRqqkJ
http://db.tt/YmDs69Xf

(Please don't mind about wire colors, I'd run out of jumpers!)

I tend to prefer the 555 version, it is much easier to choose the R/C values to achieve the desired timing.

PS: What's the difference between ceramic and electrolytic capacitors then? How should I choose?
40  Using Arduino / General Electronics / Re: Delay LCD backlight turn off on: August 20, 2012, 12:06:36 pm
Thanks for all your suggestions! I've just been at my local electronics store and bought both a few 555's and a few BC547's, I'll experiment with both and see what I come up with!

@MarkT: Unfortunately they had no ICM7555. I was actually given ST SA555N. Are they any better than the original NE555's? I paid € 0,50 each. I also bought a few capacitors (0,60 each, not so cheap!), where would you recommend putting them with the SA555N? Oh, and the 10 uF I got are electrolytic, can I use these instead of the ceramic ones (which I thought were only in the pF range)?

@John_S: Very clever smiley: I'll try your trick, for curiosity's sake, but unfortunately I can't use it in the actual project, as I have no pins left at all.

@doughboy: I need two pins because the backlight is normally off and only gets switched on temporarily at the press of a button. So I need one input for the button and one output for the backlight.
41  Using Arduino / General Electronics / Re: Delay LCD backlight turn off on: August 18, 2012, 10:20:25 am
Thanks a lot, Tom, seems what I need: http://en.wikipedia.org/wiki/Multivibrator#Monostable_multivibrator_circuit.

Would you recommend some precise model of transistors I can use to implement the circuit? I've never used any, before.
42  Using Arduino / General Electronics / Delay LCD backlight turn off on: August 18, 2012, 05:23:56 am
I have a project where I use a LCD. To save power, its backlight is normally off, and I have a button that, when pressed, will turn it on for a few seconds to allow reading the display.

Now, this is done on the software side, and works great, but consumes two pins of the Arduino. Is there a *simple* way to achieve the same effect in electronics, I guess using a condenser?

Thanks!
43  Using Arduino / Programming Questions / Re: #include libraries in files other than main on: August 17, 2012, 06:20:22 pm
It's a separate class more in theory than in practice, since everything that is not in the sketch file is in a header file which is #included by the main sketch. Is there anything wrong with this approach?
44  Using Arduino / Programming Questions / #include libraries in files other than main on: August 17, 2012, 03:20:13 pm
I wrote a (badly) abstracted class that allows me to support both the ENC28J60 and the WIZ5100 Ethernet chips, through EtherCard and the official Ethernet library.

Basically I have a base class and then two different classes extending it that implement support for the two chips. Only one of them gets compiled at a time, depending on the value of a #define.

Everything is working great, but I have some problems with #includes. I would like to #include the relevant libraries only in the file defining the extended class, but if I do so, it seems the Arduino headers don't get included, as I get errors like:

Code:
In file included from HTTPRequestParser.h:25,
                 from WebServerBase.h:23,
                 from WebServer_ENC28J60.h:27,
                 from smartstrip.cpp:34:
Panic.h:60: error: 'byte' does not name a type
Panic.h:73: error: expected `)' before '_led'
Panic.h: In member function 'void Panic::infiniteBlink()':
Panic.h:65: error: 'led' was not declared in this scope
Panic.h:65: error: 'HIGH' was not declared in this scope
Panic.h:65: error: 'digitalWrite' was not declared in this scope
Panic.h:66: error: 'delay' was not declared in this scope
Panic.h:67: error: 'LOW' was not declared in this scope
Panic.h: In member function 'void Panic::setup()':
Panic.h:78: error: 'led' was not declared in this scope
Panic.h:78: error: 'OUTPUT' was not declared in this scope
Panic.h:78: error: 'pinMode' was not declared in this scope
Panic.h: In member function 'void Panic::panic(__FlashStringHelper*)':
Panic.h:94: error: 'Serial' was not declared in this scope
Panic.h: In member function 'void Panic::__assert_fail(const char*, const char*, int, const char*)':
Panic.h:106: error: 'Serial' was not declared in this scope

So, what I have to do is to put at the beginning of the sketch's main file:

Code:
#ifdef USE_ENC28J60
#include <EtherCard.h>
#else
#include <SPI.h>
#include <Ethernet.h>
#endif

#include "WebServer_ENC28J60.h"
#include "WebServer_WIZ5100.h"

But this breaks encapsulation, so I'd like to remove it. So there must be something I can't understand about the Arduino proprocessing. Can you help me?

The code is browseable at https://github.com/SukkoPera/smartstrip.
Thanks!
45  Using Arduino / Networking, Protocols, and Devices / Re: Can WiFi Shield go into adhoc (infrastructure) mode? on: August 17, 2012, 12:56:59 am
There is no "adhoc infrastructure" mode. Adhoc and Infrastructure are two different (and incompatible) modes.

So make up your mind and ask again smiley-wink.
Pages: 1 2 [3] 4 5