Show Posts
Pages: [1] 2
1  Products / Arduino Due / Re: DMX on Arduino DUE (DMXSimple/DMXSerial) on: May 23, 2013, 10:31:36 pm
+1 bump
2  Products / Arduino Due / Re: Due EEPROM alternative? SD? on: February 01, 2013, 07:41:42 am
So the DUE does not have internal EEPROM at all?
3  Products / Arduino Due / Website SPI correction needed. on: January 28, 2013, 01:22:01 am
I'm sorry if this has already been address or discussed.  I just got my Due and have not been following the forums.  I was trying to understand the SPI on the due and noticed some things.  There is no indication on the board of the orientation of the 2x3 SPI header.  I could only find the answer by looking at the pinout post here or testing for the power pins.  There should be some indication on the website and/or silkscreen of pin 1.  Then I noticed the ICSP header and was confused as to the difference until looking at schematic and seeing it is only for the U4.  Maybe I'm unaware that the SAM cannot be ICSPed then?  Either way its header was labeled as "SPI" on the silkscreen but on the SPI page in the connections table it shows the pins labeled as ICSP-x for the Due.  I could see people connecting SPI devices to the U4.
Also, and this is probably answered somewhere else (forgive me please) but why is the SPI header and the two connections by pin 22 5V when nothing on the board can handle 5V?  Is this for mega shields?
4  Using Arduino / Installation & Troubleshooting / Leonardo mouse and keyboard issues on: June 09, 2012, 11:14:05 pm
I just got my Leonardo and was excited to try the mouse and keyboard features.  I have had much trouble with both.  The keyboard seems to only somewhat work.  Sometimes a very press and release of a single key (with a delay) with notepad open doesn't work.  Also the logout example doesn't work.  Ctrl+Alt+Del doesn't seem to work.  I can't really explain exactly what issue I'm having with keyboard other than mostly not working.  I'm running windows vista BTW.

How is the mouse.move suppose to work?  What number do I put for the ints?  I thought it was maybe the number of pixels but that is clearly not the case.  I tried to move -1440, -900 to corner the mouse then move 720, 450 to center it from wherever it was but that just makes it jump around a bit.

Any ideas appreciated, Thanks!
5  Using Arduino / Project Guidance / Re: Digital 12 socket light dimmer. For christmas! on: December 12, 2011, 02:01:22 pm
6  Using Arduino / Project Guidance / Re: Digital 12 socket light dimmer. For christmas! on: December 01, 2011, 08:25:14 pm
Update:  The forums seemed to be down earlier and I had some extra time so I connected to the secondary with a resistor only and voila! perfect zero crossing detector.  I'm sure if there was some sort of inductive or capacitive load on the secondary this would mess things up but it only runs the uC.  I'll try to post a video sometime.  I'm off to write the new code, hope it is as simple as I think it will be.
7  Using Arduino / Project Guidance / Re: Digital 12 socket light dimmer. For christmas! on: November 30, 2011, 11:04:56 pm
Sorry I didn't get back to you.  I used it for Halloween and had it flicker for a "loose wire" simulator.  The digital control works well and I decided to forget the IR for now in place of bluetooth!  I made a socket inside for a RN-42 module I move around to whatever current project I'm working on and I send it commands from my phone with a program designed in AppInventor.  Also works well but I need some emergency help on the dimming.  I absolutely cannot get solid code to work well for dimming.  I have lots of snippets that sort of work under certain conditions (one light, one level, etc) but I'm incredibly frustrated and the Christmas tree is ready.

I really need to fix the phase thing and then dimming should be incredibly easy.  What I would like to know from the community is how a LED (ac optoisolator) will respond to being driven off the secondary of the transformer.  When resistor only driven will the response be in phase with primary mains voltage?  I think it would also be 90 out out of phase so then I can maybe see about RC driving the LED but my voltage may be too low (the capacitor would need to be pretty big).  What do you think?  Your quick responses will be greatly appreciated.


