Recent Posts

Pages: [1] 2 3 ... 10
1
Website and Forum / 502 & 504 gateway errors
Last post by neiklot - Today at 05:37 am
Getting loads of these (0430 GMT Friday 22 March)... is it just me?

2
Code: [Select]
myCharNumber[] = "12345";

myCharNumber[2] = 7;


will change it to 12745
No! It changes to what is shown in the following screenshot. This thing would never happen for @R.. if he would follow @A..., @j..., and the like and not @G..., @P..., and the like.
3
Project Guidance / Re: Animated Loading Bar LCD I...
Last post by neiklot - Today at 05:18 am
 
does it work with I2C LCD? most of the tutorial i watched if fore regular LCD's
Why don't you try it?

As far as I know, from what I've seen, the lcd libraries all use the same methods for moving the cursor, clearing, writing etc. The only difference is in the lines where you call the libraries and get it fired up. (Where, for instance, an I2C one may need an I2C address.)

And anyway, if you scrolled down that linked page you would see it even talks of an I2C version....



4
Project Guidance / Re: Simple multi-tasking
Last post by gmh5760 - Today at 05:13 am


Yet again, Mike, I would like to thank you and all the other who respond with such thought out feedback and expertise.  On one hand, I loath starting from scratch, as it is so terribly easy to all at once feel overwhelmed or completely lost.  On the other hand however, I love learning new thing so very much, and every evolution here involves just that!  THANK YOU ALL!


Now, sadly, I must admit that I have struggled here recently.  It has actually gotten to a point where I had to step away from it for a short while (hence, the few days lapse).


As I stated before, I had a nice success with getting the stepper running as desired.

I have also gotten the hall switch to trigger with detectable results.  Another success!


As for the Neopixel ring and the DFPlayer...  FACEPALM!!!


I'm fairly certain that my issues with both of these items on my to-do list are likely library-based.


Both items will do NOTHING.  Not...a...thing...


The DFPlayer will seemingly be an obvious issue.  I cannot find the damn library.  lol

The sketch, which I really don't feel the need to post for obvious reasons, calls for the softwareserial.h library.  I cannot find this library to save my life!  So, what is one to do when a sketch they would like to try calls for a given library, but said library seemingly fails to exist?


Moving on...


The Neopixel ring:  This one I feel may not be as easy, as I have gotten the warnings for the missing library to cease.  I was so excited inside when the sketch compiled without any errors.


Working from this page, I was using the first sketch they display as follows:


Code: [Select]
#include <Adafruit_NeoPixel.h>

#include "hsv.h"


// data pin

#define PIN 6

// led count

#define CNT 24

// max Hue

#define MAXHUE 256*6


int position = 0;


Adafruit_NeoPixel strip = Adafruit_NeoPixel(CNT, PIN, NEO_GRB + NEO_KHZ800);


void setup() {

  strip.begin();

}


void loop() {

  // hue - whole circle

  // saturation - maximum

  // value - very low

  for (int i = 0; i < CNT; i++)

    strip.setPixelColor((i + position) % CNT, getPixelColorHsv(i, i * (MAXHUE / CNT), 255, 10));

  strip.show();

  position++;

  position %= CNT;

  delay(50);

}



My connections are, for the most part, identical to the schematic diagram they have on their page, with the following exceptions:


1. I am using a Nano, not an Uno.  I am still using pin #6.

2. I am not powering the Neopixel ring from the Nano, but from a 5v power supply.

3. I did not have a 220 uF cap, so therefore I used two 100 uF caps in parallel.


The ring has done NOTHING.  Not a single twitch of light (or hope).


Troubleshooting:


Thus far, to verify that my solder job was satisfactory, I used a voltmeter to check the following:


Ring disconnected:  continuity from ground wire to unused ground connection on ring (ring has two possible ground connections).  Near zero ohms.  So good there.


Did the same for 5v+ (also two possible connections).  Same result.


Ring connected, verified the presence of 5v at the ring (following instructions to make ground first).  5v verified good.


Being as that I do not have access to an oscilloscope, I feel that I can not verify the data line.


While uploading the sketch, the board lights on the Nano behave as expected, giving the indication that the upload was successful.  Then nothing.


I can only believe that I have done something incorrectly while installing the hsv.h library from the github link at the bottom of their page.  I used the "new tab" method to do this, pasted in the code and saved it under "hsv".

