Loading...
  Show Posts
Pages: [1] 2
1  Using Arduino / General Electronics / Re: Zener Diode affecting Voltage divider on: January 07, 2013, 05:07:18 pm
LarryD

I'll wil have a read and will have a play with your circuit.
Again thanks for taking the time to reply.

Grumpy_Mike

I thought about lower values but thought the values you suggest would draw 50ma which make be a little excess and generate heat.
Also I thought the sweet spot for ADC inputs was 10k?
Or am I wrong?

2  Using Arduino / General Electronics / Re: Zener Diode affecting Voltage divider on: January 07, 2013, 01:07:25 pm
LarryD

Thanks for the reply

I just took one of the Zener's I'm using and put it straight across my bench PSU and it limits dead on 5.1V so I'm happy I'm outside of the knee.

Also just having a poke around again, if I put 12volts into the circuit I would expect to see 4volts at the junction of the 2 resistors.
Without the Zener I see 4volts, but as soon at I put the Zener in circuit it drops to 3.1volts.
I also just swapped the resistors out for 1/2w type in case it was this.

I'm stumped.
3  Using Arduino / General Electronics / Re: Zener Diode affecting Voltage divider on: January 07, 2013, 12:27:47 pm
Sorry this is just a quick sketch to show the divider, assume the pic has power etc please.
I realised I hadn't drawn it correctly in my haste.
4  Using Arduino / General Electronics / Re: Zener Diode affecting Voltage divider on: January 07, 2013, 12:25:07 pm
I guess showing the Zener would be useful, FYI I'm using .4w resistors
5  Using Arduino / General Electronics / Zener Diode affecting Voltage divider on: January 07, 2013, 11:47:44 am
I have a voltage divider measuring  a car battery
Volts +-20k <> 10K - Ground with a ATtiny85 ADC connected to the junction of the 2 resistors. (with a 100nf cap on the input to the ADC to ground)

Everything works fine but I added a 5.1Volt Zener to stop any spikes and this is dragging  /affecting the ADC reading down from 1023 for 15v (5v at the pin) down to 1014 for 15V.
If I remove the zener and just measure the voltage with a fluke scope it also affects the reading, i just tried a basic DVM and this doesn't affect the reading so I am assuming its a capacitive issue rather than the voltage being dragged down.

I've built two prototypes and both do the same.

Has anyone else had a similar issue, I did try searching but couldn't find any answers.

Rob

6  Using Arduino / Programming Questions / Re: ATtiny45 TinyDebugSerial wont compile on: November 26, 2012, 05:53:30 pm
Coding Badly

The Sketch works perfectly, this will certainly save some time.

Thanks for the great work.

Rob
7  Using Arduino / Programming Questions / Re: ATtiny45 TinyDebugSerial wont compile on: November 26, 2012, 05:24:41 pm
Coding Badly

FYI I moved the sketch and it compiled OK, Thanks.
Also the README is Zero Byte
8  Using Arduino / Programming Questions / Re: ATtiny45 TinyDebugSerial wont compile on: November 25, 2012, 06:41:30 am
Coding Badly

Thanks for the reply & this look likes the ideal solution.

I had a read then downloaded the master and dropped it into the library as TinyISP (MAC OSX IDE 1.01)
If I compile I get a lot of errors, before I continue  I assume it works with 1.01?







