Arduino Multiple SPI devices including CC3000 and MFRC522 - arduino

I'm asking if how can I implement this one. I'm aware about multiple devices being connected over SPI, like having to select individual SS pin for each. Adafruit's CC3000 works fine alone along with the default Adafruit library. CC3000 uses SPI. MFRC522 RFID module by sonmicro (bought at Sparksfun) uses SPI too. It works fine too, independently. But whenever I connect them together, only WiFi works perfectly. I dont want to turn on and off the wifi to make way for the RFID to communicate since it takes some time for it to be connected in a wireless network. I want the two to work synchronously (or having to be scheduled but really fast that's unnoticeable by the user)
here's my code as of now. i cannot post it here as strange things happen i don't know why haha
https://drive.google.com/file/d/0B0bZsYo0xMH8YV9uWXJaRFdPT3M/view?usp=sharing
I'm thinking of replacing the RFID with SonMicro's SM130 RFID Module w/ SparkFun Eval board with UART (convertible to I2c) or Adafruit's PN532 with I2c by default. Are these okay to be paired with SPIs like the CC3000? Or should I change CC3000 with the Official WiFi module (UART) or WiFly Module (SPI-to-UART)

Related

Control Arduino Pins via ESP8266 Webserver

I want to program a simple Webserver with an ESP8266 but I want to connect the ESP8266 to an Arduino Mega. I want to connect a LED and a Sensor to the Arduino and control the LED and read the sensor data via the ESP8266 Webserver.
I am a beginner and dont want too complex solutions. It's just a simple school project.
For the Webpage I am sending just some HTML Code, I do not use Blynk or anything like that.
My question is how can I connect the ESP8266 to the Arduino and control it's pins?
There is a million ways to connect an ESP to an Arduino.
Without any shields or perihperals you can basically use any wired bus that does not require transceivers.
For example I2C or SPI.
With shields or peripherals you can use CAN, LIN, RS232, Ethernet, WIFI, Bluetooth, radio, optical and audio transmission... The list is endless.
You can of course read a sensor with the ESP so an Arduino Mega is not really necessary.

Arduino multiple NFC Reader RC522 over long distance with LTC6820

I have a problem that I need to control two NFC RC522 over a long distance. Now I saw that there is LTC6820 IC that could make my life easier.
However in the datasheet it can be seen that the SPI slaves need an address to indentify, because the CS pin is not switched separately. Is there any way to classify an RC522 with an address and then be able to use it with an Arduino and the MFRC522 library?
Here is a datasheet of the LTC6820: https://www.analog.com/media/en/technical-documentation/data-sheets/LTC6820.pdf
In the datasheet (https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf) of the RC522 there is something about addressing in the bullet point 8.1.2.3, but I don't understand it yet.
I hope someone can tell me about a multidrop connection with the LTC6820 with RC522 slaves.
The MFRC522 data sheet 8.1.2.3, refers to using SPI to read and write register addresses within the MFRC522 rather than accessing two MFRC5 on the same SPI bus.
The only way to use SPI for 2 separate devices is to run separate CS lines to the CS pin on each IC.
You can also use I2C slave interface and then MFRC522 can be hardwired to several I2C addresses on one I2C bus. I2C can cover somewhat longer distances than SPI, dependent on clock speed you select and can be extended further using differential I2C https://www.nxp.com/docs/en/data-sheet/PCA9615.pdf
Unfortunately it does not look like the official Arduino MFRC522 library has great I2C support though. https://github.com/makerspaceleiden/rfid#what-works-and-not

Use the Arduino Nano's serial interface to communicate with ESP8266 -- currently hangs

I have designed a ledstrip driver capable of receiving commands over UDP-IP. I initially worked with an Arduino MEGA, and currently I'm in the process of deploying the code in an Arduino NANO.
The Arduino NANO only has one hardware serial interface, unlike the MEGA, which has several. This forces me to disable the usual debugging through one of the Serial ports (by sending strings to the computer) and to reserve the one and only serial interface for the ESP8266. In short, I am connecting the ESP8266 to the TX and RX pins in the NANO.
I am aware that I could use the softwareserial.h library, but I'd like to avoid it if possible.
The following function sets up the Wifi object:
void wifi_setup(){
// Initialize serial for ESP module
Serial.begin(9600);
// Initialize ESP module
WiFi.init(&Serial); /* GETS STUCK HERE */
...
}
The problem is: the microcontroller gets stuck in the Wifi.init() function and never abandons it.
I am aware that the serial interface is connected to the USB port, and am suspicious this might be a problem. However, I have tried giving power to the NANO through the VIN pin instead of through the USB port, and it hasn't worked.
What am I doing wrong?
The best solution will be to write separate code for ESP8266 and Arduino Nano - or even only for ESP8266 (NodeMCU to make it easy). It will be much easier. But if you really want to do it in your way, i think ESP uses 115200 baud, and you've set it to 9600.

How to work with ESP13 wifi shield for arduino?

I recently bought a ESP13 wifi shield which has to mount on to Arduino. I think it is much similar to esp8266 modules, but unable to find a proper guidelines/libraries relevant to it. I did not notice any helpful tutorials also. Here, I want to use this module to run as a wifi server.
An ESP13 is an ESP8266. It is version ESP-13.
It is not a WiFi shield for Arduino; although you can connect it to an Arduino via serial pins and use its WiFi capabilities.
The ESP8266 ESP-13 is a stand alone device. It combines a processor with WiFi so you don't need an Arduino for simple jobs (or not that simple; I use mine to receive REST commands and run 60 addressable LEDs in pretty patterns).
There are lots of resources for ESP8266s:
For example: https://tuts.codingo.me/introduction-to-esp8266-module.
Note that the pin locations change between versions so look out for that when making circuits.

Arduino WiFly shield with SPI

I have an Arduino Uno with the WiFly shield. I want to use 5 PWM ports on the Arduino to control motors, but some of the PWM ports are used by the WiFly. Looking into it, I think I need to use the SPI bus, but is this possible with the WiFly shield or how do I go about it?
How am I supposed to wire the motors so that they can work alongside the WiFly?
Can you point to a tutorial (I haven't been able to find one similar enough to my case to understand) or can you give me some pointers? That would be great.
All you need to get the WiFly module working is a serial link with it. One option is to use a soft serial library. This way you can choose which arduino pins you want to use (only 2 are needed leaving all the others available to control your motors). See this tutorial for a complete example.

Resources