EDIT:  Basically I can only drive from mains with a RC combo (thus causing my problem) and may only be able to use a resistor from the secondary for the opposite reason. I think my secondary is only about 7vac thus needing only about 500 ohms of resistance/reactance.  (a 5uF cap + R100 then)
8  Using Arduino / Project Guidance / Re: Digital 12 socket light dimmer. For christmas! on: September 25, 2011, 05:28:18 pm
After reversing the action of the software and turning on after a delay, things worked just as bad.  I hooked up to a real oscope at school today and found what seems to be the problem.  Now the question is how to fix it.  My zero cross trigger is 90deg out of phase.  It triggers on the peaks and valleys.  I suppose a quick fix would be to delay roughly 4ms extra but I am very puzzled on why it is not performing how I expect it to.  Below I have included a basic schematic of my ZC detector and of the observed waveform.  The black led is part of the opto (blue)--its AC input.  Input resistor is 1k and the cap is somewhere in the .1 to .3uF range (don't remember-its SMD and doesn't say)  My only thought was that the led wasn't turning on until mains was nearing 170V but this would show the output peaking downward not upward (to 5V).  Any ideas?

EDIT BAhhhh I got the same exact results in a simulation as well.  What the heck am I missing?
9  Using Arduino / Project Guidance / Re: Digital 12 socket light dimmer. For christmas! on: September 14, 2011, 06:14:34 pm
Thanks guys for the responses.  I've been delayed by a more time sensitive project but was briefly looking at the code again today.  Some good advice on the set low once thing.  I was thinking a triac had to be of the zero crossing type to shut off at the cross but now that I think of it, I believe ZC or no ZC only applies to the optocoupler and thinking of a single SCR it makes sense that a triac cannot be shut off mid cycle.  I did test a few of the pins with simple high and low and they worked fine.  After I complete my other project, I'll get back to this and invert the theory.

EDIT Just so I'm straight on this--it takes less time to check a value in a boolean array then to simply tell the pin to go low when it already it?
10  Using Arduino / Project Guidance / Digital 12 socket light dimmer. For christmas! on: September 09, 2011, 11:09:56 pm
I am making a digital 12 dimmer light control system for Christmas lights.  I am using a ATmega328 on a custom board with external 16MHz crystal at 5V.  I'm in the US so mains is 120VAC RMS at 60Hz.  I have an AC input, transistor output optocoupler connected to a hardware interrupt to detect zero cross.  The antiparallel leds in the optocoupler are driven using a series capacitor and resistor straight from the mains.  My outputs are Arduino pins 6-17.  These drive DC input, triac output optocouplers which drive triacs.

My theory is to detect a zero cross and then turn on any pin not marked for off.  I then scan an array which contains the percentages for each outlet.  This number is mapped to 0 to 8333 representing the time, in microseconds, after the zero cross to turn the pin back off.  This array then needs to be scanned at least 100 times between each zero cross for 1% resolution.

I set the outlets in 10% increments to showcase the dimming.  Right now I get what appears to fully on down to 30%.  20% flickers and surges badly and 10% strobes/flickers but is consistently dim.  This was tested on a 40w incandescent light bulb.  I believe it to be a software issue and that is why I am here but I have included a basic hardware explanation in case.

I originally had the interrupt function call "on" (which calls dim) but this did not work as the code either still thought it was in an interrupt (crippling timing functions) and/or, because the interrupt pulled the program out of dim, dug a continuously deeper loop until freezing.

#include <IRremote.h>
#include <IRremoteInt.h>

int level[] = {
  0, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10,100,100};//percentage on
//    1   2   3   4   5   6   7   8   9   10  11  12  :sockets-zero is placeholder

//int program = 0;
int x;
int limit = 11;                      //sets the number of sockets used.  set to 12 to use all.
//unsigned long milli = 0;
unsigned long micro = 0;
volatile boolean interruptv = false;