TinyISP/KnockBangParser.cpp.o: In function `TinyDebugKnockBangParserClass::process()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/KnockBangParser.cpp:51: multiple definition of `TinyDebugKnockBangParserClass::process()'
KnockBangParser.cpp.o:KnockBangParser.cpp:51: first defined here
TinyISP/KnockBangParser.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/KnockBangParser.cpp:51: multiple definition of `TinyDebugParser'
KnockBangParser.cpp.o:KnockBangParser.cpp:51: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::setMode(AispLEDClass::mode_t)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:94: multiple definition of `AispLEDClass::setMode(AispLEDClass::mode_t)'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:94: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::update()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:108: multiple definition of `AispLEDClass::update()'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:108: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::flash()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:77: multiple definition of `AispLEDClass::flash()'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:77: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::error()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:66: multiple definition of `AispLEDClass::error()'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:66: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::begin(unsigned char)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:53: multiple definition of `AispLEDClass::begin(unsigned char)'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:53: first defined here
TinyISP/TinyISP_AispLED.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:94: multiple definition of `StatusIndicator'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:94: first defined here
TinyISP/TinyISP_Monitor.cpp.o: In function `monitor_run(unsigned char&)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Monitor.cpp:123: multiple definition of `monitor_run(unsigned char&)'
TinyISP_Monitor.cpp.o:TinyISP_Monitor.cpp:123: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `programmer_toggle_hold_in_reset()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_error_occurred()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:857: multiple definition of `programmer_error_occurred()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:857: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_release_target_from_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:829: multiple definition of `programmer_release_target_from_reset()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:829: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_hold_target_in_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:852: multiple definition of `programmer_hold_target_in_reset()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:852: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_reset_target()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:834: multiple definition of `programmer_reset_target()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:834: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `param'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_process_command(unsigned char)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:689: multiple definition of `programmer_process_command(unsigned char)'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:689: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `programmer_active'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here
TinyISP/TinyISP_SPI.cpp.o: In function `spi_begin()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_SPI.cpp:67: multiple definition of `spi_begin()'
TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:67: first defined here
TinyISP/TinyISP_SPI.cpp.o: In function `spi_end()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_SPI.cpp:102: multiple definition of `spi_end()'
TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:102: first defined here
TinyISP/TinyISP_SPI.cpp.o: In function `spi_send':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_SPI.cpp:120: multiple definition of `spi_transaction(unsigned char, unsigned char, unsigned char, unsigned char)'
TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:120: first defined here
TinyISP/TinyISP_SPI.cpp.o: In function `spi_transaction2(unsigned long)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_SPI.cpp:183: multiple definition of `spi_transaction2(unsigned long)'
TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:183: first defined here
9  Using Arduino / Programming Questions / Re: ATtiny45 TinyDebugSerial wont compile on: November 24, 2012, 09:23:05 am
Erni

As always thanks for the response.

I found the issue and this may be useful to others.
When I extracted the http://code.google.com/p/arduino-tiny/ I created the directory "hardware" and copied the folder into it and closed and reopened Arduino.
The problem was MAC OSX created a folder called "arduino-tiny-0100-0015" with the Tiny library sat inside (folder name is the zip name)

e.g
hardware/arduino-tiny-0100-0015/arduino-tiny/tiny etc....

However when I restarted  and checked under Tools>Board none of the Tiny Library boards where there.
So I dropped the Library down one level
e.g
hardware/arduino-tiny/tiny etc....

Restarted and now it all works fine.

I assume there is some limit on the amount of directories before Arduino stops looking?

Also for those who get garbled text when they get this working I haven't been able to get any of my Uno or Due boards to display clear text so i have just hooked up and FTDI (USB to Serial board) and it works fine.

Has anybody else had success using the Uno board (pin0) as the RS232 interface?

Enri

Again thanks for the prompt in the right direction.
10  Using Arduino / Programming Questions / ATtiny45 TinyDebugSerial wont compile on: November 24, 2012, 06:56:18 am
I'm having a compiling issue with TinyDebugSerial

I have searched the forums but can't seem to find the answer (this was the closest, http://arduino.cc/forum/index.php/topic,123388.0.html)

I  can get the SoftwareSerial working fine but I can't get TinyDebugSerial to compile.

The error is
tiny_serial:5: error: 'TinyDebugSerial' does not name a type
tiny_serial.cpp: In function 'void setup()':
tiny_serial:9: error: 'mySerial' was not declared in this scope
tiny_serial.cpp: In function 'void loop()':
tiny_serial:15: error: 'mySerial' was not declared in this scope
tiny_serial.cpp: At global scope:
tiny_serial:20: error: function definition does not declare parameters

I have the arduino tiny library installed under hardware and TinyDebugSerial.h is in there
I'm convinced this an error on my MAC rather than an arduino issue.

