"The Brick" - All In One - Arduino Platform Compatible

Hello,

Just thought I would share the project I am currently working on.

This is "The Brick", a All-In-One board which features a AtMega2560 and 3 AtTiny84's, with the following I/O.

18 General Purpose IO, PTC Fused with Zeners, capable of handling up to 30VDC inputs 12 Digital Outputs, which you can select for 5V or 24V output, capable of being PWM'ed, (3x L293D chips). 6 Relay Outputs (30VDC @ 10A, 240VAC @ 10A - Resistive Load, or 28VDC @ 5A, 120VAC @ 5A - Inductive Load) 8 Single Ended Analog Inputs 12 bit 16 Bit (Selectable from 0-5V or 0-10V) or 4 Diffrential Inputs (Selectable input ranges within 0-5V or 0-10V) (MCP3208 ADS1115) 4 Analog Outputs, 8 Bit 12 Bit (0-10V) (MCP4728) 3 High Speed Inputs capable of handling up to 30VDC inputs (These are the 3 seperate AtTiny84's, talking to the AtMega2560 over SPI) USB Programming and Serial port like the Arduino (UART0) RS232 Comms (UART1) RS485 Comms (UART2) - With Power on the socket to supply slave boards (fed from Adjustable Supply, mentioned below) It supports either Bluetooth (Sena Bluetooth Module) or XBee Module for wireless comms (UART3) Real Time Clock (DS3231S) External EEPROM (24LC256) Micro SD Card Flip-Lid Socket

5VDC Switchmode power supply on board, capable of 2-3A (LM2596S-5.0) Adjustable Switchmode power supply, designed with 24VDC in mind however adjustable from 10V to 24V, capable of 2-3A also. (LM2596S-ADJ)

Here is a picture of the PCB:

Here is a rendered picture of the PCB is the case, top removed:

Here is a rendered picture of the case closed up, back view:

I am just finalising it at the moment and hope to get the first prototypes ordered this week.

:)

James

Another render, with plugs in one side.

3.81mm screw plugs.

James

Great-looking board Wanago, talk about a Mega on steroids :)

Any price guesstimates yet? I'm guessing it won't be cheap but then it's a lot more "industrial strength".


Rob

That is quite an ambitious board. Of the features, I would only have liked to see 12 bit DAC or even 10 bit DAC over the 8 bit you listed.

Good luck with the project.

Lefty

Thanks :)

I was thinking about high resolution for the DAC also - its still a possibility. Might look at that now actually.

Rob - watch this space, just waiting for the quote back for assembly for the prototype. Prototype will be more expensive than the final product, but will at least give an estimation.

Cheers James

Oh and for the people looking, this wont be a $40 board like the Mega etc, it will be more - but is intended to be used as the final product, and not as a prototyping board. I am creating this for my own use, a local guy here and for a guy in the UK. That said though, if others are interested then I have no objection to making some for others. I have another company looking at this for feasibility of sale etc, so it could be for sale at some point. Again watch this space :)

"8 Analog Inputs 12 bit (Selectable from 0-5V or 0-10V)"

Support for AC signal instead, +/-5v What data rate on that?

Right now its only 0-5 or 0-10 sadly...

I will have a look at whats involved to get it to do +/-5...

Its 100k Samples/s

using this: http://ww1.microchip.com/downloads/en/DeviceDoc/21298E.pdf

Hope that helps

Cheers James

WanaGo: Right now its only 0-5 or 0-10 sadly...

I will have a look at whats involved to get it to do +/-5...

Its 100k Samples/s

using this: http://ww1.microchip.com/downloads/en/DeviceDoc/21298E.pdf

Hope that helps

Cheers James

I've been having a lot of fun playing with a TI ADS1115 16 bit I2C ADC chip. Works at 3.3 or 5vdc, has like five gain settings down to +/- .256 vdc, 4 channels single ended or 2 channels differential. Makes it useful to read Wheatstone bridge type sensors without needing external op-amps. Build in comparator function also. Only 960 SPS however. Check it out.

http://www.ti.com/lit/ds/symlink/ads1115.pdf

Lefty

Ok changes in progress, 12 bit DAC is being added, which will replace the 4x 8bit DAC outputs currently on the board.

MCP4728 is the weapon, and what do you know - someone has a library for it already - perfect.

Perfect spot for it on the board too, will be done in a few mins.

