Feather M4 and 16x2 lcd screen & LSM9DS0

Hey guys.
I have a problem im hoping is easy rectified.
So i have an adafruit m4 Feather and a 9-DOF Accel/Mag/Gyro+Temp Breakout Board - LSM9DS0 sensor hooked together via SCL and SDA.
basically it says a word via a speaker based on whichever sensor goes off.
What i want to do is add a standard 16x2 lcd screen to this so when the word is picked, it shows up on the screen.
Can anyone tell me where i would hook in the terminals for the screen and also provide the code to show thew word the feather says, and also where would i add the code into the current project.
I have added a pic of the current hookup, i just need to know where the screen ties in and what code is needed.
Thanks so much for any help on this guys, i been trying to google and came up with no help whatsoever.

Roy

card_preview_fritzing_bb.png

card_preview_fritzing_bb.png

1 Like

Hello
in the world wide web are a lot of tutorials "how to connect a 16*2 LCD" are avaiable.
best regards
Paul

Hey Paul,
Yeah, there's a few but I found nothing that works on the m4 feather..most require pin 7, there is no pin7 on a m4, and that's what's throwing me.
Any ideas?

royincanada:
Hey Paul,
Yeah, there's a few but I found nothing that works on the m4 feather..most require pin 7, there is no pin7 on a m4, and that's what's throwing me.
Any ideas?

Hello
Yes, connect an I²C interface to your LCD screen.

Hey Paul, thanks for the reply.
I googled it and there seems to be a few.
Do you know of a specific one that will work with a standard white on blue 16x2 screen and a feather m4?

Hello
you can run each LCD screen supporting an I²C interface as long as you µC supports the I²C interface specification, too.

Hey Paul.
So I looked into one, can't use it, as much as it simplifies the pin layout because it uses the two pins top right of board which are currently used by the sensor
What about code?
How simple/difficult is that to display the word chosen by the sensor?

royincanada:
Hey Paul,
Yeah, there's a few but I found nothing that works on the m4 feather..most require pin 7, there is no pin7 on a m4, and that's what's throwing me.
Any ideas?

I am curious as I have never used a Feather M4 board myself, but may I ask why that is an issue?
Couldn't another available digital pin be used in its place?

As long as you connect the LCD to available digital pins, you can define which digital pins the LCD is connected to in the code, right?

The I2C bus (sda/scl pins) can be shared between many devices, assuming each device has a unique I2C address.
So you could use the lcd1602 display and the sensor simultaneously. But check that there is a corresponding library for the feather m4.
The Feather M4 is a 3.3volt device so you must get a 3.3volt version of the screen. The I2C backpack part for the screen accepts both voltages.

Oh, did not know they could be multi wired.
As for the voltage, they are both coming from a separate 5v power source, so screen can be 5, and the inputs on the feather take it to 3.3.
I'm just trying to establish if there is..
A- a defined set of pins to run the screen, cause in an uno pin 7 is used, feather has no pin 7
B- what the code would be to get the screen to print the same word as picked by the code from the sensor and run through the speaker.

Any ideas?

You have to be careful about mixing voltages. You should use a level shifter if , for example, you connect the l2C bus of a device powered at 5 volts to a mcu with 3.3 volt pins.

What library are you using which generates these voice prompts, the text of which is to appear on the screen?

Hey.
First, the feater can power the itc, one input on the feather is 5v and it powers it down itself, so all connections are 3.3 from the feather.
Second, really really glad you asked about the code..I just tried uploading it to the feather and in the code are libraries it cannot find.
English.h
Tts.h
Sound.h

I cannot find these online, nor do they appear in the adafruit libraries or arduino.

Any ideas where I can source these?

So update!.

I found a library file that has all the .h files I needed, now I don't know if it's actually working, there's no lights on the sensor and the small light on the left of the USB port on the feather flashes.

Is there a very very basic command I can upload to the feather to see if everything is actually working? Even just get it to say hi or something?
Any ideas?

Well, you have I2C devices connected so, as a start, load an I2C scanner sketch and see if it finds them.

https://playground.arduino.cc/Main/I2cScanner/

Thank you so so so much, this will indeed let me know.

Hopefully it finds the sensor, will report back!

Thanks again.

Hi royincanada,

In your Fritzing diagram, I noticed that the loudspeaker is connected directly to the Feather M4's DAC output. This might damage the analog output, since the microcontroller's output unable to provide the necessary current. The DAC output should first be connected to an audio amplifier breakout board. I also use a 0 to 3.3V, rail-to-rail op-amp (such as the MCP6002) in a voltage-follower configuration, to buffer and protect the SAMD51's DAC output. The op-amp's output driving the audio amplifier's positive input A+, with A- tied to ground.

I currently have my Feather M4 connected to a small 3W loudspeaker, through a MCP6002 voltage follower op-amp and the Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302: Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302 : ID 2130 : $3.95 : Adafruit Industries, Unique & fun DIY electronics and kits.

Martin thank you so so much, I had no idea! For 4 bucks you’ve saved my feathery ass, thank you! Will check sensors, then wait till I get the amp before fully testing.
Thank you guys, you all rock!