Can anyone confirm if this compiles please.


The code is this.

#include <TinyDebugSerial.h>
// Definitions
#define rxPin 2
#define txPin 0

TinyDebugSerial mySerial = TinyDebugSerial();

void setup()
{
  mySerial.begin(9600);
}
void loop()
{
   mySerial.print("test");
  delay(1000);
}

11  Using Arduino / Programming Questions / Re: ATTINY45 ADC1 PROBLEM on: November 19, 2012, 12:28:53 pm
Erni

Using the ATtiny support library I'm using you can't define pins as A1,D1 etc just 1,2,etc or PB1,2, etc.

https://github.com/damellis/attiny/tree/Arduino1

So it's my understanding they are defined when you analogRead(1,2,3,4) as per the analogue pinouts below



Like most people here I'm learning as I go, but things I've done with the Uno board don't seem to work with the ATtiny, i just assume the library is not as mature.
12  Using Arduino / Programming Questions / Re: ATTINY45 ADC1 PROBLEM on: November 19, 2012, 09:22:21 am
PaulS

Again thanks for the response.
I was going off of this sheet which showed the ATtiny45 A1 could also be D2 (input or output) so I assumed I had to define it, or am I missing the point which is quite probable  smiley

13  Using Arduino / Programming Questions / Re: ATTINY45 ADC1 PROBLEM on: November 19, 2012, 08:50:42 am
Erin

Thanks for the response.
Before I saw your reply I removed the line making Voltsin an input and this fixed the issue but I thought it was good practice to declare inputs and outputs?
I had already looked at the thread you highlighted and its helped a little but I'm still unclear why I can't define ADC1 (1) as an input but I can the other 3 ADCs (0,2,3)

is this a bug in the ATtiny library or do i never need to define inputs?

Rob

14  Using Arduino / Programming Questions / Re: ATTINY45 ADC1 PROBLEM on: November 19, 2012, 05:26:30 am
After some more investigation I have found the problem but don't know the answer.
It appears that PB1 & 1 (aka ADC1,PB2) are the same pin when I program.

With the code below the LED is very very  faint but does flash in line with the ADC1 voltage.

More confusing as soon as a define the ADC pin as one of the other 3 ADCs the LED flashes at full brightness.

even more confusing is I can flash the LED by addressing it as either PB1 or just 1.
(If I try to define pins as D1 or A1 I get a compile error)

Are physical pins 6 & 7 tied internally?

Any thoughts
 
15  Using Arduino / Programming Questions / ATTINY45 ADC1 PROBLEM on: November 18, 2012, 07:59:51 am
I'm having a play with the ATtiny45 and can program and make it do what i want to do but I have a problem where I can't read ADC1, A1
Using the following code I can change the flash speed of the LED to prove I can read the inputs.
I can read ADC3 & 2 But not 1
I tried defining it as PB2  & A1(wont compile)

Am I being missing something, I've tried several Atiny45 in case it's duff chip

// (Ain0 (D 5) PB5  1|    |8  Vcc
// (Ain3 (D 3) PB3  2|    |7  PB2 (D 2)  Ain1 (Voltsin
// (Ain2 (D 4) PB4  3|    |6  PB1 (D 1) pwm1 (LED)
//                 GND  4|    |5  PB0 (D 0) pwm0
//                           +----+

Here my test code
const int greenPin =  PB1;      // the number of the LED pin
const int VoltsIn  =  1;      // the number of the Volts In pin
int ADCIN;


void setup() {
  // set the digital pin as output:

  pinMode(greenPin, OUTPUT);
  pinMode(VoltsIn, INPUT); 

}
void loop()
{
    ADCIN = analogRead(VoltsIn)  ;
  digitalWrite(greenPin, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(ADCIN);               // wait for  ADC Value
  digitalWrite(greenPin, LOW);    // turn the LED off by making the voltage LOW
  delay(ADCIN);               // wait for  ADC Value
}

Thanks if anyone can point me in the right direction
Pages: [1] 2