taylorjonl
Mar 1 2010, 02:05 AM
I am working on an open source controller for my BC14 LED array and want some input from some electrical engineers.
My design works as below. There are 2 components, or shields in the context of Arduino.
The first shield is the BuckPuck shield that supports 4 BuckPucks that can be independently connected to 4 PWM channels on the Arduino. Each PWM channel is fed into a low pass filter to convert the digital signal to an analog filter. You can stack more than one of these shields to add more outputs if needed.
The second shield is the controller shield which has the RTCC and the EEPROM to hold the values for the PWM for each channel.
If I use the BatchPCB service from Spark Fun the total cost of the PCBs are around $30, but it will take a few weeks to get, want to validate my design prior to this since I am not an electronic engineer but am a software engineer.
evilc66
Mar 1 2010, 10:30 AM
Looks like a good start.
taylorjonl
Mar 1 2010, 05:12 PM
I forgot to mention, I plan on using the Ethernet Shield from Spark Fun or the BlueSMiRF(bluetooth) for communication. I would like to make it similar to a router where you have an embedded HTTP server for configuration.
I am pretty confident that the BuckPuck shield wiring is good, but the control shield is still under review. I guess I should just breadboard it out, would hate to wait 3-5 weeks for a PCB to find out I had a problem with my schematic.
cptbjorn
Mar 1 2010, 05:25 PM
Is there some functionality that the 1306 RTC has that the 1307 doesn't? It appears to be sucking up a bunch of inputs and board space...
evilc66
Mar 1 2010, 05:27 PM
Seems to be interupt driven, which really isn't needed for a simple LED controller.
taylorjonl
Mar 1 2010, 07:45 PM
I did look at the 1307 but I went with the 1306 because I wanted to do interrupts instead of polling. I understand it isn't needed but it is preferred and since I am not really short on PCB space I don't need to worry about space. It only consumes 2 more pins(CE + INT0) than the 1307 since I can't use the SPI pins because the ethernet shield requires SPI.
evilc66
Mar 2 2010, 12:55 PM
Sure you can use SPI. It's a multi node network serial protocol.
cptbjorn
Mar 2 2010, 01:26 PM
1307 is I2C and would use zero inputs since you already need I2C for the EEPROM. You can check out the 1337, it is an I2C RTC similar to the 1307 but with two interrupt pins.
taylorjonl
Mar 2 2010, 09:35 PM
QUOTE (cptbjorn @ Mar 2 2010, 11:26 AM)