I received no errors when compiling and none when I uploaded the sketch to the Nano.


I actually wondered if my pigtail was too long on the ring (it's about 18" as I wanted to leave some excess to route the wires through the final project).


Any ideas?
5
Sensors / Re: Need help on ACS712 sensor
Last post by arazajr - Today at 04:52 am
Cleaned up your code (untested), so you can try.
Leo..
Code: [Select]
#include "ACS712.h"
ACS712 sensor(ACS712_05B, A1);
int mVperAmp = 185;
byte LED1 = 2;
byte LED2 = 3;
float current;

void setup() {
  Serial.begin (9600);
  sensor.calibrate();
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
}

void loop() {
  // measure
  float current = sensor.getCurrentDC();
  // print
  Serial.print("Current is ");
  Serial.print(current);
  Serial.println(" Amps");
  // control LEDs
  if (current < 0.01) {
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, LOW);
  }
  else if (current > 0.02) {
    digitalWrite(LED1, LOW);
    digitalWrite(LED2, HIGH);
  }
  else {
    digitalWrite(LED1, LOW);
    digitalWrite(LED2, LOW);
  }
  delay(1000); // some delay, so we can read it
}

I tried the code you wrote but apparently my Arduino couldn't detect the Serial.printIn code and state that "class HardwareSerial" has no member named printIn
6
Project Guidance / Re: Arduino pro mini voltage r...
Last post by cbocatto - Today at 04:43 am
I am not sure as to why the the datasheet states that however if you are looking for power control the first thing we would need to know is how you plan to source your input power.

WHY?
Conversion efficiency!

Here are my assumptions:
You are mentioned a battery so I am assuming you are using a 9V battery.
Secondly I am going to assume you are designing for 350mA. (best to give yourself some margin)  

Here is what I would recommend:
  • Think about the POWER dissipated If you are going to be using a Linear for this you will be converting the Voltage down via burning off the excess energy. Now IDK which version you have the 5 or 3.3V variant but the example stand either way.  Think about this  9V-5V = 4V  and P= V*I  therefore we have 4V *0.350mA = 1.4W  which upon looking at the datasheet of the regulator shows a thermal resistance of 220 C/W which means when this thing is going at full load you will have to get sink 308 Degrees C  So as you can see efficiency matters!!!  If you to plan to go the LDO route take a look at the TPS series of LDOs from TI...they have lower thermal resistances
  • What about Switching???? Ok so its not as simple as an LDO but with a switcher you can easily get north of 80% efficiency and easily meet any of the load requirements that you stated. TI has many simple Switchers that make your life really easy especially with their online design tools. My recommendation would be to use the LMR16006  simple switcher controller or a similar simple switcher module and then finish up the design within their webench tool.


I hope that helps!
7
Morgan, Paul & Steve,

Thanks again.

I don't have any code regarding playing the 'tunes' as I wanted to know how to approach the problem before I tried to write the code.  I have written(copied) the code for reading from the text file on the SD card ok.

I was thinking that the data would be something like allocating up to 8 bytes per 'beat' which would be 1 byte for  each 'drum' eg 1 hihat 1 snare drum  1 tom tom 1 bass drum and 1 or 2 cymbals.  The position in the line of data would refer to which drum and the actual data would be a 1= play or 0 = silent for example :-

10110000   would play hihat (pos1)  NOT play snare (p2)  play tomtom(P3)  play bass drum (P4) and no cymbals
11001000   would play hihat (pos1)  play snare (p2)  NOT play tomtom(P3)  NOT bass drum (P4) and play a
                                                                                                                                                     cymbal

I don't have 8 'drums' to play but thought it would leave room for expansion later.

I also need to find a good way to work through each line so each drum to trigger plays at pretty much the same time before moving onto the next line of data.

8
Project Guidance / Arduino pro mini voltage regul...
Last post by spaceuino - Today at 04:01 am
Hello

I require a current of about 300mA for my project using the mini.

The datasheet for the arduino pro mini regulator states 320mA current limit? Why does the Arduino schematic state 150mA?

http://ww1.microchip.com/downloads/en/DeviceDoc/20005785A.pdf


If it is 150mA, I am going to install an external regulator and feed the mini via the VCC input pin.

However, I need the regulator to have very low Quiescent current to minimize battery consumption.

Can anyone recommend one? Does anyone foresee any issues with this solution?
9
Software / Problema de usar servidor web ...
Last post by BrewGold - Today at 03:58 am
Buenas noches:

