How to use RepRapDiscount Smart Controller

I don't get were your problem is ?

All is documented ...

// include the library code:
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  // Print a message to the LCD.
  lcd.print("1st row");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print("2nd row");
  lcd.setCursor(0, 2);
  lcd.print("3rd row");
  lcd.setCursor(0, 3);
  lcd.print("4th row");
}


Just connect the pins to the holes on the connector

Hi,
Witch Arduino output with connector pin?

Thanks.

bjean238:
Hi,
Witch Arduino output with connector pin?

Thanks.

According to posted image and example:

//EXP1      Arduino
// 3        D11
// 4        D12
// 5        D5
// 6        D4
// 7        D3 
// 8        D2
// 9        GND
//10        5V

This worked for me.

Hi all. Reviving this old thread because I, too, am having trouble getting mega 2560+ramps 1.4+reprap discount smart controller to work. I'm running Arduino 1.8.9 with Windows 10.

controller is RepRapDiscount Smart Controller - RepRap
My setup includes the adapter shield and looks like: Imgur: The magic of the Internet

my test is:

#define BEEPER             37
#define LCD_PINS_RS        16
#define LCD_PINS_ENABLE    17
#define LCD_PINS_D4        23
#define LCD_PINS_D5        25
#define LCD_PINS_D6        27
#define LCD_PINS_D7        29

// Encoder rotation values
#define BTN_EN1            31
#define BTN_EN2            33
#define BTN_ENC            35

// SD card settings
#define SDPOWER            -1
#define SDSS               53
#define SDCARDDETECT       49

#define KILL_PIN           41

#define LCD_HEIGHT         4
#define LCD_WIDTH          20

#include <LiquidCrystal.h>

LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7);

void setup() {
  lcd.begin(LCD_WIDTH, LCD_HEIGHT);
  lcd.display();
  lcd.noCursor();
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Hello, World!");

  pinMode(BEEPER,OUTPUT);
  digitalWrite(BEEPER,HIGH);
  delay(100);
  digitalWrite(BEEPER,LOW);
}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);
}

for some reason the lights don't even come on and I never hear the expected beep.
When i use the exact same pins with Marlin, everything works.
I just can't see what I've missed. Contrast dial is not the issue. swapping out hardware makes no diff. I know the panel works

SupraGuy:
So looking at the schematics for the 2004 controller adapter and the RAMPS 1.4...

The schematics connect the pins (Assuming Arduino Mega 2560)

EXP1:

Mega    CON     Mega
37      1  2      35
17      3  4      16
23      5  6      25
27      7  8      29
GND     9 10      48

EXP2:
Mega    CON     Mega
49      1  2      NC
31      3  4      52
33      5  6      50
+5V     7  8      41
NC      9 10      NC

Something is wrong here. According to the schematic of the RepRap Discount Smart Controller this would source VCC from Pin 48 and connect the SD Card Detect switch to VCC.

EXP1:
1	37	Beeper
2	35	BC111E5244B2 Encoder Pin 5
3	17	LCD-Enable (Pin 6)
4	16	LCD-RS (Pin 4)
5	23	LCD-D4 (Pin 11)
6	25	LCD-D5 (Pin 12)
7	27	LCD-D6 (Pin 13)
8	29	LCD-D7 (Pin 14)
9	GND	Ground
10	48	VCC ?!?


EXP2 (a.k.a. JP3):
1	49	SD-Card MISO
2	NC	SD-Card SCK
3	31	BC111E5244B2 Encoder Pin 3
4	52	SD-Card SS
5	33	BC111E5244B2 Encoder Pin 1
6	50	SD-Card MOSI
7	+5V	SD-Detect
8	41	Reset button to Ground
9	NC	NC
10	NC	NC

I think I see the problem. In the schematic for the Smart Controller adapter board I think they got the AUX-3 (SPI) connector rotated 180 degrees so the numbering doesn't match the numbering on the RAMPS 1.4 schematic.

LCD Adapter schematic shows AUX-3 connections as:

1	NC		2	GND
3	D53		4	SCK
5	MOSI    	6	MISO
7	D43		8	VCC

The RAMPS 1.4 schematic shows AUX-3 connections as:

1	VCC		2	D49
3	D50(MISO)	4	D51(MOSI)
5	D52(SCK)	6	D53(SS)
7	GND		8	NC
RepRap Discount Smart Controller Schematic
https://reprap.org/mediawiki/images/7/70/Controller_final_reprapdiscount.pdf


EXP1:
1	Beeper
2	BC111E5244B2 Encoder Pin 5
3	LCD-Enable (Pin 6)
4	LCD-RS (Pin 4)
5	LCD-D4 (Pin 11)
6	LCD-D5 (Pin 12)
7	LCD-D6 (Pin 13)
8	LCD-D7 (Pin 14)
9	GND
10	VCC


EXP2 (labeled JP3 on the schematic):
1	SD-Card MISO
2	SD-Card SCK
3	BC111E5244B2 Encoder Pin 3
4	SD-Card SS
5	BC111E5244B2 Encoder Pin 1
6	SD-Card MOSI
7	SD-Detect
8	Button to Ground labeled RESET
9	NC
10	NC


RAMPS 1.4 schematic showing AUX-3 and AUX-4 connectors 
where the adapter board is connected:


https://reprap.org/mediawiki/images/f/f6/RAMPS1.4schematic.png


AUX-3 SPI (4x2):
1	VCC
2	D49
3	D50(MISO)
4	D51(MOSI)
5	D52(SCK)
6	D53(SS)
7	GND
8	nc