1307 is I2C and would use zero inputs since you already need I2C for the EEPROM. You can check out the 1337, it is an I2C RTC similar to the 1307 but with two interrupt pins.
I also looked at the 1337, but it doesn't have a VBAT terminal, so you have to have more logic in order to switch over to a battery when power is loss. I don't think this additional logic is worth it for I2C since I would only save 1 pin(CE, remember I plan on using SPI for other components so can't recover those 3 pins).
My preferred RTCC is actually the DS3231, which integrates the crystal, but the form factor is SMD, which I can do since I have a hot air rework station, but I wanted others to be able to make this with minimal equipment, meaning through hole only.
I am currently trying to get the Arduino to even talk to the EEPROM which is I2C, I found the sketch that someone wrote that doesn't seem to work. I know the EEPROM works because I have a Bus Pirate and I can get it to work with 2 following conversations.
WRITE:
[0xA0 0x00 0x00 0x01]
READ:
[0xA0 0x00 0x00 [0xA1 r]
Here is the key:
] = START
[ = STOP
0xA0 = WRITE ADDRESS
0xA1 = READ ADDRESS
r = READ ONE BYTE
Semi frustrated and coming down with a cold so I may just mess around with something else for a while.
taylorjonl
Mar 3 2010, 07:42 PM
I found my problem, the actual address of the device is 0xA0 according to the Bus Pirate when I probe the I2C bus for addresses, but the Wire library does a left-shift, so I had to use 0x50. Also the Bus Pirate can only sniff at up to 80khz, the Arduino operates at 100khz by default, so I had to go into the Wire.c file and modify the bus speed to 50khz.
Testing the EEPROM now, my circuit is working there, so next move is to validate the RTCC is working.
strus_fr
Mar 5 2010, 09:50 AM
QUOTE (taylorjonl @ Mar 3 2010, 06:42 PM)

I found my problem, the actual address of the device is 0xA0 according to the Bus Pirate when I probe the I2C bus for addresses, but the Wire library does a left-shift, so I had to use 0x50. Also the Bus Pirate can only sniff at up to 80khz, the Arduino operates at 100khz by default, so I had to go into the Wire.c file and modify the bus speed to 50khz.
Testing the EEPROM now, my circuit is working there, so next move is to validate the RTCC is working.
Hi,
Did you see this thread:
Arduino Power LED shieldI think you should work together so we can buy at least one of this ... I have seen so many cool projects in dead-end ... I really count on yours or this one...
Good luck!
taylorjonl
Mar 5 2010, 09:18 PM
This is far from at a dead end, just a small road block, the flu

Been sick all week and haven't had the energy to finish. I have the actual 2nd layer pretty much finalized, just working on the 3rd layer, trying to breadboard the RTCC and EEPROM circuit before I lay down money for a PCB.
taylorjonl
Mar 7 2010, 04:41 PM
Verified all my hardware, circuits all work. Finalizing the PCB and starting on the software.
Regrettably I couldn't get the Arduino to work with a SS pin other than pin 10, which is what the Ethernet shield uses, so I won't be able to get ethernet working, but plan on a simple USB serial interface to program the dim profile or optionally the BlueSMiRF. Bluetooth would be nice, you could use almost any laptop to adjust the dim profile.
After I finish this I actually plan on moving away from the Arduino, not super pleased with the IDE and hardware, I really like the PIC32 from Microchip, has embedded NIC, RTC, more memory, more power and 16 USB endpoints. I also am hoping that the PIC32 is easier to use with multiple devices on the SPI bus. I have looked at some of the Microchip application notes and they are pretty good, and there are thousands of them.
taylorjonl
Mar 8 2010, 12:44 AM
So I have almost completed the Arduino software, need to start thinking of the PC software in order to configure the system. Anyone got any creative ideas? I am a software engineer mostly specializing in background processing, a GUI is not my specialty.
My first thought is that I will have a horizontal slider, with 2 points, the first being the time the lights turn on, the second when the lights turn off, then a vertical slider with 2 points, the first being the lowest intensity and the second being the highest intensity. Then using a simple X^2 equation for populating the values in a grid that can then be hand tweaked. If I was really good I would allow hand editing the curve but that would be a V2 or V3.
The Arduino software is fairly simple, it starts by first initializing the I2C and SPI interface. After it initializes the buses, it hits the EEPROM for the configuration. Next it sets the RTC to interrupt the next second. In the interrupt the EEPROM is queried for the values for each enabled channel, these values are loaded into the PWM using analogWrite. After this it sets the alarm to trigger at 0 seconds for the next minute, so after the first interrupt it will interrupt at the 0 second of each minute.
The software can configure up to 1440 individual points for each channel, that is 60 minutes x 24 hours, so you can tell it the intensity for each minute of the day.
dcmix5
Mar 8 2010, 02:02 PM
I have nothing to contribute, but would like to announce that this is WAY over my head.
taylorjonl
Mar 10 2010, 01:57 AM
Got the Arduino talking to my PC with a simple serial protocol. Communication is done through a packet, the packet structure is as follows:
typedef struct
{
byte command;
byte length;
byte payload[255];
} COMMAND_PACKET;
Then based on the command the payload will have a predefined structure. Not going to explain all the command payload structures but an example of the command to write a page in the EEPROM is below:
typedef struct
{
int address;
byte length;
byte data[252];
} COMMAND_WRITE_EEPROM_MULTIPLE_PAYLOAD;
Need to write commands to read/write the RTC then will start with the GUI.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.