Need advice: Metal detector with stm32f103

What are you developing?
asen0v
Posts: 31
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Post by asen0v » Sat Mar 18, 2017 10:05 pm

if you dig the coins in, will disturbed soil affect the test?
or do you stamp the soil back down ?
Yes,I stamp the soil. Anyway disturbed soil affects the test result, but this effect mostly occurs with VLF metal detectors, not with pulse induction.

asen0v
Posts: 31
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Post by asen0v » Fri Jul 21, 2017 5:52 pm

Hi guys.
After one month of using this machine underwater I decided to change the sound frequency, because I can hear better the lower frequencies when underwater. When I closed the box several months ago I put a waterproof connector connected to SWCLK, SWDIO, GND and VCC. It was meant to be used with ST link V2. Today I uploaded the modified code and the sound is now OK, but the LCD does not work anymore. It lights, but characters does not show. Just blank display. I use 16x2 lcd with LiquidCrystal library.
Now when I uploaded the new code with the ST Link I obviously got rid of the bootloader. Maybe this is the reason? Does the LiquidCrystal library needs the bootloader in order to work properly?
I really don't want to open the box because it is sealed with silicone.

User avatar
martinayotte
Posts: 1187
Joined: Mon Apr 27, 2015 1:45 pm

Re: Need advice: Metal detector with stm32f103

Post by martinayotte » Fri Jul 21, 2017 6:47 pm

LiquidCrystal doesn't need bootloader.
But maybe you changed the GPIO pinout by mistake ?
Of course, you can't use SWCLK/SWDIO as plain GPIOs...

asen0v
Posts: 31
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Post by asen0v » Fri Jul 21, 2017 7:17 pm

martinayotte, thanks for the answer. I use SWCLK/SWDIO only for programming and not as GPIOs.

The LCD is connected as folows:
RS - PC13
E - PC14
D4 - PB4
D5 - PB5
D6 - PB6
D7 - PB7
LED - PA10 (using PWM to adjust)
LED - GND
VO - GND

Looks like I will need to open the damn box :(

asen0v
Posts: 31
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Post by asen0v » Sat Jul 22, 2017 7:42 am

I opened the box and took the display out. It works with arduino nano.
I saw this thread http://www.stm32duino.com/viewtopic.php?t=1501. Obviously there is some problem with this library when used with ST-Link. In the same thread ahull suggests better not to use JXXX pins. I used PB4 and after reading the ahull's suggestions I changed it with PA11, but it still does not work.

User avatar
Pito
Posts: 1273
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Need advice: Metal detector with stm32f103

Post by Pito » Sat Jul 22, 2017 8:11 am

After one month of using this machine underwater
What is your experience with it after a month? What did you find?
Pukao Hats Cleaning Services Ltd.

zmemw16
Posts: 1265
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Need advice: Metal detector with stm32f103

Post by zmemw16 » Sat Jul 22, 2017 8:18 am

any signs of leakage?
battery flat ?
what doesn't work, the whole thing, the stm32 or the display(not clear if its that you tested with the nano) ?
does blink work ? maybe you left a blink the led function in the code ? ok you can't see it, but its only a few mA's.
to the tone generator for the next time round add a regular 'i'm still working beep pattern or a 'i've had no input for nn secs'' warning one.
have you test code for a nano with any of the hardware ?
can you still separate them to test ?

stephen

asen0v
Posts: 31
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Post by asen0v » Sat Jul 22, 2017 9:00 am

zmemw16 wrote:
Sat Jul 22, 2017 8:18 am
any signs of leakage?
battery flat ?
what doesn't work, the whole thing, the stm32 or the display(not clear if its that you tested with the nano) ?
does blink work ? maybe you left a blink the led function in the code ? ok you can't see it, but its only a few mA's.
to the tone generator for the next time round add a regular 'i'm still working beep pattern or a 'i've had no input for nn secs'' warning one.
have you test code for a nano with any of the hardware ?
can you still separate them to test ?

stephen
Hi Stephen,
The metal detector works except the display. It shows 16 square blocks on the first row for a second and then just a blank display. This is why I tested the LCD with arduino nano. It shows the "Hello word", so the LCD is working.
There was no signs of leakage in the box. The battery is fully charged. The hardware is OK. The problem occurred after updating the sketch with ST-Link V2.

What is your experience with it after a month? What did you find?
Hi Pito,
I found mostly junk and many coins. Also 4 silver rings and 1 gold earring. I don't expect to find something valuable, but I enjoy the time spend underwater.

zmemw16
Posts: 1265
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Need advice: Metal detector with stm32f103

Post by zmemw16 » Sat Jul 22, 2017 9:44 am

how did you program it originally ?
have you a link to it as a project ?

testing the display, literally just the lcd transplanted to a nano already wired for the display?

black blocks and blanks to me suggests the contrast control, did you use a pot ?

stephen

asen0v
Posts: 31
Joined: Wed Sep 21, 2016 4:51 pm
Location: Bulgaria

Re: Need advice: Metal detector with stm32f103

Post by asen0v » Sat Jul 22, 2017 10:09 am

zmemw16 wrote:
Sat Jul 22, 2017 9:44 am
how did you program it originally ?
have you a link to it as a project ?

testing the display, literally just the lcd transplanted to a nano already wired for the display?

black blocks and blanks to me suggests the contrast control, did you use a pot ?

stephen
1. Originally I programmed it from the mini USB port.
2. I have no link to the project, but I may upload it to my github in the future.
3. Tested the display connected to a nano and it works, so the problem is not in the display itself.
4. There are black blocks only on the first row.

I'm 100% sure the problem is not in the hardware. It is software problem.
Maybe without the bootloader there is no enough time for the LCD to initialize properly. I will try to flash the bootloader back.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest