This is the SCA100T a dual axis inclinometer sensor a series of a 3D micromechanical based. This device has integrated based axis inclinometer that delivers an instrumentation grade performance for leveling applications. The measuring axes of the sensing elements are parallel to the mounting plane and orthogonal to each other. The SCA100T has a low temperature dependency, high resolution and low noise, with a sensing element architecture and un-sensitive to vibration due to their over damped sensing elements and can withstand mechanical shocks up to 20000 grams. This device runs on 5v with ratio metric analog voltage outputs and Communicate using SPI (Serial Peripheral Interface). As you can see the wiring diagram below the sensor is driven by NANO microcontroller just for this example you can use AVR, STM32, or ESP8266/ESP32 for testing. The SCA100T should be powered from regulated 5V DC with coupler to minimize the noise we used 1uf for filtering capacitor between the VDD and GND you can also use 470pF or 100nf capacitor. And for the RF filters we use 5k and 10uf on pin OUPUT to minimize the clock noise. This device can be use in Platform leveling and stabilization, 360 Degree vertical orientation measurement, Leveling Struments, Construction Levels, Building Automations, Industrial Automations, Medical & Laboratory Equipment. Etc. For more reading and introduction about inclinometer refer to this link and for the SCA100T datasheet you can see get it below.
Required Components
- Arduino IDE | Atmel Studio | Energia | Processing
- Arduino PRO, FIO, NANO, UNO, MINI, MEGA, PRO MINI, LEO, BT, DUE, ETHERNET,LILYPAD, NodeMCU, Teensy Board, TeensyDuino, ESP8266 12, 12E, ESP32, LinkItOne, ESP8266 NodeMCU, ESPDuino, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266, MSP430 ,ATMEGA250 16 MHz, ATSAM3x8E, Note: The Diagram below is using NANO. (please refer to each MCU’s respective pin-outs & bus configurations)
- MURATA SCA100T Dual Axis Inclinometer Sensor / SCA100T Module
- Capacitors (See below required values)
- Resistors (See below required values)
- Jumper Wire (Optional)
- PCB Designer (Circuit simulation to PCB Layout)
Wiring Guide
Source
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
#include <SPI.h> const int DIN = 11; const int DOUT = 12; const int CSPIN = 10 const int SCLCK = 13; const byte MEAS = 0 //00000000 Measure Mode const byte RWTR = 8 //00001000 Read Temperature Reg const byte RDSR = 10; const byte RLOAD = 11; const byte SX = 14; //00001110 Enable self test for X Channel const byte SY = 15; //00010000 Enable self test for Y Channel const byte AX = 16; //00010000 Read X Channel Acceleration const byte AY = 17; //00010001 Read Y Channel Acceleration word readCommand(byte ofVal) { byte inByte = 0; word sense = 0; digitalWrite(CSPIN, 0); delay(20); SPI.transfer(ofVal); sense = SPI.transfer(MEAS); sense = sense << 8; inByte = SPI.transfer(MEAS); sense = sense | inByte; sense = sense >> 5; digitalWrite(CSPIN, 1); return(sense); } void setup(){ while(!Serial){ Serial.begin(9600); } Serial.println("14CORE | SCA100T TEST CODE"); Serial.println("Initializing............. "); delay(4000); SPI.begin(); SPI.setBitOrder(MSBFIRST) SPI.setDataMode(0); Serial.println(""); pinMode(DIN, INPUT); pinMode(DOUT, OUTPUT); pinMode(CSPIN, OUTPUT); pinMode(SCLCK, OUTPUT); delay(1000); } void loop(){ int senseX = readCommand(AX); int senseY = readCommand(AY); Serial.println("Read value of X > "); Serial.println(AX); Serial.println("Read value of Y > "); Serial.println(AY); delay(1000); } |
Hi,
Your sample code does not work.
It does not compile in the arduino IDE because there are missing “;”
MISO and MOSI lines are reversed (MOSI is pin 11 and MISO is pin 12, you have it the other way around)
After fixing these, I could not get it to work still.
Could you provide any guidance/provide working code.
Error in code, you can help?
line56
Serial.println(AX);→Serial.println(senseX);
line 58
Serial.println(AY);→Serial.println(senseY);
On Arduino output only values 2047 and 0 appear, even if you move the sensor
Read value of X >
2047
Read value of Y >
2047
Read value of X >
0
Read value of Y >
0