rvm-installation-on-mac
Products
- Details
- Category: Uncategorised
- Hits: 10737
List of all products of Ignite Mindz
1. ERP, CRM, Inventory Management, Assets Management and Help Desk (Support) Online Software.
Error Page
- Details
- Category: Uncategorised
- Hits: 313980
Error Page
You may not be able to visit this page because of:
- an out-of-date bookmark/favourite
- a search engine that has an out-of-date listing for this site
- a mistyped address
- you have no access to this page
- The requested resource was not found.
- An error has occurred while processing your request.
- For any query call us on US: +1(937)557-1919 IN: +91 8122331111
Please try one of the following pages:
If difficulties persist, please contact the System Administrator of this site and report the error below..
Article not found
How to Setup serial communication between Raspberry pi and Heythi 40 using GPIO
- Details
- Category: Uncategorised
- Hits: 7986
Hardware connections:
-
Heythi 40 signals +5v and 0 ,Raspberry pi signals are +3.3v and 0.Raspberry pi GPIO pin are very sensitive.If 5v may drop on that it will get damaged.Inorder to avoid that we may use voltage divider logic
-
Take a breadboard and do connections as mentioned below
-
Take a 1 kilo ohm resistor connect the one end with Heythi 40 Transmitter(PD1) and other end with Raspberry pi receiver(Rx) in series.
-
Connect another 1 kilo ohm resistor with Raspberry pi receiver(Rx) and other end of resistor should be grounded
-
Connect the both ground pins with ground rail of breadboard
-
Connect the Raspberry pi transmitter(Tx) with Heythi 40 Receiver(PD0)
-
Connect the Usbtiny to the usb port and other end is connected with Heythi 40
-
Connect the Heythi Max 232 female port with Heythi 40 and other end of Max232 is connected with Max232 wire to wire connector
-
The other end of Max 232 wire to wire connector is connected with your system serial port
Raspberry pi
-
Open the Lxterminal and type sudo idle
-
Open File->New Window and type the following Program
#!/usr/bin/env python
import serial
import string
rot13 = string.maketrans(
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz",
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm")
test=serial.Serial("/dev/ttyAMA0",4800)
test.open()
try:
while True:
line = test.readline(eol='\r')
test.write(string.translate(line, rot13))
except KeyboardInterrupt:
pass # do cleanup here
test.close()
-
Then click on save to save the module
-
Then click on Run to Run module
-
Open the minicom to view the data which is sent/received in serial communication by the following command
-
sudo minicom -b 4800 -o -D /dev/ttyAMA0 type the command in the Lxterminal
Heythi 40
-
Open Arduino IDE as administrator
-
Type the following program
void setup() {
Serial.begin(9600);
}
void loop() {
int incomingByte;
if(Serial.available() > 0)
// read the incoming byte:
incomingByte = Serial.read();
// echo
Serial.write(incomingByte);
}
}
3.Click to save icon to save the file
4.Select Heythi 40/Atmega32 under Tools ->Board menu
5.Select UsbtinyISP programmer under Tools -> Programmer
6.Select Tools->Serial port ->/dev/ttys0
7.Click to verify icon to compile the file
8.Click to File ->Upload using Programmer
9.Select the baud rate 4800 in serial moniton
10.Open the serial monitor in the arduino IDE to view the data which is sent/received in serial communication
Note:
1.Kindly disconnect the Arduino Tx and Arduino Rx with Raspberry pi Tx and Raspberry pi Rx unless you will get an error while uploading your program.It may damage your Raspberry pi
2.Kindly Follow the instructions given in How to Set up serial communication between Raspberry pi and Arduino using GPIO document to
-
Disable getty
-
Remove the console statement carefully
-
Minicom installation
-
Kindly follow the instruction given in Interfacing Between Arduino uno and Raspberry pi document to install Pyserial in Raspberry pi
Output:
Type your data (anything) in the minicom that will shown in arduino serial monitor
(i.e) YourRaspberry pi transmits the data and your Heythi 40 receives the data via serial communication
How to Set up serial communication between Raspberry pi and Arduino using GPIO
- Details
- Category: Uncategorised
- Hits: 9290
Disable getty:
To use pi's serial port we need to disable getty.
Login as administrator by this command sudo startx
Using Filemanager open etc/inittab (it will open like a file)
Add comment infront of the following line
0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Click on save.
Remove the console statement carefully:
Using Filemanager open /boot/cmdline.txt
Remove the statements console=ttyAMA0,115200
Then click on save
Note: The cmdline.txt file cannot open like a normal file.so kindly open with vi editor.
Minicom installation:
Install minicom (serial monitor)
Open the Lxterminal and type sudo apt-get install minicom
To allow installation kindly type 'y'
Hardware connections
1.Arduino signals +5v and 0 ,Raspberry pi signals are +3.3v and 0.Raspberry pi GPIO pin are very sensitive.If 5v may drop on that it will get damaged.Inorder to avoid that we may use voltage divider logic
2.Take a breadboard and do connections as mentioned below
3.Take 1 kilo ohm resistor connect the one end with arduino Transmitter(Tx) and other end with Raspberry pi receiver(Rx) in series.
4.Connect another 1 kilo ohm resistor with Raspberry pi receiver(Rx) and other end of resistor should be grounded
5.Connect the both ground pins with ground rail of breadboard
6.Connect the Raspberry pi transmitter(Tx) with Arduino Receiver(Rx)
7.Raspberry pi
8.Make a check your pi already installed Pyserial
9.If yes,Kindly follow the below steps,If No,Kindly install Pyserial with the help of Interfacing_Between_Arduino_and_Raspberry_pi document
10.Open the Lxterminal and type sudo idle
11.Open File->New Window and type the following Program
#!/usr/bin/env python
import serial
import string
rot13 = string.maketrans(
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz",
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm")
test=serial.Serial("/dev/ttyAMA0",9600)
test.open()
try:
while True:
line = test.readline(eol='\r')
test.write(string.translate(line, rot13))
except KeyboardInterrupt:
pass # do cleanup here
test.close()
-
Then click on save to save the module
-
Then click on Run to Run module
-
Open the minicom to view the data which is sent/received in serial communication by the following command
-
sudo minicom -b 9600 -o -D /dev/ttyAMA0 type the command in the Lxterminal
Arduino
-
Connect your arduino with your pc using usb cable
-
Open Arduino IDE as administrator
-
Type the following program
void setup() {
Serial.begin(9600);
}
void loop() {
int incomingByte;
if(Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
// echo
Serial.write(incomingByte);
}
}
-
Click to save icon to save the file
-
Click to verify icon to compile the file
-
Click to upload icon to upload the file
-
Open the serial monitor in the arduino IDE to view the data which is sent/received in serial communication
Note: Kindly disconnect the Arduino Tx and Arduino Rx with Raspberry pi Tx and Raspberry pi Rx unless you will get an error while uploading your program.
Output:
Type your data (anything) in the minicom that will shown in arduino serial monitor
(i.e) YourRaspberry pi transmittes the data and your arduino receives the data via serial communication
How to Access the input port of Arduino using Raspberry pi
- Details
- Category: Uncategorised
- Hits: 7332
-
Connect the arduino uno board with Raspberry pi using usb cable adapter
-
Connect the Reset switch(4 leg) into the breadboard
-
Connect the one side of reset pin to +5v of arduino
-
Connect the other side of reset pin to input port (pin2) and connect 1k ohm resistor with the
same pin
-
Connect the other end of resistor with the ground of arduino board
-
Open the Lxterminal and type sudo arduino and press ENTER
-
On the Arduino IDE click on File->Examples->Basics->DigitalReadSerial
-
The following program will appear
/*
DigitalReadSerial
Reads a digital input on pin 2, prints the result to the serial monitor
This example code is in the public domain.
*/
// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 2;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// make the pushbutton's pin an input:
pinMode(pushButton, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input pin:
int buttonState = digitalRead(pushButton);
// print out the state of the button:
Serial.println(buttonState);
delay(1); // delay in between reads for stability
}
9. Click on verify icon to compile
10. Click on Upload icon to upload
11. Now select serial monitor icon on the right top of your arduino IDE
12. The serial monitor to view the button status (i.e) The output will appear.
Note:
-
By changing the input pin number(0-13) you can access (0-13) port respectively
-
No need install interfacing software like (pyserial,nanpy) more than once .
-
Once nanpy,pyserial installed correctly it will communicate arduino automatically