-
Notifications
You must be signed in to change notification settings - Fork 12
Wiring Setups
I had originally written the code with the idea that I would run it on the most minimal of hardware that I was familiar with. That meant the Atmel ATtiny85(standalone). Since I was coding with Arduino IDE, having the extra flash memory was a good thing(tm).
I have since made it so that the code should work fine for the ATmega328P(standalone) as well as for the Arduino Uno and Arduino Mega boards.
The ATtiny(s) would have the simplest setups while the additional pins of the ATmega(s) or different form factors of the other ATtinyXX chips would allow for more IO lines and thus more fine grained control and tuning of the FSR setups.
- 1 x ADC pin for FSR Input Pin. (required) [FSR-#]
- 1 x DIO pin for Signal Output Pin (required) [SIGNAL-OUT]
- 1 x DIO pin for LED Output Pin (optional) [LED-#]
- 1 x DIO pin for Calibration Trigger Pin (optional) [CALIBRATE]
- 1 x DIO pin for NO Select Pin (optional)
- 1 x DIO pin for RESET (is actually the ADC pin)
The FSR is a 2 pin pressure sensitive resistor. It has no polarity.
- One of the pins of the FSR will go to VCC(5V if your device is 5V and 3V if your device is 3V).
- The other pin will go to the FSR pin on the device.
The LED(s) have polarity. Failure to respect the polarity will result in a fried LED. A small value resistor is a Good Idea(tm) to have in series, so that it does not burn out the LED or pull too much current from the pin.
- The GND pin of the LED goes to GND. This is the pin that is connected to the larger bit of metal on the inside of the LED or where it is marked as GND or "-"
- The VCC pin of the LED goes to the LED status pin of the chip/board. A low value(2.2k or 4.7k) resistor would be a good idea here.
- If there are multiple FSR/LED, make sure they are hooked up to the respective pins and placed close to their respective sensors.
The expectation is that your chip/board is getting VCC/V5/V3 from the printer control board and the GND is common to both the chip/board and the printer control board. This means the Output signal pin just needs to be 1 wire connected directly from the chip/board's Output signal pin to the signal pin on the endstop connector. For the RAMPS V1.4 board, it is the pin closest to the outside edge of the board, of the three pin connectors.
This pin determines whether or not the code will pull the signal up or down when a trigger event occurs. If up, then the output from the MCU acts like a a NO mechanical switch. If down, then the MCU acts like a NC mechanical switch. Since the normal convention is for NC switches, this will be the default. If you change this, you will need to invert the signal in the printer control firmware.
- pin left unconnected = NC switch mode. (Normally connected/Default)
- pin shorted to GND = NO switch mode. (Normally open, requires inverting signal on the printer control board)
This pin triggers a re-calibration of the FSR ambient values.
- Short temporarily to GND to recalibrate the FSR once.
- Short permanently to GND to enable continous recalibration mode.
Pins:
- PB5 ( RESET / ADC0 / DIO ) MCU Reset Toggle
- PB3 ( ADC3 / CLKI ) FSR Input Pin
- PB4 ( ADC2 / CLKO / DIO ) LED Output Pin
- GND
- PB0 ( AREF / DIO ) Signal Output Pin
- PB1 ( DIO ) Recalibrate Trigger Pin
- PB2 ( ADC1 / DIO ) NO Selector Pin
- VCC
- PB5 (RSET) Chip Reset Pin (button on Trinket)
- PB3 (DIO 3) Calibration Trigger Pin
- PB4 (DIO 4) NO Selector Pin
- GND
- PB0 (DIO 0) Signal Out
- PB1 (DIO 1) LED output(also triggers built in LED on board)
- PB2 (DIO 2/A1) FSR input
- VCC
Pins:
- VCC
- PB0 (DIO/XTAL1)
- PB1 (DIO/XTAL2)
- PB3 (RESET)
- PB2 (DIO)
- PA7 (ADC7/DIO)
- PA6 (ADC6/DIO)
- PA5 (ADC5/DIO)
- PA4 (ADC4/DIO)
- PA3 (ADC3/DIO)
- PA2 (ADC2/DIO)
- PA1 (ADC1/DIO)
- PA0 (ADC0/AREF/DIO)
- GND