跳到主要內容

發表文章

目前顯示的是 9月, 2017的文章

using Raspberry Pi to control Arduino using pyFirmata

Setting up your Arduino for Firmata Firmata control of the Arduino requires loading an Arduino with the special Firmata sketch. You can download the Arduino software from the Arduino website. After opening the Arduino IDE, follow these steps to install Firmata on your Arduino: Click File->Examples->Firmata->StandardFirmata From the Tools->Board menu, select the type of Arduino you are using. From the Tools->Serial Port menu, choose the USB port to which your Arduino is connected. Click the upload button (it looks like a right arrow, just next to the checkmark) and wait for your sketch to upload. A message in the bottom black windowwill indicate success or failure Once the Firmata sketch is loaded on your Arduino, you can test it out with the Firmata Test Program. Controlling your Arduino from Python Next, your Raspberry Pi must be setup with the python firmata libraries. Run the following commands: sudo apt-get install python-pip python-serial sudo ...

how to interface DS2431 in arduino

some good introduction from instructables: Bus Pirate 3EEPROM Explorer Board steps are: 1. find the device address 2. write 8 bytes to scratchpad 3. verify from scratchpad and get the authorization code 4. write scratchpad to EEPROM 5. verify scratchpad write 6. read back the values FredBlais has written a working example here and the Onwire.h library is located in PaulStoffregen's github references: sheepdogguides PJRC http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1271724996/3#3

d33 piezoelectric coefficient

Electromechanical properties of polarized piezoelectric materials  Polarized piezoelectric materials are characterized by several coefficients and relationships. In simplified form, the basic relationships between the electrical and elastic properties can be represented as follows: D: electric flux density d: piezoelectric charge coefficient T: mechanical stress εT : permittivity (for T = constant ) E electric field S:mechanical strain sE: Compliance or elasticity coefficient (for E = constant) These relationships apply only to small electrical and mechanical amplitudes, so-called small signal values. In this range, the relationships between mechanical, elastic deformation S or stress T and electrical field E or electrical flux density D are linear, and the values for the coefficients are constant. Piezoelectric Charge Coefficient, Piezoelectric Deformation Coefficient, Piezo Modulus d The piezo modulus is the ratio of induced electric ch...

owfs install

1 fuse sudo apt-get install fuse sudo apt-get install libfuse-dev ( for fusexmp etc) cd /usr/share/doc/libfuse-dev/examples ls -al check installation by: dpkg --get-selections | grep fuse ubuntu libfuse-dev file list in here according to  excellent owfs quickstart guide : owfs ow-shell ownet( optional for perl or php programming) python-ownet edit /etc/owfs.conf: ######################## SOURCES ######################## # # With this setup, any client (but owserver) uses owserver on the # local machine... ! server: server = localhost:4304 # # ...and owserver uses the real hardware, by default fake devices # This part must be changed on real installation # server: FAKE = DS18S20,DS2405 # # USB device: DS9490 # enable i2c support # This is for 1-wire bus master IC, eg DS2482-100 #server:i2c=/dev/i2c-1:ALL # server: device = /dev/i2c-1 #server: usb = all # # w1 devices server: w1 = all # Serial port: DS9097 #server: device = /dev/ttyS1 # # owserver tcp a...

1 wire DS2431 setup on raspberry pi

precursor: The January 2015 Raspbian release, with Pi 2 support, switches to a new kernel (3.18), and includes a configuration change to enable Device Tree support by default.   use sudo raspi-config to enable I2C in Advanced Options > I2C . Now we start: Here we are using 1-wire eeprom DS2431 as example, with 2k2 resistor as pull up to 3v3 Vcc. We chose GPIO25 of BCM, ( which is  wiringPi Pin6) as I/O pin of DS2431 referring to https://www.raspberrypi.org/forums/viewtopic.php?p=518859#p518859 step 1 sudo su - In /boot/config.txt need to be add following line: dtoverlay=w1-gpio,gpiopin=25 >>> reboot step 2 before modprobe: sudo su - modprobe w1-gpio ls /sys/bus/w1/devices  you can see eeprom is NOT yet found under 2d-00001ac198e4 (2d is family code of DS2431) modprobe w1_ds2431 ls -al /sys/bus/w1/devices now you see eeprom . Bingo! step 3 To dump the eeprom content, while still at /sys/bus/w1...