cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Visitor
Visitor
483 Views
Registered: ‎11-25-2020

Voltage problem for Basys3

Jump to solution

Hi everyone,

I have been working on implementing a range sensor using HC-SR04 and display the distance in 7 segment on Basys3. The problem is, although code seems to work fine with testbenches, when I run the bitstream to Basys3, I get only the top of the 4 anodes lighted up. The problem is that I didn't assigned any output to the 4th anode, I only assigned 3 of them in both constraints and the whole VHDL code. HC-SR04 datasheet states that it works with 5 V and as far as I know Basys3's VCC gives only 3.3V. Can it be the reason for it not working and responding like that?

Thanks

Emir

0 Kudos
Reply
1 Solution

Accepted Solutions
Visitor
Visitor
284 Views
Registered: ‎11-25-2020

I have solved the problem. Voltage was an issue, although not the only one. The reason for Basys3 acting strangely with 3 defined anode outputs and giving 4 of them, was because of the default clock in Basys3. It seems like it has a 100MHz clock and I wrote my according to a 50 MHz clock without knowing it has 100. Then it all worked out fine and for the voltage part, yes it is not working with 3.3 V from Basys3, I connected an external power source of 5V to the sensor and made the proper connections and it worked out fine after that. 

View solution in original post

0 Kudos
Reply
6 Replies
Advisor
Advisor
451 Views
Registered: ‎04-26-2015

As I said in the previous thread - yes, running a 5V sensor at 3.3V won't work well. So you definitely need to fix that, preferably before wasting time looking at everything else. Garbage in = garbage out, and I expect that you're getting garbage in from the sensor at the moment.

 

With the LEDs - most of these boards have the LEDs inverted (ie set the pin high to turn off the LED, pull it low to turn on the LED). You should check that.

Visitor
Visitor
443 Views
Registered: ‎11-25-2020

Yes I have checked the code for anodes for 7 segments, they seem fine. I don't have a level shifter for the voltage conversion right now, can I do it with transistors, resistors on a breadboard maybe? Thanks for the reply.

0 Kudos
Reply
Advisor
Advisor
394 Views
Registered: ‎04-26-2015

You'll need a 5V supply for the SR04 since the Arty doesn't provide one. It'll probably work with 3.3V signal inputs, and the signal outputs can be reduced to 3.3V with a simple resistor voltage divider.

 

You say you've checked the code for the anodes of the 7 segment displays and it seems fine - but it's clearly not fine because it's not working...

0 Kudos
Reply
Visitor
Visitor
346 Views
Registered: ‎11-25-2020

The problem is I have also tried some pre-written bitstreams on github similar to my project which were using Basys3 and HC-SR04. When I run the program to my Basys they didn't work properly too. That's why I am a bit confused about the voltage issue. That seemed the main problem for that reason.

0 Kudos
Reply
310 Views
Registered: ‎01-22-2015

@Emir_Aker 

Documentation that I could find for the HC-SR04 is not very clear on the IO standard used - but it appears to be the old 5V-TTL.

If the Artix-7 on the Basys3 is using LVCMOS33 IO, then from the Artix-7 datasheet and from page 4 of <this> document we find that LVCMOS33 is roughly compatible with 5V-TTL.  

So, it appears that the HC-SR04 may work properly if connected directly to the Basys3.  However, before making this connection, you should make lab measurements to verify that the HC-SR04 IO is compatible with LVCMOS33.

Cheers,
Mark

0 Kudos
Reply
Visitor
Visitor
285 Views
Registered: ‎11-25-2020

I have solved the problem. Voltage was an issue, although not the only one. The reason for Basys3 acting strangely with 3 defined anode outputs and giving 4 of them, was because of the default clock in Basys3. It seems like it has a 100MHz clock and I wrote my according to a 50 MHz clock without knowing it has 100. Then it all worked out fine and for the voltage part, yes it is not working with 3.3 V from Basys3, I connected an external power source of 5V to the sensor and made the proper connections and it worked out fine after that. 

View solution in original post

0 Kudos
Reply