Jump to content

Gina

Beyond the Event Horizon
  • Posts

    45,326
  • Joined

  • Last visited

  • Days Won

    120

Everything posted by Gina

  1. I've repaired the UP printer but everything is so worn that producing accurate prints is no longer possible. I'm working on my DIY Pilot printer ATM, rebuilding the X carriage so that is out of action. The larger Titan (another home build) is partly working, particularly for smaller prints and I may try printing the hub part for the wind vane.
  2. Printed the code disc but when I went to print the hub part (in black) the printer stopped working - print bed heating failed. This is the little UP Plus 2 3D printer and this is a repeat of an earlier problem. I am having to reassess the position.
  3. Been doing some clearing up and found an M42 to Canon EF mount adapter ring so since I have a number of M42 Asahi Super Takumar or similar lenses I shall be using these lenses on my DSLRs for widefield. So far I haven't done much with widefield imaging and it's a field I want to get into. ATM I'm trying hard to restore my interest in astro imaging after a long period of not doing any.
  4. I haave now redesigned the hub and encoder disc to give the encoder just over 6mm instead of 3mm and the hub has been thinned down to match. There is now "half a hole" in each part to take the 8mm ali tube for the vane.
  5. Slowly rotating the code disc, I'm seeing quite a large variation of voltages within each segment particularly the black parts - the white parts generally seem fairly consistant at 0.0v. This tells me that the blacks are not black enough - or too close to the sensor perhaps. Some bits of black velour would help the black areas if I can find some. Should have a roll of it somewhere but not seen it for some time I'm trying increasing the distance from code disc to sensors - this is not "carved in stone" yet but this is not really any better. One thing I could do is redesign the hub and code disc to give deeper holes for the black parts.
  6. It's working The test sketch showing the voltages, that is. The pull down currents turned out to be higher than optimum but still alright. I turned the supply voltage down from 13.8v to 12v and it was better. Here are some screenshots of the voltages as displayed in the Serial Monitor. There seem to be odd rogue values in there which will need processing out. I wonder if these are due to inteference pickup and if capacitors across the A/D inputs would help. To do it with processing, I could sample at a higher rate and use majority logic, taking several samples and discarding the rogue values.
  7. Found it DMM testing showed a short from the lowest IR LED positive to Gnd. It was a minute sliver of remaining copper where the stripboard track should have be severed. I missed it on earlier inspection I'll put it all back together and test it again tomorrow. Done enough for today I've proved the DS2450 is still working and found the problem with the no.4 optical sensor - it should work now that I've removed the short.
  8. I have now wired up the wind direction encoder and it's mostly working The DS2450 is working fine and I have loaded the voltage reading sketch so that I can see what voltages the optical sensors are producing. There is one optical sensor not working - the DS2450 is showing a constant 4.6v which is the supply voltage feeding the pull-up resistors, so the phototransistor is not pulling the input down. Could be several things. A short across the IR LED or open circuit connection to the phototransistor, for example. I shall need to open the encoder casing again and check. Oh well, nothing unusual. The working sensors are giving a low level of a few hundred millivolts and a high level of around 3v or so. A threshold level of 1.5v would therefore be suitable. Here is the test sketch I'm using. /* * DS2450Voltages * * This example demonstrates the use of the DS2450 library and the Arduino * OneWire library to read voltages from a Dallas Semiconductor * DS2450 quad a/d. * * by Joe Bechter * * (C) 2012, bechter.com * * All files, software, schematics and designs are provided as-is with no warranty. * All files, software, schematics and designs are for experimental/hobby use. * Under no circumstances should any part be used for critical systems where safety, * life or property depends upon it. You are responsible for all use. * You are free to use, modify, derive or otherwise extend for your own non-commercial purposes provided * 1. No part of this software or design may be used to cause injury or death to humans or animals. * 2. Use is non-commercial. * 3. Credit is given to the author (i.e. portions © bechter.com), and provide a link to the original source. * */ #include <Arduino.h> #include <OneWire.h> #include <DS2450.h> // define the Arduino digital I/O pin to be used for the 1-Wire network here const uint8_t ONE_WIRE_PIN = 8; // define the 1-Wire address of the DS2450 quad a/d here (lsb first) uint8_t DS2450_address[] = { 0x20, 0xAD, 0x30, 0x12, 0x00, 0x00, 0x00, 0x42 }; OneWire ow(ONE_WIRE_PIN); DS2450 ds2450(&ow, DS2450_address); void setup() { Serial.begin(9600); ds2450.begin(); } void loop() { ds2450.update(); if (ds2450.isError()) { Serial.println("Error reading from DS2450 device"); } else { for (int channel = 0; channel < 4; channel++) { Serial.print("Channel "); Serial.print(char('A' + channel)); Serial.print(" = "); Serial.print(ds2450.getVoltage(channel), 1); if (channel < 3) { Serial.print("v, "); } else { Serial.println("v."); } } } delay(500); }
  9. Working on the vane direction circuit now - much more complicated and proving awkward to fit in the space, avoiding the fixing holes for the lid and anemometer base.
  10. The DS2423 counters count up to 2^32 = 4,294,967,296. This means they are capable of dealing with 100mph continuous wind for 42949672.96 hours = just under 4900 years. I think that will do
  11. I now have the Anemometer connected to the wind instruments 1-wire circuit board and running the DS2423 sketch. The Serial Monitor is showing an increasing count as I rotate the anemometer rotor 1 count per cup ie. 3 counts per revolution as should be RESULT - 1-wire anemometer working
  12. Ah - the quote has worked this time That's too expensive for me - Arduino Nano + DHT22 + DS2408 + hardware doesn't cost as much And can do other things as well.
  13. Yes. I'm not using Java and it looks like his book was written in the BA epoch (Before Arduino) For the data mashing and web page dials and gauges I've used Python - which I shall have to bone up on when I get to that stage again. I just want a simple indoor display for now. I have just had another browse through the book and was interested in his approach to a 1-wire humidity sensor but it seems so inaccurate (and awkward) that I think I'll stick with DHT22 directly connected to Arduino. In fact I shall have several Arduinos in the observatory to measure various environmental conditions and control various things so that isn't much of a problem. I can communicate with all of these by 1-wire bus now that I have the DS2408 sussed. I have some code to write to communicate with the DS2408 library but don't think that will be a problem. Might even write an Arduino library to cover the low level bit manipulation - or add to the DS2408 library.
  14. Yes. I'm not using Java and it looks like his book was written in the BA epoch (Before Arduino) For the data mashing and web page dials and gauges I've used Python - which I shall have to bone up on when I get to that stage again. I just want a simple indoor display for now. I have just had another browse through the book and was interested in his approach to a 1-wire humidity sensor but it seems so inaccurate (and awkward) that I think I'll stick with DHT22 directly connected to Arduino. In fact I shall have several Arduinos in the observatory to measure various environmental conditions and control various things so that isn't much of a problem. I can communicate with all of these by 1-wire bus now that I have the DS2408 sussed. I have some code to write to communicate with the DS2408 library but don't think that will be a problem. Might even write an Arduino library to cover the low level bit manipulation - or add to the DS2408 library.
  15. Looking back at the "direction table" for the wind direction sketch, I see they are using three voltage levels in the analogue inputs of the DS2450. This arises from using 8 reed switches and magnets and allowing for the overlap of the magnetic fields to obtain 16 directions from 8 switches. I'm using a totally different system with the full 16 directions coded in binary form so this table will need changing (not a problem ). The optical sensors do not provide logic levels as such but will vary from the black level to the white level in a ramp as the vane turns from fully in the black to fully in the white and similarly from white to black. Also the black and white voltage levels vary due to changes in reflectivity of the printed code disc and hub. I could just apply a threshold of around 2.5v and convert directly to digital but better would be to apply two thresholds representing low, changing, high and if in the inbetween state (changing) hold the previous direction. This has the effect of applying a Schmitt trigger action. Whether the extra complication is warranted by this application is questionable.
  16. This is a circuit diagram more related to positions of components.
  17. Thought I had some 5.1v zener diodes but I can't find any so it'll have to be 4.7v of which I have several. Next nearest is 5.6v but that exceeds the 5.5v maximum for the chips. I've done some wiring up with more to do but I think I've finished for tonight. Wiring for the optical sensors.
  18. I've done some more testing of the optical sensor and come up with suitable resistor values. The IR LED needs a substantial current to work at all and the workable minimum seems to be with 180Ω from 5v with the LED dropping 1.2v. Thus the current is 3.8v in 180Ω = 21mA. There are 4 IR LEDs which could be wired in series-parallel for running off 5v or all in series for running off 12v. Now the wind instruments mast will be near the observatory with the CAT5 cable going into it so 12v (or more precisely 13.8v) is readily available from the main observatory supply. Powering the IR LEDS wants 20mA and the resistor wants to drop 13.8 - 4x1.2 = 9v. Resistance required = 9 / 0.02 = 450Ω. The DS2450 has parasitic power internally but the DS2423 needs 2.8-5.5v supply at a few μA. This may be obtained either by external parasitic power from the 1-wire bus or from the 13.8v with resistor and zener diode - a regulator chip would be overkill. The full 13.8v is also fine for the Hall effect sensor used in the anemometer which wants 4.5v to 24v.
  19. 0x20 is the DS2450 family, 0x28 the DS18B20 family and 0x1D the DS2423 family. I have now put the addresses for the DS2423 and DS2450 in the appropriate sketches, updated the libraries and run the sketches and the results look promising. The counter reads zero as expected and the direction reads N also as expected with no sensors illuminated. I conclude that the 1-wire devices are being read successfully and I can wire them up to the new sensors and assemble the wind vane direction system
  20. I noticed mention of Tim Bitson's "Weather Toys" which is a book I have so I think it's time I re-read it - might help me from "reinventing the wheel" Just minor mods to the above sketches should be all that's required for what I want. The individual IDs of the 1-wire devices need replacing with the actual values of devices used. I already have a sketch to read these. // This sketch looks for 1-wire devices and // prints their addresses (serial number) to // the UART, in a format that is useful in Arduino sketches // Tutorial: // http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html #include <OneWire.h> OneWire ds(8); // Connect your 1-wire device to pin 8 void setup(void) { Serial.begin(9600); discoverOneWireDevices(); } void discoverOneWireDevices(void) { byte i; byte present = 0; byte data[12]; byte addr[8]; Serial.print("Looking for 1-Wire devices...\n\r"); while(ds.search(addr)) { Serial.print("\n\rFound \'1-Wire\' device with address:\n\r"); for( i = 0; i < 8; i++) { Serial.print("0x"); if (addr[i] < 16) { Serial.print('0'); } Serial.print(addr[i], HEX); if (i < 7) { Serial.print(", "); } } if ( OneWire::crc8( addr, 7) != addr[7]) { Serial.print("CRC is not valid!\n"); return; } } Serial.print("\n\r\n\rThat's it.\r\n"); ds.reset_search(); return; } void loop(void) { // nothing to see here } Currently I have the DS2423, DS2450 and a DS18B20 on the 1-wire bus on an Arduino Uno I'm using for testing and this is the display in the Serial Monitor
  21. I shall soon be ready to test the wind vane encoder and anemometer so I'm checking up on the 1-wire sketches for accessing the present 1-wire devices and seeing if these obsolete devices are still accessible, because if they are and I can get things working it will save me devising something new. The two chips used are the DS2423 dual counter and the DS2450 quad A/D converter. These are already mounted onto stripboard and modification for the new sensors is just a matter of changing resistors and wiring up to the new sensors instead of the IR LED and phototransistor separate components. Here is an example sketch for the DS2423 - reading the counters is so simple /* * DS2423Counter * * This example demonstrates the use of the DS2423 library and the Arduino * OneWire library to read a counter value from a Dallas Semiconductor DS2423. * * by Joe Bechter * * (C) 2012, bechter.com * * All files, software, schematics and designs are provided as-is with no warranty. * All files, software, schematics and designs are for experimental/hobby use. * Under no circumstances should any part be used for critical systems where safety, * life or property depends upon it. You are responsible for all use. * You are free to use, modify, derive or otherwise extend for your own non-commercial purposes provided * 1. No part of this software or design may be used to cause injury or death to humans or animals. * 2. Use is non-commercial. * 3. Credit is given to the author (i.e. portions © bechter.com), and provide a link to the original source. * */ #include <Arduino.h> #include <OneWire.h> #include <DS2423.h> // define the Arduino digital I/O pin to be used for the 1-Wire network here const uint8_t ONE_WIRE_PIN = 2; // define the 1-Wire address of the DS2423 counter here uint8_t DS2423_address[] = { 0x1D, 0x76, 0x31, 0x09, 0x00, 0x00, 0x00, 0x33 }; OneWire ow(ONE_WIRE_PIN); DS2423 ds2423(&ow, DS2423_address); void setup() { Serial.begin(9600); ds2423.begin(); } void loop() { ds2423.update(); if (ds2423.isError()) { Serial.println("Error reading counter"); } else { Serial.print("Count = "); Serial.println(ds2423.getCount()); } delay(500); } Now to the DS2450. One of the examples in the Arduino Library as published on GitHub is for wind direction, would you believe, so the job is pretty much done for me /* * DS2450Direction * * This example demonstrates the use of the DS2450 library and the Arduino * OneWire library to read wind vane direction from a Dallas Semiconductor DS2450 * quad a/d in an AAG wind vane. * * by Joe Bechter * * (C) 2012, bechter.com * * Tim Bitson's "Weather Toys" was used as a reference for the voltage table and direction selection algorithm. * * All files, software, schematics and designs are provided as-is with no warranty. * All files, software, schematics and designs are for experimental/hobby use. * Under no circumstances should any part be used for critical systems where safety, * life or property depends upon it. You are responsible for all use. * You are free to use, modify, derive or otherwise extend for your own non-commercial purposes provided * 1. No part of this software or design may be used to cause injury or death to humans or animals. * 2. Use is non-commercial. * 3. Credit is given to the author (i.e. portions © bechter.com), and provide a link to the original source. * */ #include <Arduino.h> #include <OneWire.h> #include <DS2450.h> // define the Arduino digital I/O pin to be used for the 1-Wire network here const uint8_t ONE_WIRE_PIN = 2; // define the 1-Wire address of the DS2450 quad a/d here (lsb first) uint8_t DS2450_address[] = { 0x20, 0x1C, 0x86, 0x00, 0x00, 0x00, 0x00, 0x9E }; // define North offset here const int NORTH_OFFSET = 0; OneWire ow(ONE_WIRE_PIN); DS2450 ds2450(&ow, DS2450_address); const float directionTable[16][4] = { { 4.5, 4.5, 2.5, 4.5 }, // N { 4.5, 2.5, 2.5, 4.5 }, // NNE { 4.5, 2.5, 4.5, 4.5 }, // NE { 2.5, 2.5, 4.5, 4.5 }, // ENE { 2.5, 4.5, 4.5, 4.5 }, // E { 2.5, 4.5, 4.5, 0.0 }, // ESE { 4.5, 4.5, 4.5, 0.0 }, // SE { 4.5, 4.5, 0.0, 0.0 }, // SSE { 4.5, 4.5, 0.0, 4.5 }, // S { 4.5, 0.0, 0.0, 4.5 }, // SSW { 4.5, 0.0, 4.5, 4.5 }, // SW { 0.0, 0.0, 4.5, 4.5 }, // WSW { 0.0, 4.5, 4.5, 4.5 }, // W { 0.0, 4.5, 4.5, 2.5 }, // WNW { 4.5, 4.5, 4.5, 2.5 }, // NW { 4.5, 4.5, 2.5, 2.5 } // NNW }; const char directions[17][4] = { "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "Err" }; void setup() { Serial.begin(9600); ds2450.begin(); } void loop() { ds2450.update(); if (ds2450.isError()) { Serial.println("Error reading from DS2450 device"); } else { int direction = 16; float ch_a = ds2450.getVoltage(0); float ch_b = ds2450.getVoltage(1); float ch_c = ds2450.getVoltage(2); float ch_d = ds2450.getVoltage(3); for (int i = 0; i < 16; i++) { if (((ch_a < directionTable[i][0] + 1.0) && (ch_a >= directionTable[i][0] - 1.0)) && ((ch_b < directionTable[i][1] + 1.0) && (ch_b >= directionTable[i][1] - 1.0)) && ((ch_c < directionTable[i][2] + 1.0) && (ch_c >= directionTable[i][2] - 1.0)) && ((ch_d < directionTable[i][3] + 1.0) && (ch_d >= directionTable[i][3] - 1.0))) { direction = (i + NORTH_OFFSET) % 16; break; } } Serial.println(directions[direction]); } delay(500); }
  22. Gray encoder disc fitted to wind vane hub. Surface of hub painted black for greater differene in reflectivity.
  23. Gray code disc printed. Here is a photo of the optical sensors soldered onto pieces of strip board and placed in approximate position in top flange.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.