void setup(){
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(14, OUTPUT);
  pinMode(15, OUTPUT);
  pinMode(16, OUTPUT);
  pinMode(17, OUTPUT);
  pinMode(3, INPUT);
  digitalWrite(3, HIGH);
  attachInterrupt(1, interrupt, FALLING);

void loop(){
  if (interruptv)

void interrupt(){
  interruptv = true;

void on(){
  //delayMicroseconds();          //possibly accounts for time after trigger but
  interruptv = false;             //before zero cross (Vin is below voltage necessary to turn on ZC sensing leds.
  for (x = 1; x <= limit; x++){
    if (level[x] > 0)
      digitalWrite((x+5), HIGH);  //turns on all the plugs not set for off at the ZC

void dim(){
  micro = micros();                //sets time of ZC
  while(!interruptv){              //do until next ZC
    for (x = 1; x <= limit; x++){//continuously look through the set levels to see if any need to be turned off.  This should run at least 100 times every 8ms.
      if( ((map(level[x], 0, 100, 0, 8333)) <= (micros() - micro)) && (level[x] < 100)){ //this should run every (limit * 100) every 8ms
        digitalWrite((x+5), LOW);//turns lights off once their percentage of the 8ms cycle is complete.

I did some calculations and I think I had come up with 900 some clock cycles per percent of dimming.  I would think this is enough but I could be wrong.

Any help would be appreciated.

11  Using Arduino / Storage / SD card variable file name on: September 02, 2011, 11:18:06 pm
I am creating the charges logger for a vending machine rebuilt to use RFID cards.  I would like so after every time the card is removed and replaced a new file is created with the current date.  I am using the SD library so the statement in question is file ="filename.txt", FILE_WRITE); I have an RTC which puts each element of time/date into an int so I have an int minute, int hour, and so on.  I am just starting to try to put minute as the file name but I will need to put pieces together to achieve a full date.  Also, I would need to be able to append a number if there is a duplicate file name as I probably will not use seconds in the file name (or maybe I could).  And finally, I don't how to get the .txt in as I don't want my client to have to modify the file name.  (The txt file gets pasted into excel for processing.)

I know I need some sort of character array but I can't get anything to work.  I am thinking "String - object" may be the right path but that's not working for me either.

Help is always greatly appreciated,

12  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino 0017 ignoring preferences.txt? on: June 26, 2010, 03:50:54 pm
I have not been able to get preferences.txt to ever work on the last several versions.  Currently I'm using Arduino 18 on a Vista-32 machine.  For starters I try to make the text bigger and Arduino doesn't seem to recognize anything has changed.  I make sure the IDE is closed when editing.  When I reopen preferences my changes are still there.  (Still says 14 instead of 12).  Do I have to do something special when I save it?

EDIT:  Text size is a bad example.  Just realized I can change it through the IDE but I still would like to know how to make it work.
13  Forum 2005-2010 (read only) / Interfacing / Re: how to use Cellular Shield with SM5100B on: January 24, 2011, 12:39:48 am
Mine simply repeats SIND 1 and SIND 10 about every 10 seconds with about 5 characters of jibberish in between.  Does anyone know what could cause this?  If I'm lucky I may get a SIND 3 after 10 minutes and once got a SIND 4 and SIND 7.  I'm using the development board connected directly to a computer and have change BR to 9600 and band to 7.

Help would be hugely appreciated.

14  Forum 2005-2010 (read only) / Development / Re: Help getting the FTDI to talk to atmega168. on: July 01, 2010, 09:41:02 pm
WOOOOOOOOOOOOO  FIXED!  So I put a meter on the reset at the icsp and noticed that the line was low during the entire upload attemp.  I replaced the 100ohm with a .1uF I had as extra and it works fine.  Thank you ITead for your help.  The diecimila schematic almost seems to be wrong then.  Maybe a older FTDI chip or something.  I also want to note for others if they encounter this problem that my avrisp had a blinking orange light when it was connected and power to the board was NOT connected.  This would usually be red.  Once power was applied to the atmega it went green (normal).  This was non-dependent of whether the usb was connected.

 ;D smiley-grin smiley ;D smiley-grin smiley :smiley
15  Forum 2005-2010 (read only) / Development / Re: Help getting the FTDI to talk to atmega168. on: July 01, 2010, 08:45:17 pm
I was wondering about that.  On the diecimila schematic DTR and RTS are both connected to reset through their own 100 ohms.  I combined the two resistors for space reasons figuring it wouldn't matter.  On the duemilanove RTS is through a 100ohm and DTR is connected with a cap.  I tried manually resetting with a cap but didn't help.  I have reset pulled up with a 10k.
Pages: [1] 2