AUX-4 (18x1):


1	VCC
2	GND
3	D32
4	D47
5	D45
6	D43
7	D41
8	D39
9	D37
10	D35
11	D33
12	D31
13	D29
14	D27
15	D25
16	D23
17	D17
18	D16






RAMPS 1.4 LCD Adapter Schematic showing the connections 
between EXP1/EXP2 and AUX-3/AUX-4
https://reprap.org/mediawiki/images/7/79/LCD_connect_SCHDOC.pdf


WARNING! The AUX-3 pins are numbered differently on this 
schematic than on the RAMPS 1.4 schematic! 


LCD Adapter schematic shows AUX-3 connections as:
1	NC		2	GND
3	D53		4	SCK
5	MOSI	6	MISO
7	D43		8	VCC


The RAMPS 1.4 schematic shows AUX-3 connections as:
1	VCC			2	D49
3	D50(MISO)	4	D51(MOSI)
5	D52(SCK)  	6	D53(SS)
7	GND			8	NC


If you believe the labels or the pin numbers the schematic makes no sense:


AUX-3 (4x2):
1	nc			EXP1-9	GND
2	GND			nc 
3	D53(SS)		EXP2-2	SD-Card SCK
4	D52(SCK)  	EXP2-4	SD-Card SS
5	D51(MOSI)	EXP2-1	SD-Card MISO
6	D52(MIS0)	EXP2-6	SD-Card MOSI
7	D43			EXP1-10	VCC
8	5V			EXP2-7	SD-Detect


If you ignore the labels and the pin numbers on this schematic
and use the numbering from the RAMPS 1.4 schematic, you get this:


AUX-3 (4x2):
1	VCC			EXP1-10	VCC
2	D49			EXP2-7	SD-Detect
3	D50(MISO)	EXP2-1	SD-Card MISO
4	D51(MOSI)	EXP2-6	SD-Card MOSI
5	D52(SCK)  	EXP2-2	SD-Card SCK
6	D53(SS)		EXP2-4	SD-Card SS
7	GND			EXP1-9	GND
8	nc			nc


The AUX-4 looks correct.
AUX-4 (18x1):
1	VCC	nc
2	GND	nc
3	D32	nc
4	D47	nc
5	D45	nc
6	D43	nc
7	D41	EXP2-8	Button to Ground labeled RESET
8	D39	nc
9	D37	EXP1-1	Beeper
10	D35	EXP1-2	BC111E5244B2 Encoder Pin 5
11	D33	EXP2-5	BC111E5244B2 Encoder Pin 1
12	D31	EXP2-3	BC111E5244B2 Encoder Pin 3
13	D29	EXP1-8	LCD-D7 (Pin 14)
14	D27	EXP1-7	LCD-D6 (Pin 13)
15	D25	EXP1-6	LCD-D5 (Pin 12)
16	D23	EXP1-5	LCD-D4 (Pin 11)
17	D17	EXP1-3	LCD-Enable (Pin 6)
18	D16	EXP1-4	LCD-RS (Pin 4)


AUX-3 (4x2):
1	VCC			EXP1-10	VCC
2	D49			EXP2-7	SD-Detect
3	D50(MISO)	EXP2-1	SD-Card MISO
4	D51(MOSI)	EXP2-6	SD-Card MOSI
5	D52(SCK)  	EXP2-2	SD-Card SCK
6	D53(SS)		EXP2-4	SD-Card SS
7	GND			EXP1-9	GND
8	nc			nc

Hello, I'm currently working on a project using the REPRAPDISCOUNT smart controller. The project requires me to write information to an SD card and I am having trouble getting it to initialize. I'm assuming this has to do with the pin layout. Can someone here tell me how to redefine the each pin for the SD card? I know I need "#define" and then the name of the pin but I'm not sure how to do it on the smart controller.

aggrav8d:
Hi all. Reviving this old thread because I, too, am having trouble getting mega 2560+ramps 1.4+reprap discount smart controller to work. I'm running Arduino 1.8.9 with Windows 10.

controller is RepRapDiscount Smart Controller - RepRap
My setup includes the adapter shield and looks like: Imgur: The magic of the Internet

my test is:

#define BEEPER             37

#define LCD_PINS_RS        16
#define LCD_PINS_ENABLE    17
#define LCD_PINS_D4        23
#define LCD_PINS_D5        25
#define LCD_PINS_D6        27
#define LCD_PINS_D7        29

// Encoder rotation values
#define BTN_EN1            31
#define BTN_EN2            33
#define BTN_ENC            35

// SD card settings
#define SDPOWER            -1
#define SDSS              53
#define SDCARDDETECT      49

#define KILL_PIN          41

#define LCD_HEIGHT        4
#define LCD_WIDTH          20

#include <LiquidCrystal.h>

LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7);

void setup() {
  lcd.begin(LCD_WIDTH, LCD_HEIGHT);
  lcd.display();
  lcd.noCursor();
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Hello, World!");

pinMode(BEEPER,OUTPUT);
  digitalWrite(BEEPER,HIGH);
  delay(100);
  digitalWrite(BEEPER,LOW);
}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);
}




for some reason the lights don't even come on and I never hear the expected beep.
When i use the exact same pins with Marlin, everything works.
I just can't see what I've missed. Contrast dial is not the issue. swapping out hardware makes no diff. I know the panel works

Hi
I just uploaded your code and it's working fine. bip and Hello word, but your board is not looking as this one RepRapDiscount Smart Controller - RepRap

1 Like