Show Posts
Pages: [1] 2 3 ... 14
1  Using Arduino / Displays / Re: Two SSD1306 connected together on: September 02, 2014, 06:29:25 am
Both displays with the same address is different. I've never heard of i2c devices runnning in parallel. There will most likely be all kinds of communication problem talking to the micro. If you can give one display a different address then all will be good.
2  Topics / Product Design / Re: DIY CNC? on: August 28, 2014, 09:02:44 am
Unfortinately Maker spaces are not in the vicinity of everyone. The least expensive hobby cnc machine I've seen is by Zen. http://www.zentoolworks.com/
3  Using Arduino / Programming Questions / Two NRF24L01 Transmitters sending temperatures to one Receiving Unit on: August 25, 2014, 01:50:48 pm
I have two devices transmitting temperature to one receiver. Right now only one at a time will work displaying the proper temperature. This verifies that the hardware on each transmitter is working and Serv1 & Serv2 are properly set up.

In the code:
  Mirf.getData((byte *) &temp1);  //small board
  //Mirf.getData((byte *) &temp2);  //large board

When either Mirf.getData((byte *) &temp1); or  just Mirf.getData((byte *) &temp2); is used I can see the correct temperature of each of the two transmitters.

when both lines are not commented out I can see that one temperature is correct but the other reads a constant wrong temperature.

I'm no good at code as you can tell so any help would be great.

Code:
#include <MirfHardwareSpiDriver.h>
 
int16_t h = 64;
int16_t w = 128;
// OLED I2C bus address
#define OLED_address  0x3c
Adafruit_SSD1306 display(OLED_RESET);
float temp1;  //int
float temp2;
 
void setup()
{
  Serial.begin(9600);
  Wire.begin();
  Mirf.cePin = 8;
  Mirf.csnPin = 9;
  
  display.begin(SSD1306_SWITCHCAPVCC, 0x3c);  // initialize with the I2C addr 0x3D (for the 128x64)
  display.clearDisplay();   // clears the screen and buffer
  Wire.begin();
  init_OLED();
  reset_display();          
 
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"serv1");   //has to be serv1 !
  Mirf.setRADDR((byte *)"serv2"); //has to be serv2 !
  Mirf.payload = sizeof(temp1);
  Mirf.payload = sizeof(temp2);
  Mirf.config();
}
 
void loop()
{
  while(!Mirf.dataReady())
  {
  }
  
  //Can only use one at a time or gives an error one on Serv2
  Mirf.getData((byte *) &temp1);  //small board
  //Mirf.getData((byte *) &temp2);  //large board
 
  Serial.println(temp1);
  Serial.println(temp2);
 
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,10);
  display.print("Small Brd:");
  
  display.setTextSize(1);  
  display.setTextColor(WHITE);
  display.setCursor(70,10);  //over,up
  display.print(temp1);  
  
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,40);
  display.print("Large Brd:");
  
  display.setTextSize(1);  
  display.setTextColor(WHITE);
  display.setCursor(70,40);  //over,up
  display.print(temp2);  
  
4  Using Arduino / Networking, Protocols, and Devices / Two NRF24L01 Transmitters sending temperatures to one Receiver on: August 23, 2014, 12:31:42 pm
I have two devices transmitting temperature to one receiver. Right now only one at a time will work displaying the proper temperature. This verifies that the hardware on each transmitter is working and Serv1 & Serv2 are properly set up.

  Mirf.getData((byte *) &temp1);  //small board
  //Mirf.getData((byte *) &temp2);  //large board

when both lines are uncommented out I can see that one temperature is correct but the other reads a constant wrong temperature.

I'm no good at code as you can tell so any help would be great.

Code:
#include <MirfHardwareSpiDriver.h>
 
int16_t h = 64;
int16_t w = 128;
// OLED I2C bus address
#define OLED_address  0x3c
Adafruit_SSD1306 display(OLED_RESET);
float temp1;  //int
float temp2;
 
void setup()
{
  Serial.begin(9600);
  Wire.begin();
  Mirf.cePin = 8;
  Mirf.csnPin = 9;
 
  display.begin(SSD1306_SWITCHCAPVCC, 0x3c);  // initialize with the I2C addr 0x3D (for the 128x64)
  display.clearDisplay();   // clears the screen and buffer
  Wire.begin();
  init_OLED();
  reset_display();           
 
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"serv1");   //has to be serv1 !
  Mirf.setRADDR((byte *)"serv2"); //has to be serv2 !
  Mirf.payload = sizeof(temp1);
  Mirf.payload = sizeof(temp2);
  Mirf.config();
}
 