Cheers James

retrolefty: I've been having a lot of fun playing with a TI ADS1115 16 bit I2C ADC chip. Works at 3.3 or 5vdc, has like five gain settings down to +/- .256 vdc, 4 channels single ended or 2 channels differential. Makes it useful to read Wheatstone bridge type sensors without needing external op-amps. Build in comparator function also. Only 960 SPS however. Check it out.

http://www.ti.com/lit/ds/symlink/ads1115.pdf

Lefty

Great, I will have a look at that - thanks.

960 SPS isnt anything to snuff at anyway, thats quite respectable in my opinion.

I will take a look once I sort this DAC :)

Great, I will have a look at that - thanks.

960 SPS isnt anything to snuff at anyway, thats quite respectable in my opinion.

I will take a look once I sort this DAC

Cool. Here is a check out sketch I wrote last weekend to test out it’s capablities:

/* Basic testing and check out sketch for a TI ADS1115 4 channel 16 bit I2C analog to digital converter chip.
   Reads voltage at desired range on desired channel and displays it on serial monitor. Also allows comparitor
   to output a active low signal pin if enabled.
   
   Leftyretro 08/10/11
*/

#include <Wire.h>

int topofScale;          // global to use adc range value to display millivolt reading conversion
int hiCompair = 17000;   // high setting for comparitor threshold value, must be higher then loCompair 32767
int loCompair = 11000;   // low  setting for comparitor threshold value, must be lower then hiCompair -32768


void setup() 
  {
    Wire.begin();           // join I2C bus
    Serial.begin(38400);    // initialize serial communication 
    setadcConfiguration();  // configure ADS1115 chip for range, channel input, and comparitor options desired
   }
   
void loop() {
    int   rawValue;       // holds 16 bit result read from A/D device
    int   scaledValue;    // to convert to millivolts
     
    Serial.print("Analog input #1 counts =  ");
    rawValue = getadcReading();  // read current A/D value
    Serial.print(rawValue);
    Serial.print("  Millvolts =  ");
    scaledValue = map(rawValue, 0, 32767, 0, topofScale);  //convert raw adc counts to millivolts
    Serial.print(scaledValue);
    Serial.println("     Hit any key to continue");
    while(Serial.available() < 1) {}   // wait for user keystroke
    while(Serial.available() > 0) {byte userKeys = Serial.read();} //read keystrokes
}

int getadcReading()   // read 16 bit analog voltage reading
    {
      int data;
      int deviceAdd = 0x48;              // ADS1115 address with address pin grounded
      Wire.beginTransmission(deviceAdd); // transmit to I2c device address
      Wire.send(0x00);                   // point to device register 0 
      Wire.endTransmission();            // stop transmitting
      
      Wire.requestFrom(deviceAdd, 2);    // request 2 bytes from slave device
      while(Wire.available())            // need two bytes, MSB and LSB of converstion value
        { 
          data = Wire.receive();         // get MSB of reading
          data = data << 8;              // shift it to high byte of data
          data = data + Wire.receive();  // add LSB to data
        }
      return data;
    }
    