Voy a plantear un problema que existe en las redes móviles, no cuentan con IP pública sino una IP privada. Si queremos acceder a nuestro Arduino, no va ser posible, salvo desde la red q de la empresa de móviles.

Mi planteamiento es en vez de trabajar como servidor el Arduino, trabajar como cliente web Arduino.

Ahora si la pregunta, creo que tendría que estar llamando al servidor, de la misma forma que lo hace una recepción de correo electrónico? Y así generar el vínculo?

Si me dan algunas ideas, lo agradeceré.
10
Sensors / Re: Differences on DS18B20 res...
Last post by GolamMostafa - Today at 03:58 am
@OP

Let us get clarified the meaning of 'Resolution' in the context of DS18B20 Temperature Sensor.

1.  There is a programmable ADC (analog-to-digital converter) inside the DS18B20 sesnor. We can command the sensor to take a sample of 'input (how warm it is) signal' and convert it into 9-bit or 10-bit of 11-bit or 12-bit which is later on presented in 0C unit.

2.  The following diagram (taken from the data sheets of the sensor) tells about the bit pattern of the ADC value.

Figure-1:

(1)  The Fig-1 says that the temperature value has two parts -- integer part and the fractional part. This is to say that the temperature is a floating point number (simply float). In Fig-1, the decimal point (the . symbol) is not shown/included; but, it is understood and it is located just after this: 20 and before this: 2-1. There is also a sign (S) bit which (when assumes Logic-High state) represents -ve temperature. (The float value is encoded in 2's complement form and not in binary32 format.)

(2)  In Fig-1, we observe that there are upto 4 digits that we can include after the decimal point and these are: 2-1, 2-2, 2-3, and 2-4 with respective positional values of: 0.50C, 0.250C, 0.1250C, and 0.06250C.

(3)  Now, the meanings of setting up 'Resolution' to 9-bit, 10-bit, 11-bit, and 12-bit' stand as:
(a) 9-bit:  
1-bit for sign, 7-bit for integer part, and 1-bit for fractional part (1-digit after decimal point)

Temperature range: xxx.00C to xxx.50C in 0.50C discrete step.

The command to present this float temperature (dsTemp) of 1-digit precision (number of digit after the decimal point) when the ADC Resolution is 9-bit.
Serial.print(temp, 1); //temp must be in float; 2nd argument 1 refers 1-digit precision

(Let us observe that there is subtle difference between precision and resolution.)

(b) 10-bit:  
1-bit for sign, 7-bit for integer part, and 2-bit for fractional part (2-digit after decimal point)
Temperature range: xxx.000C to xxx.750C in 0.250C discrete step.

The command to present this float temp:
Serial.print(dsTemp, 2);

(c) 11-bit:  
1-bit for sign, 7-bit for integer part, and 3-bit for fractional part (3-digit after decimal point)
Temperature range: xxx.0000C to xxx.8750C in 0.1250C discrete step.

The command to present this float temp:
Serial.print(dsTemp, 3);

(d) 12-bit:  
1-bit for sign, 7-bit for integer part, and 4-bit for fractional part (4-digit after decimal point)
Temperature range: xxx.00000C to xxx.93750C in 0.06250C discrete step.

The command to present this float temp:
Serial.print(dsTemp, 4);


Hope that the issue is clear!

The Test Codes: (tested in UNO)
Code: [Select]

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 2  //DPin-2 of UNO at signal terminal

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
float dsTemp;

void setup(void)
{
  Serial.begin(9600);
  sensors.begin();      //initialize One-Wire Sensor -- DS18B20
}

void loop(void)
{
  sensors.setResolution(9);  //before each measurement, set resolution
  //sensors.setResolution(10);
  //sensors.setResolution(11);
  //sensors.setResolution(12);
  sensors.requestTemperatures();  // Temp conversion command; waiting here until comversion is done
  dsTemp = sensors.getTempCByIndex(0);  //read temp data from Sensor #0 and convert to celsius float
 
  Serial.println(dsTemp, 1);  //1-digit precision
  //Serial.println(dsTemp, 2);  //2-digit precision
  //Serial.println(dsTemp, 3);  //3-digit precision
  //Serial.println(dsTemp, 4);  //4-digit precision
  delay(1000);    //sample temperature at 1-sec interval
}[/cod
Pages: [1] 2 3 ... 10