void loop()
{
  while(!Mirf.dataReady())
  {
  }
 
  //Can only use one at a time or gives an error one on Serv2
  Mirf.getData((byte *) &temp1);  //small board
  //Mirf.getData((byte *) &temp2);  //large board
 
  Serial.println(temp1);
  Serial.println(temp2);
 
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,10);
  display.print("Small Brd:");
 
  display.setTextSize(1); 
  display.setTextColor(WHITE);
  display.setCursor(70,10);  //over,up
  display.print(temp1); 
 
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,40);
  display.print("Large Brd:");
 
  display.setTextSize(1); 
  display.setTextColor(WHITE);
  display.setCursor(70,40);  //over,up
  display.print(temp2); 
 
5  Using Arduino / Networking, Protocols, and Devices / nRF24L01.h library with multiple nodes possible? on: August 21, 2014, 06:11:25 am
The Arduino Playground nRF24L01.h library at  http://playground.arduino.cc/InterfacingWithHardware/Nrf24L01 is very easy to use and for me it's working great. I'm using it to transmit the temperature of one device to a receiver.
http://youtu.be/8RJMrisngwY?list=UUXpjUx31kBU96EtzbuK0xkQ
I have made up a few more temperature sensor transmitters a would like to view all three on the one receiver's display. I'm not sure if there is an easy way to do it with this library. I've seen other libraries but they are very complex compared to this one.
A piece of my receiver code is something like this.

Code:
  Wire.begin();
  init_OLED();
  reset_display();           // Clear logo and load saved mode
 
 
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"serv1");
  Mirf.payload = sizeof(temp);
  Mirf.config();
}
 
void loop()
{
  //Wire.begin();
  int x=9;
 
  while(!Mirf.dataReady())
  {
  }
 
  Mirf.getData((byte *) &temp);  //byte
  Serial.println(temp);
 
  //print menu header
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(30,10);
  display.println("Temp:");
 
  display.setTextSize(3); 
  display.setTextColor(WHITE);
  display.setCursor(8,35);  //over,up
  display.print(rate); 

6  Using Arduino / Microcontrollers / Re: Arduino standalone problem on: August 19, 2014, 01:20:26 pm
Agreed. We need your full schematic to figure out what's going on.
7  Using Arduino / Displays / Re: Best approach for 128x64 OLED graphical battery level indicator on: August 14, 2014, 11:53:01 am
I would use the same tiny battery icon as your phone does. Just create the five different battery levels and display one based on your battery voltage. The guy in this video looks like he did the same: https://www.youtube.com/watch?v=KrUJlZK1ct0

Mike
8  Using Arduino / Microcontrollers / Re: 328P and NRF24L01+ not running off a coin cell on: August 14, 2014, 06:11:04 am
Success!
Disabling brownout by changing the Extended Fuse from 0x05 to 0x07 has fixed the problem. I just checked this morning and it has been running all night on a 3V coin cell without an issue.  Adding a larger cap as close the the NRF24L01+ power pins will be an eventual mod but right now it's ok.

Thanks to all for the help,
Mike
9  Using Arduino / Microcontrollers / 328P and NRF24L01+ not running off a coin cell on: August 13, 2014, 11:00:47 am
I have a simple circuit that consists of a 328P, TMP102 and an NRF24L01+ that I would like to have running off a CR2032 coin cell. Right now in low power mode it rests at 23uA and bursts up on occasional transmit. It runs fine when a larger, rechargeable LiPO battery powers it but nothing when the 3V coin cell is powering it.
I've used the IDE to put the Arduino Pro or Pro Mini (3.3V, 8Mhz) w/Atmega328 bootloader into it so maybe the Brownout fuse needs to be changed. My preferred method to install the bootloader and upload code is using the IDE and USBTinyISP.

Miker
10  Using Arduino / Programming Questions / Re: NRF24L01+ , temp sensor and 328P not so low power on: August 13, 2014, 06:14:39 am
Hey Jiggy-Ninja,
Just letting you know that LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); brought the current draw from 2mA  down to 28uA. Awesome and thanks a million!
A quick video of the hardware so far.

http://youtu.be/lnTe4XPHePs?list=UUXpjUx31kBU96EtzbuK0xkQ

Mike
11  Using Arduino / Programming Questions / Re: NRF24L01+ , temp sensor and 328P not so low power on: August 12, 2014, 01:59:44 pm
I forgot to mention that the temperature is properly being transmitted to the receiver. Every eight seconds the receiving module displays the transmitters temperature on a small display.