void setadcConfiguration()
    {
      int deviceAdd = 0x48;   // ADS1115 address with address pin grounded
      
            /* uncomment one desired voltage input range */
            
      int confWord= 0x0000; topofScale = 6144;  // +/-6.144 vdc range
      //int confWord= 0x0200; topofScale = 4096;  // +/-4.096 vdc range
      //int confWord= 0x0400; topofScale = 2048;  // +/-2.048 vdc range
      //int confWord= 0x0600; topofScale = 1024;  // +/-1.024 vdc range
      //int confWord= 0x0800; topofScale =  512;  // +/-.512 vdc range
      //int confWord= 0x0A00; topofScale =  256;  // +/-.256 vdc range
      
      /*  uncomment one desired channel input
          This also sets sample rate to 860 SPS and turns on continous conversion mode. */
          
      confWord = confWord | 0x00E0;  //input wired to + AIN0 - AIN1, diff +/- max range
      //confWord = confWord | 0x30E0;  //input wired to + AIN2 - AIN3, diff +/- max range
      //confWord = confWord | 0x40E0;  //input wired to + AIN0 - gnd, single ended, 0 to +max range
      //confWord = confWord | 0x50E0;  //input wired to + AIN1 - gnd, single ended, 0 to +max range
      //confWord = confWord | 0x60E0;  //input wired to + AIN2 - gnd, single ended, 0 to +max range
      //confWord = confWord | 0x70E0;  //input wired to + AIN3 - gnd, single ended, 0 to +max range
      
      /* uncomment one desired comparator options
         active low ready pin, window mode = input voltage is inside window values
         active low ready pin, traditional = voltage raised above or fell below set values */
             
      //confWord = confWord | 0x0003;   //disable comparitor
      //confWord = confWord | 0x0008;    //enable comparitor in traditional comparator mode
      confWord = confWord | 0x0018;   //enable comparitor in window comparator mode
          
      //send configuration word to device
      Wire.beginTransmission(deviceAdd); // transmit to ADS1115 device
      Wire.send(0x01);                   // point to configuration register
      Wire.send(highByte(confWord));     // sends MSB of configuration word
      Wire.send(lowByte(confWord));      // sends LSB of configuration word
      Wire.endTransmission();            // stop transmitting
         
      //send low threshold value word to device
      Wire.beginTransmission(deviceAdd);  // transmit to ADS1115 device
      Wire.send(0x02);                    // point to low threshold register
      Wire.send(highByte(loCompair));     // sends MSB of low threshold word
      Wire.send(lowByte(loCompair));      // sends LSB of low threshold word
      Wire.endTransmission();             // stop transmitting
       
      //send high threshold value word to device
      Wire.beginTransmission(deviceAdd);  // transmit to ADS1115 device
      Wire.send(0x03);                    // point to high threshold register
      Wire.send(highByte(hiCompair));     // sends MSB of high threshold word
      Wire.send(lowByte(hiCompair));      // sends LSB of high threshold word
      Wire.endTransmission();             // stop transmitting
      
    }

OK Done.

Board now has 4x 12bit DAC Analog Outputs, amplified to 0-10V, instead of 8 bit which was generated from the standard PWM and filtered.

Good suggestion, thanks.

Few more specs listed on first post.

retrolefty: I've been having a lot of fun playing with a TI ADS1115 16 bit I2C ADC chip. Works at 3.3 or 5vdc, has like five gain settings down to +/- .256 vdc, 4 channels single ended or 2 channels differential. Makes it useful to read Wheatstone bridge type sensors without needing external op-amps. Build in comparator function also. Only 960 SPS however. Check it out.

http://www.ti.com/lit/ds/symlink/ads1115.pdf

Lefty

Ok after look at the datasheet that does look like a very cool ADC, especially since it has programmable gain! I still need to be able to read 0-10V, so I will have to do a divide by 2 opamp as I am currently doing anyway. However I still need to figure out how to do the opamp configuration for -ve voltages being divided by 2... Never created a circuit do divide a negative voltage before.

I will have to do some more thinking, but more likely than not I will use this chip - well, 2 of them.

Cheers James

OK 2am now and I think I have done it.

Board now has 2x ADS1115 16bit ADC's now :)

Inputs come via 2x 4 channel op amps with a divide by 2 setup. In theory, from what I know at this point in time, it should be possible to put in +/-10V, +/-5V, 0-10V and 0-5V now.

Will do more reading tomorrow.

Cheers James

WanaGo: OK 2am now and I think I have done it.

Board now has 2x ADS1115 16bit ADC's now :)

Inputs come via 2x 4 channel op amps with a divide by 2 setup. In theory, from what I know at this point in time, it should be possible to put in +/-10V, +/-5V, 0-10V and 0-5V now.

Will do more reading tomorrow.

Cheers James

Be careful in your understanding the +/- ability of the ADC chip. One may not apply a negative (in relationship to ground) voltage to any pin of the device. Electrical input voltage must be limited to ground to +5vdc (or whatever Vcc you power the chip with). The +/- part is if you use the differential input mode. In differential mode, if you wire +voltage (top of range vdc) to the + input and a ground to the - input you will obtain the maximum possible positive digital value. If you wire ground to the + input and a +voltage (top of range vdc) to the - input, you will obtain the maximum possible digital value. Think of the input pins in differential mode as non-inverting and inverting, just like a op-amp that is using single polarity power supply. If for this chip running in differential mode, you wired say +2.5vdc to both + and - input pins the digital results would be 0, no matter what the gain scale selected (even +/- .256 volts), because +2.5 - +2.5 = 0. That make sense?

