author
8Instructables31,903Views26CommentsJoined March 12th, 2016

Tell us about yourself!

Complete Your Profile

Achievements

10K+ Views Earned a bronze medal
  • rgco commented on rgco's instructable Simple Arduino Metal Detector3 weeks ago
    Simple Arduino Metal Detector

    Hi, I'm afraid the sensitivity won't increase by pushing more current through. For measuring inductance no large currents are required, just like for a precision measurement of a resistor your multimeter uses just microamps.I can see several ways to improve the sensitivity, most have come up in the other comments:* use the 1.1V reference to use the 10-bit ADC scale more effectively* make the coil part of an oscillating LC circuit and measure its frequency.* make a pulse-induction metal detector.You are probably thinking of the latter. But a pulse-induction metal detector is a very different thing. It takes big current, fast switching (MOSFETs, not relays), precise timing, careful coil design etc, and probably a good oscilloscope to do the development. Cheers!

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector1 month ago
    Simple Arduino Metal Detector

    Hi, I saw clear opposite-sign response when putting a iron wrench and also when putting a box of staplers.It doesn't come out so well in the video, but you see it starts flashing blue (lower inductance) for some metals and green (higher inductance) for others.I would suggest to try a few more iron-based object. There is a large variety of the magnetic susceptibility depending on the precise type of alloy and how it's been forged or melted.

    View Instructable »
  • rgco's instructable Fix and Upgrade a Cappuccino Mixer's weekly stats: 2 months ago
    • Fix and Upgrade a Cappuccino Mixer
      75 views
      1 favorites
      0 comments
  • rgco commented on rgco's instructable Simple Arduino Metal Detector2 months ago
    Simple Arduino Metal Detector

    Time is something that the Arduino can measure with very high precision: it has a pretty stable crystal and the timers can be set up to measure with a resolution of a single clock cycle (1/16th of a microsecond). The length of a single LC pulse won't be very accurate (10^-3 for a single pulse of a 16kHz signal). But keeping track of multiple transitions for even 10ms should give 10^-5 precision. An LC oscillator like the one in https://www.instructables.com/id/bfo-metal-detecto... (left side of the schematic) uses just 1 transistor, 2 capacitors and 1 resistor (plus the coil). There may not even be a need for an external comparator since the Arduino has a built-in comparator, which can be used for interrupts (if I recall well...)OK sorry, just thinking aloud. Could be a project for the ...

    see more »

    Time is something that the Arduino can measure with very high precision: it has a pretty stable crystal and the timers can be set up to measure with a resolution of a single clock cycle (1/16th of a microsecond). The length of a single LC pulse won't be very accurate (10^-3 for a single pulse of a 16kHz signal). But keeping track of multiple transitions for even 10ms should give 10^-5 precision. An LC oscillator like the one in https://www.instructables.com/id/bfo-metal-detecto... (left side of the schematic) uses just 1 transistor, 2 capacitors and 1 resistor (plus the coil). There may not even be a need for an external comparator since the Arduino has a built-in comparator, which can be used for interrupts (if I recall well...)OK sorry, just thinking aloud. Could be a project for the christmas holidays! Cheers

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector2 months ago
    Simple Arduino Metal Detector

    Hi, I don't think it's possible to go very deep with induction measurement: the magnetic field of a coil diminishes with the 3rd power of the distance/radius. So doubling the depth results in an inductance chance that is 8 times smaller, and very quickly below the detection threshold

    // Metal detector// Runs a pulse over the search loop in series with resistor// Voltage over search loop spikes// Through a diode this charges a capacitor// Value of capacitor after series of pulses is read by ADC// Metal objects near search loop change inductance.// ADC reading depends on inductance.// changes wrt long-running mean are indicated by LEDs// LED1 indicates rise in inductance// LED2 indicates fall in inductance// the flash rate indicates how large the difference is// wiring:// 220Ohm resistor on D2// 10-loop D=10cm seach loop between ground and resistor// diode (-) on pin A0 and (+) on loop-resistor connection// 10nF capacitor between A0 and ground// LED1 in series with 220Ohm resistor on pin 8// LED2 in series with 220Ohm resistor on pin 9// First time, run with with seri...

    see more »

    // Metal detector// Runs a pulse over the search loop in series with resistor// Voltage over search loop spikes// Through a diode this charges a capacitor// Value of capacitor after series of pulses is read by ADC// Metal objects near search loop change inductance.// ADC reading depends on inductance.// changes wrt long-running mean are indicated by LEDs// LED1 indicates rise in inductance// LED2 indicates fall in inductance// the flash rate indicates how large the difference is// wiring:// 220Ohm resistor on D2// 10-loop D=10cm seach loop between ground and resistor// diode (-) on pin A0 and (+) on loop-resistor connection// 10nF capacitor between A0 and ground// LED1 in series with 220Ohm resistor on pin 8// LED2 in series with 220Ohm resistor on pin 9// First time, run with with serial print on and tune value of npulse// to get capacitor reading between 200 and 300byte npulse;const byte pin_pulse=A2;const byte pin_cap =A3;const byte pin_LED1 =PB1;const byte pin_LED2 =PB2;const byte pin_tone =PB0;void setup() { pinMode(pin_pulse, OUTPUT); digitalWrite(pin_pulse, LOW); pinMode(pin_cap, INPUT); pinMode(pin_LED1, OUTPUT); digitalWrite(pin_LED1, LOW); pinMode(pin_LED2, OUTPUT); digitalWrite(pin_LED2, LOW); pinMode(pin_tone, OUTPUT); digitalWrite(pin_tone, LOW); //calibrate the number of pulses to apply for (npulse=0; npulse<100; npulse++){ if(meas(npulse)>300)break; } }// perform measurement using n pulsesint meas(byte n){ //reset the capacitor pinMode(pin_cap,OUTPUT); digitalWrite(pin_cap,LOW); delayMicroseconds(20); pinMode(pin_cap,INPUT); //apply the pulses for (byte i=0; i<n; i++){ digitalWrite(pin_pulse,HIGH); //takes 3.5 microseconds delayMicroseconds(3); digitalWrite(pin_pulse,LOW); //takes 3.5 microseconds delayMicroseconds(3); } //read the charge on the capacitor return analogRead(pin_cap); }const byte shortexp=6;const byte longexp=10;long int shortsum=(300<<shortexp);long int longsum=(300<<longexp);long int difsum=0;const int clickval=100;byte ledcnt1=0;byte ledcnt2=0;bool click=false;void loop() { int val=meas(npulse); shortsum+=val; longsum+=val; shortsum-=(shortsum>>shortexp); longsum-=(longsum>>longexp); int dif=shortsum-(longsum>>(longexp-shortexp)); difsum+=dif; click=false; if(difsum>clickval){ ledcnt1=10; click=true; difsum-=clickval; } if(difsum<-clickval){ ledcnt2=10; click=true; difsum+=clickval; } if(click){ if(digitalRead(pin_tone)==LOW)digitalWrite(pin_tone,HIGH); if(digitalRead(pin_tone)==HIGH)digitalWrite(pin_tone,LOW); } if(ledcnt1>0){ digitalWrite(pin_LED1,HIGH); ledcnt1--; } else { digitalWrite(pin_LED1,LOW); } if(ledcnt2>0){ digitalWrite(pin_LED2,HIGH); ledcnt2--; } else { digitalWrite(pin_LED2,LOW); }}

    Thanks for all your feedback Jim and please keep up updated!The method in your link does not look very promising to me.Metal detection by inductance change has severe limitations regarding depth and size of the object. As a rule of thumb, the change in inductance at zero depth corresponds to the area of the object divided by the area of the coil. At nonzero depth, divide that fraction by the 3rd power of the ratio of the distance to the radius. So for a 10cm coil, a 2cm coin at 10cm distance, gives an inductance change of (2/10)**2 / (10/5)**3 = 0.04 / 8 =0.5%.So staying with this technique, the most important is to get good sensitivity to very small changes.The Arduino ADC can easily get to 10^-3, especially with a well-chosen reference and averaging multiple measurements. But 10^-4 wo...

    see more »

    Thanks for all your feedback Jim and please keep up updated!The method in your link does not look very promising to me.Metal detection by inductance change has severe limitations regarding depth and size of the object. As a rule of thumb, the change in inductance at zero depth corresponds to the area of the object divided by the area of the coil. At nonzero depth, divide that fraction by the 3rd power of the ratio of the distance to the radius. So for a 10cm coil, a 2cm coin at 10cm distance, gives an inductance change of (2/10)**2 / (10/5)**3 = 0.04 / 8 =0.5%.So staying with this technique, the most important is to get good sensitivity to very small changes.The Arduino ADC can easily get to 10^-3, especially with a well-chosen reference and averaging multiple measurements. But 10^-4 would be hard if not impossible.In fact, the classical BFO metal detector (see e.g. https://www.instructables.com/id/Home-Made-BFO-met... )can be sensitive to 1Hz on a base of 10^5Hz, so 10^-5 sensitivity.I think the following might work: if the coil is made part of an LC circuit (with a good stable capacitor), the Arduino could measure the frequency with very good precision, e.g. by recording time-stamps of the internal timers whenever the oscillating signal goes over threshold (and fires an interrupt). This way the super-high sensitivity of a BFO is achieved, but with much fewer components, and all the flexibility of the Arduino, such as autocalibration, noise filters, and a wide range of output modes.

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector4 months ago
    Simple Arduino Metal Detector

    An external reference can indeed also be applied, and would have a similar effect. I would think a resistor-divider would do the job as well. The difference with the internal 1.1V is that Vref from a divider would follow variations in the supply voltage and thus might give better stability...

    View Instructable »
  • rgco made the instructable DIY Lab Bench Variable Power Supply 5 months ago
    DIY Lab Bench Variable  Power Supply

    Done! The scheme is the same but a few details differ:For enclosure I used an old plastic nivea handcream pot - it was the first thing I found that seemed to fit the components and it's sturdy enough to fit all dials on the lid yet soft enough to cut the holes without a drill.I left the external PS outside the enclosure and connect it with a DC jack. This way I don't need to cut the cable of the external PS. Unfortunately, the only PS that has a common DC jack, for which I could find cheap female jacks on aliexpress, are 12V. I'm using a 12V 2A PS of an external disk for now.With 12V input the output is limited to ~11V which also means the potentiometers use a very small fraction of the full turn. I'm thinking of adding fixed resistors to the potentiometers to improve their sensitivity,...

    see more »

    Done! The scheme is the same but a few details differ:For enclosure I used an old plastic nivea handcream pot - it was the first thing I found that seemed to fit the components and it's sturdy enough to fit all dials on the lid yet soft enough to cut the holes without a drill.I left the external PS outside the enclosure and connect it with a DC jack. This way I don't need to cut the cable of the external PS. Unfortunately, the only PS that has a common DC jack, for which I could find cheap female jacks on aliexpress, are 12V. I'm using a 12V 2A PS of an external disk for now.With 12V input the output is limited to ~11V which also means the potentiometers use a very small fraction of the full turn. I'm thinking of adding fixed resistors to the potentiometers to improve their sensitivity, e.g. adding 10k to the 'useless' leg. Any idea if that'll be OK? It'll behave like a 20k pot, I suppose that's fine but haven't tried it out yet. Ideally I'd replace the 10k potentiometer by a 5k and then add a 5k fixed, but I only have 10K.I really think this PS is the best for everyone on a low budget, the total cost of the components (excluding external PS and enclosure) is about 4 EUR (2 for display, 1 for buck, 1 for pots, switch, jack), and to get a regulated PS with current limit and simultaneous digital readout of voltage and current is awesome. I've already been trying it out on NiCr wire and a Peltier element.My plan is to keep an eye open for a stronger PS and better enclosure and make another one with more power. Cheers!

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector5 months ago
    Simple Arduino Metal Detector

    Hi, glad you like it!I did read a little about the various types of metal detectors, and I'm afraid that it's hard to improve on this type without fundamental changes. The reason is that this type of metal detection (measuring the inductance) is sensitive to the total inductance of the coil, and it only changes a tiny bit in the vicinity of metals. So you're always looking for a small change on a big number.To overcome that, you need a pulse-induction: send a pulse, then record the response. So you get zero for no metal and something non-zero if there is metal.I think it's possible to make that type with and Arduino as well, but it requires higher voltages, faster switching and better gating. I gave it a quick try but it didn't immediately work and I don't have a fast scope to debug or ...

    see more »

    Hi, glad you like it!I did read a little about the various types of metal detectors, and I'm afraid that it's hard to improve on this type without fundamental changes. The reason is that this type of metal detection (measuring the inductance) is sensitive to the total inductance of the coil, and it only changes a tiny bit in the vicinity of metals. So you're always looking for a small change on a big number.To overcome that, you need a pulse-induction: send a pulse, then record the response. So you get zero for no metal and something non-zero if there is metal.I think it's possible to make that type with and Arduino as well, but it requires higher voltages, faster switching and better gating. I gave it a quick try but it didn't immediately work and I don't have a fast scope to debug or study it...

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector5 months ago
    Simple Arduino Metal Detector

    Hi!Using the 1.1V reference is a great idea! The sensitivity could increase by up to a factor 5! For the capacitor voltage I had to make a trade-off between large digitisation error at low voltage and low sensitivity to inductance changes at high voltage and so ended up recommending a value of 200-300 (1.0-1.5V). But going in the range 0.8-1.0 V and using the 1.1V reference should solve both problems. Thanks a lot for the idea! I'll definitely try this out for the next version: I'm working on a super-compact version based on the ATTINY13A and using a coincell.Amplifying the difference with an opamp seems a bit of an overkill to me, the component count starts to go up, but in theory what you say should work. A diode with O(1mA) current draw might give a decent reference voltage after wh...

    see more »

    Hi!Using the 1.1V reference is a great idea! The sensitivity could increase by up to a factor 5! For the capacitor voltage I had to make a trade-off between large digitisation error at low voltage and low sensitivity to inductance changes at high voltage and so ended up recommending a value of 200-300 (1.0-1.5V). But going in the range 0.8-1.0 V and using the 1.1V reference should solve both problems. Thanks a lot for the idea! I'll definitely try this out for the next version: I'm working on a super-compact version based on the ATTINY13A and using a coincell.Amplifying the difference with an opamp seems a bit of an overkill to me, the component count starts to go up, but in theory what you say should work. A diode with O(1mA) current draw might give a decent reference voltage after which the difference could be multiplied by a factor 10 or so...Thanks for the feedback and the great idea to use the 1.1V reference!

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector5 months ago
    Simple Arduino Metal Detector

    Interesting!If the tube is metal it won't work: it will effectively shield any EM effect inside.If the tube is an isolator it should work easily: a 3cm metal sphere gives a big change in inductance of a 4- or 5 cm coil.Make the diameter of the coils as small as possible and still fit around the tube. That way the change in inductance will be biggest. With some changes to the code, one Arduino should be able to handle 6 coils.Good luck!

    View Instructable »
  • rgco followed GreatScottLab6 months ago
      • DIY Class D Audio Amplifier
      • Make Your Own Tesla Coil
      • DIY Arduino Soldering Station
  • rgco commented on MaurizioZ's instructable DIY Lab Bench Variable Power Supply 6 months ago
    DIY Lab Bench Variable  Power Supply

    Right what I need, no-nonsense regulated supply based on old laptop supply. Components ordered, will take a while. You got my vote!

    View Instructable »
  • rgco's instructable Thermometer Moodlight's weekly stats: 6 months ago
    • Thermometer Moodlight
      476 views
      20 favorites
      0 comments
  • rgco followed Kedar Nimbalkar6 months ago
      • Make Coca Cola Soda Fountain Dispenser Machine at Your Home Fridge !
      • How to Make EMP Gun !
      • Magnetic Matchstick Trick Cool Party Trick
  • rgco entered Thermometer Moodlight in the Lights Contest 2017 contest 7 months ago
  • rgco entered Thermometer Moodlight in the Untouchable Challenge contest 7 months ago
  • Conway's Life of Life of 16×16 Cells Made With ATtiny13A.

    Brilliant! amazing what you manage to squeeze out of the attiny13A!

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector7 months ago
    Simple Arduino Metal Detector

    Hi, not very deep. For this type of metal detector (based on induction measurement), its range is about half the diameter of the coil. So a larger coil will probe deeper, but be less sensitive to small objects.

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector7 months ago
    Simple Arduino Metal Detector

    Hi, well noted! No, it's actually better to have a single wire. It's just that at the the time I didn't have an 8m piece of wire, so I soldered together two pieces which happened to have two different colours, nothing more than that. Good luck!

    View Instructable »
  • rgco's instructable DIY Bedwetting Alarm's weekly stats: 8 months ago
    • DIY Bedwetting Alarm
      567 views
      9 favorites
      2 comments
  • rgco made the instructable Using SMD Components on Breadboards8 months ago
    Using SMD Components on Breadboards

    Brilliant. This allows me to use 10muF ceramic capacitors that seem te exist only as SMD. Electrolytics do not work well at high frequency, and terribly imprecise.

    View Instructable »
  • rgco entered DIY Bedwetting Alarm in the Microcontroller Contest 2017 contest 8 months ago
  • rgco commented on rgco's instructable Simple Arduino Metal Detector9 months ago
    Simple Arduino Metal Detector

    In my case the search coil has R=4.5cm, N=18 gives L~40muH. But contrary to beat-frequency-oscillation (BFO) detectors, that need a very precise matching, the value of the inductance does not matter much here, and variations of a factor 2 or 3 are fine. The main thing is to have the ADC reading somewhere around 30% of the maximum, where it is most precise. In the inductance of the search coil is too low, the number of pulses per reading can be increased in the code. If the inductance is too high, the number of pulses can be decreased. Also the value of the capacitor can be adjusted.

    View Instructable »
  • rgco commented on rgco's instructable Simple Arduino Metal Detector9 months ago
    Simple Arduino Metal Detector

    Hi, They do the same, only I did not put the sound on the prototype version, since I didn't intent to take it outside. Using a prototype shield is great to set things up quickly, test the idea and the software, but it's too fragile to take outside. Also, outside the sunlight is too strong to see the LEDs well, so having sound really helps. Ah also I didn't make a real search coil for the prototype, just a 6m roll of hookup wire

    View Instructable »
  • rgco followed Survival, Science, Life Hacks, Robots and 5 others channel 9 months ago
  • rgco commented on rgco's instructable Simple Arduino metal detector9 months ago
    Simple Arduino metal detector

    Hi, it is attached at step 6

    View Instructable »
  • rgco's instructable Simple Arduino metal detector's weekly stats: 9 months ago
    • Simple Arduino metal detector
      2,812 views
      53 favorites
      5 comments
  • rgco commented on rgco's instructable Simple Arduino metal detector9 months ago
    Simple Arduino metal detector

    The range is similar to the radius of the coil, so 4.5cm for the 9cm diameter coil that I used. A larger coil would have a larger range, but be less sensitive to small objects, since what is measured is the relative change in inductance.The detector 'sees' through other objects: I got clear signals through a 3cm thick wooden table when placing a metal object on top and sweeping the detector from below.Note that a nail won't give a strong signal since it's cross-section area is small

    View Instructable »
  • rgco commented on rgco's instructable Multichannel Arduino oscilloscope9 months ago
    Multichannel Arduino oscilloscope

    Ah I recall the timer pins differ between the 328 and the 2560:http://playground.arduino.cc/Main/TimerPWMCheatshe... says that on the 2560 timer1 outputs on pin 12 and 11 instead of the 9 and 10 on the 328. The Rx Tx lights on the Arduino are useful for debugging too: both should be blinking intermittently: the Arduino only returns a 1500-byte trace after receiving a 30-byte command. So it seems it is receiving commands but not sending back the trace, no idea how that can be...

    View Instructable »
  • rgco commented on rgco's instructable Multichannel Arduino oscilloscope9 months ago
    Multichannel Arduino oscilloscope

    That looks interesting, thanks for the tip! 1Ms/s would be a major improvement. Googling around it seems that the DIY DSO138 oscilloscope is in fact based on the STM32F103C8T6. OK I ordered a cheap development board. It will take two months to arrive. It seems programming it is less trivial than with the Arduino though. Do I need additional hardware to program it? Do you have any experience yourself with this chip/board and have a suggestion for what's needed to program it?

    The Arduino sketch is full of direct read/writes to registers (most are needed for speed), it's not expected to work on any other chip than the ATMEGA328. That said, from a quick look at the 2560 data sheet I don't see immediate incompatibilities. What happens exactly, it doesn't compile, doesn't run, gives garbage, gives a flat line? ( I don't have a MEGA2560 so can't try it out...)

    View Instructable »
  • rgco's instructable Multichannel Arduino oscilloscope's weekly stats: 9 months ago
    • Multichannel Arduino oscilloscope
      1,080 views
      38 favorites
      7 comments
  • rgco commented on rgco's instructable Simple Arduino metal detector9 months ago
    Simple Arduino metal detector

    I checked for Italy. You must immediately stop and report if it's archeological or hazardous. If it has value you have to bring it to the police, but if it's not claimed after a year it's yours. Seemed surprisingly reasonable to me...

    View Instructable »
  • rgco entered Simple Arduino Metal Detector in the Sensors Contest 2017 contest 9 months ago
  • rgco commented on rgco's instructable Multichannel Arduino oscilloscope9 months ago
    Multichannel Arduino oscilloscope

    Glad it works! Did you get a specific error with the Arduino IDE? I now added the version numbers of Arduino and Processing that I used (1.6.12 and 3.3 respectively)

    View Instructable »
  • rgco commented on rgco's instructable Multichannel Arduino oscilloscope9 months ago
    Multichannel Arduino oscilloscope

    Good luck and let me know if you run into trouble or have suggestions for improvements!The precision is actually better than many commercial oscilloscopes: the Arduino has an 10-bit ADC while most commercial ones have only 8.In addition, it has 6 channels, while you'll typically find 2 or 4 on regular oscilloscopes. The pulse generator is also much more flexible, a regular oscilloscope typically only has a 1kHz calibration signal with 50% duty cycle, here you can select between 500kHz and 2Hz with a wide range of duty cycles.The main limitation is the sampling rate: 77ks/s means being limited to signals of 20kHz or less. There are USB scopes for about 50 euros that have 48Ms/s. Other limitations are the few options for the vertical scale and single-ended input.But if you have an Arduino...

    see more »

    Good luck and let me know if you run into trouble or have suggestions for improvements!The precision is actually better than many commercial oscilloscopes: the Arduino has an 10-bit ADC while most commercial ones have only 8.In addition, it has 6 channels, while you'll typically find 2 or 4 on regular oscilloscopes. The pulse generator is also much more flexible, a regular oscilloscope typically only has a 1kHz calibration signal with 50% duty cycle, here you can select between 500kHz and 2Hz with a wide range of duty cycles.The main limitation is the sampling rate: 77ks/s means being limited to signals of 20kHz or less. There are USB scopes for about 50 euros that have 48Ms/s. Other limitations are the few options for the vertical scale and single-ended input.But if you have an Arduino (UNO, or Nano, original or clone) already, it comes for free, should be easy to set up, and can be a great tool for many situations.

    View Instructable »
  • rgco's instructable PIR cabinet light's weekly stats: 10 months ago
    • PIR cabinet light
      180 views
      15 favorites
      0 comments
  • rgco followed Electronics, Cars, Reuse, Arduino and 1 other channel 1 year ago