Testing of Clone PI AVR metal detector

Some years ago a have started building Clone PI AVR. Made a PCB, soldered all the components and … and never found time to finish it until today. Well I haven’t finished it yet but at lest gave it a first test run. For the screen and buttons i have re-purposed some front panel of some old router. Now i see that i will have to put it in to another box for better mounting on the metal detector itself but this time it was good enough for test run. For Atmega programming I used Mini Pro TL866 programmer I have bought while ago – works like a charm. You can see some photos and video on work in progress.

20170216_160601
Programming Atmega8

20170217_000157.jpg

 

 

Circuit of Clopne PI AVR:

CPI_AVR_SCH.gif

CPI_AVR_VOLTS.gif

HEX file for burning Atmega 8 and PCB Sprint layout.

Atmega8 fuses
Atmega8 fuses
Flashed Atmega8
Flashed Atmega8

Eachine H8 Mini silent mod

I was annoyed with Eachines H8 Mine constant beeping in headless mode so decided to make it silent once and for all. This mod is easy – just open the transmitter, remove beeper by desoldering it and solder similar LED instead of it ( check the polarity – positive is marked on the PCB  ). Then drill a hole of LED diameter in front side of controller case and it is done.

Eachine H8 Mini - beeper removed and led soldered instead of it
Eachine H8 Mini – beeper removed and led soldered instead of it
Eachine H8 Mini controller reassembled. You can see old beeper that was removed and new led in its new hole.
Eachine H8 Mini controller reassembled. You can see old beeper that was removed and new led in its new hole.

 

Reading DHT22 and Light sensor data using NodeMCU dev board

Experimented with reading DHT22 amd Light sensor modules using NodeMCU ESP12E development board. Main problem I had that timer did not work on old firmware, had to update it ( read previous post ). Other that that all went fine and could read data.
One strange thing is that I am getting temperature a little bit higher than actual. Not sure why is that, maybe because board is powered by 3.3v and not 5v. Will have to find out that later.

Code:

if not tmr.alarm(0, 5000, tmr.ALARM_AUTO , function() 

print("Starting to read data:")

light = adc.read(0) or ""
print("Light:"..light)

pin = 4
status, temp, humi, temp_dec, humi_dec = dht.readxx(pin)

if status == dht.OK then

-- Float firmware using this example
print("DHT Temperature:"..temp..";".."Humidity:"..humi)

elseif status == dht.ERROR_CHECKSUM then
print( "DHT Checksum error." )
elseif status == dht.ERROR_TIMEOUT then
print( "DHT timed out." )
end

end) then print("whoopsie") end


tmr.alarm not working on ESP12E 0.9.5 firmware

Tested that this sample was not working on dev board:


if not tmr.alarm(0, 5000, tmr.ALARM_SINGLE, function() print("hey there") end) then print("whoopsie") end

Checked firmware version (connected to ESPlorer and pressed reset):
ESP12E default NodeMCU 0.9.5 build 20150318  powered by Lua 5.1.4

Decided to update firmware. Found here that only 9.6 is available precompiled, later ones have to be costum built. Downloaded 9.6 files and uploaded them using ESP8266Flasher.exe

Checked firmware version then:
NodeMCU 0.9.6 build 20150704  powered by Lua 5.1.4

And tested this code sample:

if not tmr.alarm(0, 5000, tmr.ALARM_SINGLE, function() print("hey there") end) then print("whoopsie") end

It worked.

How to use Arduino IDE to program NodeMCU

1. Install the Arduino IDE from download section of arduino.cc website 
2. Run Arduino IDE’s arduino.exe
3. Arduino IDE >> File >> Preferences (Shourtcut is CTRL + COMMA)>> Settings tab >> on Additional Board Manager URL side type this >> and click ok.

This json object will bring necessary drivers for NodeMCU from the website esp8266.com to our Arduino IDE.
4. Arduino IDE >> Tools >> Board >> Boards Manager… >> Type = Contributed >> click on install (Or, search ESP8266 from the search bar)
5. Arduino IDE >> Tools >> Board >> NodeMCU 1.0 (ESP-12E MODULE)