As far as setting up op-amps with negative gain to increase voltage measurement ranges, that seems a rather complex design criteria. Most designs just have the user use a simple external two resistor voltage divider resistors if they need increase the measurement range of the ADC function. I would just leave the max electrical measurement range as it is for the chip, 0-5 vdc inputs.

@Retrolefty

Thanks for that - however I am not 100% sure I understand.

From the datasheet it states (my interpretation), if in single mode, GND is used as the negative reference, so if you apply 5V to the input, then its the difference between GND and 5V that gets calculated. If in differential mode, you are saying you can still only use the GND to 5V range, so how is that any different than single mode? Why would you apply GND externally yourself when you can have the chip do it for you?

Sorry just woke up and head still isnt functioning right.

One of the criteria I have is to allow 0-10V Analog, which is industry standard, so there is no negotiation on this. The negative two were only to satisfy the request/question on the first page of this topic. So its a nice to have in that respect, but 0-5V and 0-10V are required.

I will get a coffee, have some breakfast and have a read of the datasheet again. If you can provide any more info that would be great.

Thanks James

I think I have clicked.

So the -ve scale output is purely for if the -ve input is higher than the +ve input, so 5V vs GND, rather than GND vs 5V. And differential is so you can do 1V to 4V for instance, and still get full scale...

Ok so this isnt capable of +/- inputs still, so I can remove some of the complexity i added by changing opamps, adding a -ve supply for the op amp, etc etc.

I have used the MAX127 before which takes 0-5, +/-5, 0-10, +/-10 etc and is software selectable etc, however not cheap at all. Obviously what that does is not so simple to reproduce.

WanaGo:
I think I have clicked.

So the -ve scale output is purely for if the -ve input is higher than the +ve input, so 5V vs GND, rather than GND vs 5V.
And differential is so you can do 1V to 4V for instance, and still get full scale…

I think you got it. The ADS1115 is a 16 bit ADC only if run in the differential mode and has a 2s complement integer output conversion (same format as a arduino integer), so full range voltage to + input and ground to - input, converts to a 32,767 value, and ground to + input and full range voltage to + input returns a-32,768 value. Equal voltages applied to both + & - input pins returns a 0 value conversion. When run in single ended input mode it becomes a 15 bit ADC with 32,767 returned with full range voltage on the + input and 0 if at ground voltage.

The true value of having and using the differential input mode is when wiring directly to a Wheatstone bridge type sensor (common for strain gauges and even thermistors) where the bridge’s north connection is wired to +5vdc, it’s south terminal to ground and the output taken from the east and west terminals directly to the diff input pins. At balance both measurement points will be at 2.5vdc and the ADC will return a value of zero counts and no matter which direction the bridge becomes unbalanced as the sensor(s) in the legs change resistance, will return either a positive or negative integer conversion value. That coupled with a full gain range allowing +/- .256 volts DC and one can see that it’s a very sensitive measurement, as step resolution will be on the order of 8 uv if I did my math right ! That kind of resolution performance normally requires quite expensive instrumentation op-amps and very careful wiring layout.

Ok so this isnt capable of +/- inputs still, so I can remove some of the complexity i added by changing opamps, adding a -ve supply for the op amp, etc etc.

Correct, no negative voltages relative to ground, or voltage above the Vcc allowed on any pin of the device.

I have used the MAX127 before which takes 0-5, +/-5, 0-10, +/-10 etc and is software selectable etc, however not cheap at all.
Obviously what that does is not so simple to reproduce.

Nice chip, somewhat large package size(lots of input channel pins :wink: ). Only real feature missing is programmable internal op-amp gain stages for measuring low level signals without requiring external amplification. Also lack of differential input mode then lacks the automatic common mode noise rejection that differential input gains you. However that’s not something that can’t be added with an external instrumentation differential input op-amp with programmable gain settings(?).

There seems to be just thousands of ADC chips out in the wild these days, so getting the features one needs and nothing extra, is just a matter of the time consuming task of checking all those datasheets. :wink: I was just very impressed with how many features and high performance they packed inside such a tiny package for the ADS1115. The internal voltage comparator mode with a independent output pin would make a great interrupt generating voltage monitor function, think low battery monitor/alarm, with very little software overhead in the controller chip, just a short ISR routine to save variables to EEPROM and shutdown safely.

Lefty