Tonight I'll try LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
 instead of
 LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART0_OFF, TWI_OFF);
               

Mike  
12  Using Arduino / Programming Questions / NRF24L01+ , temp sensor and 328P not so low power on: August 12, 2014, 12:51:38 pm

I've created a coin cell powered 328P that reads the room temperature from an i2c temperature sensor and transmits the reading using the NRF24L01+. The current consumption now is steady around 2mA and i'd like to get it a lower. My programming skills are weak so any help would be appreciated.

- the 328P is programmed with the default Arduino Pro or Pro Mini (3.3V, 8Mhz) w/Atmega328 bootloader.
- the data sheet for the TMP102AIDRLT says that it draws very little power
- i'm using the Low Power Library from https://github.com/rocketscream/Low-Power 

Below is the Code and Schematic

Code:

// Low Power Library https://github.com/rocketscream/Low-Power 
// http://www.bajdi.com
// Nrf24L01 connected to Mega 2560
// Nrf24L01 connection details http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
// Transmit analog value from pin A0 to the receiver
 
#include "LowPower.h"
#include <SPI.h>
#include <Wire.h> 
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>

//Temp Stuff
//int TMP75_Address = 0x49;
int tmp102Address = 0x49;
int numOfBytes = 2;

 
float rate=12.3;

 
void setup(){
 
  //Serial.begin(9600);
 
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = sizeof(rate);
  Mirf.config();
 
    // Initialize TMP75
  //Wire.beginTransmission(TMP75_Address);       // Address the TMP75 sensor
  //Wire.write(0x01);                       // Address the Configuration register
  //Wire.write(B01100000);                         // Set the temperature resolution
  //Wire.endTransmission();                      // Stop transmitting
  //Wire.beginTransmission(TMP75_Address);       // Address the TMP75 sensor
  //Wire.write(0x00);                          // Address the Temperature register
  //Wire.endTransmission();                      // Stop transmitting
}
 
void loop()
{
    // ATmega328P, ATmega168
  LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF,
                SPI_OFF, USART0_OFF, TWI_OFF);

 
  //rate = analogRead(A0);
  float tempx = readTemp();
 
  Mirf.setTADDR((byte *)"serv1");
 
  //Mirf.send((byte *) &rate);
  Mirf.send((byte *) &tempx);
 
 
  while(Mirf.isSending())
  {
  }
 
  Mirf.powerDown();

 
 //==========================================================//
// Read temperature
float readTemp()
{
  // Now take a Temerature Reading
  //Wire.requestFrom(TMP75_Address,2);  // Address the TMP75 and set number of bytes to receive
  //byte MostSigByte = Wire.read();              // Read the first byte this is the MSB
  //byte LeastSigByte = Wire.read();             // Now Read the second byte this is the LSB

  // Being a 12 bit integer use 2's compliment for negative temperature values
  //int TempSum = (((MostSigByte << 8) | LeastSigByte) >> 4);
  // From Datasheet the TMP75 has a quantisation value of 0.0625 degreesC per bit
  //float temp = (TempSum*0.0625);
  //return temp; 
  // Return the temperature value
  Wire.requestFrom(tmp102Address,2);

  byte MSB = Wire.read();
  byte LSB = Wire.read();

  //it's a 12bit int, using two's compliment for negative
  int TemperatureSum = ((MSB << 8) | LSB) >> 4;

  float celsius = TemperatureSum*0.0625;
  return celsius;
}

13  Community / Exhibition / Gallery / Re: Tiny custom Leonardo design on: August 08, 2014, 08:19:19 am
The 32U4 Board has gone through several revisions since this original post. The switching power supply has been changed to a simple LDO, a few more sensors and a microSD card holder have been added. The latest designs is at:

https://sites.google.com/site/0miker0/arduino-sensor-board

http://youtu.be/uan1urYKo_w?list=UUXpjUx31kBU96EtzbuK0xkQ
14  Using Arduino / Displays / Re: SSD1306 128x64 to 64x48 size Oled Display on: July 22, 2014, 02:00:05 pm
I have simple working test code (attached) for the 128X64 that I'm hoping to modify for the smaller display. Do you have experience with the SSD1306? It looks like the colomn, row values will have to be adjusted. Right now on the smaller display it works but the first few and last characters cut off. 

15  Using Arduino / Displays / Re: SSD1306 128x64 to 64x48 size Oled Display on: July 22, 2014, 11:31:10 am
After looking into it, I see there is a whole lot more to it then just tweaking a line or two in the init file.
Pages: [1] 2 3 ... 14