Using Arduino sensors with an STM32Does my open source project need be Arduino based to be successful?Bit bang ATmega328 with Arduino bootloader using AVRDUDEAdvantages of 32-bit 48-96 Mhz microprocessors (such as in Arduino Due)Selecting an Arduino for automotive DashboardHow to connect RFduino to internet?A good MCU which supports Arduino library but is not as expensiveHow do MCUs and RAM wire up for programmatic access?Measure current of multiple loads with one sensor?Microcontrollers and SensorsSTM32F103C8T6 dev board with C and debugging
Why does this if-statement combining assignment and an equality check return true?
Lady G's amazing mazings
What Armor Optimization applies to a Mithral full plate?
Defining the standard model of PA so that a space alien could understand
How can I tell if I'm being too picky as a referee?
Public transport tickets in UK for two weeks
How to cut a climbing rope?
Is it rude to call a professor by their last name with no prefix in a non-academic setting?
Efficient Algorithm for the boundary of a set of tiles
On San Andreas Speedruns, why do players blow up the Picador in the mission Ryder?
Is my plasma cannon concept viable?
Open office space - complaints for noise - how to respond
Of strange atmospheres - the survivable but unbreathable
Need to read my home electrical meter
What does kpsewhich stand for?
Time complexity of an algorithm: Is it important to state the base of the logarithm?
Can I tell a prospective employee that everyone in the team is leaving?
Where's this lookout in Nova Scotia?
Best material to absorb as much light as possible
Sorting by product ID
128-bit unsigned integer
What are we celebrating on Lag B'Omer?
How to zoom and pan very quick in Illustrator?
Find the three digit Prime number P from the given unusual relationships
Using Arduino sensors with an STM32
Does my open source project need be Arduino based to be successful?Bit bang ATmega328 with Arduino bootloader using AVRDUDEAdvantages of 32-bit 48-96 Mhz microprocessors (such as in Arduino Due)Selecting an Arduino for automotive DashboardHow to connect RFduino to internet?A good MCU which supports Arduino library but is not as expensiveHow do MCUs and RAM wire up for programmatic access?Measure current of multiple loads with one sensor?Microcontrollers and SensorsSTM32F103C8T6 dev board with C and debugging
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I want to start an electronic project, and found that an ARM based MCU, like STM32F103C, fits my needs more than AVR like Arduino Uno (mostly because of CPU and RAM.)
I was wondering if I can use any Arduino sensor with my STM32 board?
Looking a list of the sensors related to STM32, they seem much more expensive.
arduino microcontroller sensor
New contributor
Creator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I want to start an electronic project, and found that an ARM based MCU, like STM32F103C, fits my needs more than AVR like Arduino Uno (mostly because of CPU and RAM.)
I was wondering if I can use any Arduino sensor with my STM32 board?
Looking a list of the sensors related to STM32, they seem much more expensive.
arduino microcontroller sensor
New contributor
Creator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I want to start an electronic project, and found that an ARM based MCU, like STM32F103C, fits my needs more than AVR like Arduino Uno (mostly because of CPU and RAM.)
I was wondering if I can use any Arduino sensor with my STM32 board?
Looking a list of the sensors related to STM32, they seem much more expensive.
arduino microcontroller sensor
New contributor
Creator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I want to start an electronic project, and found that an ARM based MCU, like STM32F103C, fits my needs more than AVR like Arduino Uno (mostly because of CPU and RAM.)
I was wondering if I can use any Arduino sensor with my STM32 board?
Looking a list of the sensors related to STM32, they seem much more expensive.
arduino microcontroller sensor
arduino microcontroller sensor
New contributor
Creator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Creator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 4 hours ago
JRE
25.5k64585
25.5k64585
New contributor
Creator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 8 hours ago
CreatorCreator
162
162
New contributor
Creator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Creator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
Yes, of course you can use those sensors. The sensors are not Arduino exclusive, just look up the datasheets to the parts and you should have no problem using them.
To make it easier, you can get an STM32 Nucleo board, which has the same header pin configuration as an Arduino for quick and easy prototyping.
$endgroup$
$begingroup$
Thanx for quick answer. I had in mind STM32F103C8T6 blue pill, because of low pricing and some protoboard for prototyping, but I got your point. So, bottom line is that sensors in the list I mentioned, matches smt32 gpio and can use all of them with stm32?
$endgroup$
– Creator
8 hours ago
$begingroup$
Yes, it'll be fine. As long as you pay attention to where your leads are going. If doing I2C, hook up SDA and SCL on your sensor board to SDA and SCL on your STM32 board. The sensors will work on any microcontroller, the only reason those are sold as 'Arduino sensors' is because they will have a library in the Arduino IDE. This means ready made example code, but it isn't that difficult to translate most of it over to STM32
$endgroup$
– MCG
8 hours ago
1
$begingroup$
Upvoted your answer too, and thanks for your comment, I will add it.
$endgroup$
– Michel Keijzers
8 hours ago
1
$begingroup$
@MichelKeijzers no problem! It made sense to add it to your answer rather than mine!
$endgroup$
– MCG
7 hours ago
add a comment |
$begingroup$
As MCG already mentions, you can use in principle any sensor that also can be used by Arduino. The main issue is if you want to use libraries. For the Arduino, there are for almost any sensor a library available, for the STM32 this is much less the case. Writing a library can take quite some time (depending on the complexity of the sensor communication).
The Nucleo board can help if the sensor is placed on a board that can be pushed on top of an Arduino; otherwise you need to use separate wires anyway.
Another way that could be worthwhile checking, is STM32Arduino, which is a project to make some STM32's compatible with Arduino, and can be programmed like an Arduino, but not all libraries are compatible.
See also MCG's comment below and check the following helpful starting point for STM32Duino: getting-started-with-stm32-development-board-stm32f103c8.
In most cases, Arduino is the most easiest solution, mostly because of the existence of a large library support, however, the Arduino also has some big advantages: very less SRAM, mostly bigger in size than STM32 boards, no (easy) debugging, very less peripherals.
Another problem with Arduino libraries (and probably STM32 libraries too), is to check if multiple (different) libraries work together; you get into problems when e.g. they use both the same timer.
$endgroup$
1
$begingroup$
I was just about to edit my answer to mention the STM32/Arduino compatibility, but no need now you mention it here! In fact, there is a page on how to set up the exact same board OP is using to the Arduino IDE here:circuitdigest.com/microcontroller-projects/… which may be useful to add to your answer. +1 from me too for the mention of the Arduino compatibility!
$endgroup$
– MCG
8 hours ago
$begingroup$
Thanx, I have already checked links you sent me before. So basically, library repos is small when it comes to SMT32. What about some another MCU sensor libraries, is it better support for ESP32 or NodeMCU (I saw they are both programmable via Arduino IDE and C language)? Or in general, what would be your suggestions guys, in the case that I need ARM based platform (obviously because of performance), which is programmable via Arduino IDE in C/C++ and which support larger library set for sensors?
$endgroup$
– Creator
7 hours ago
$begingroup$
I added some more comments, you also could check Arduino Due, but also there not all Arduino libraries will work ... first make a list of possible models you can use (which meet your performance), than check on which of those platforms your needed libraries will work and make a decision based on those.
$endgroup$
– Michel Keijzers
4 hours ago
add a comment |
$begingroup$
May work for some, but definitely not for all.
Notice that the Arduino operates at 5V supply and I/O voltages, while the STM32 uses 3.3V!
While many of the STM32's I/O pins may be 5V-tolerant for input (see datasheet), they cannot output 5V signals which many Arduino-targeted sensor( board)s are built for.
So,
best case: The sensor is ok with 3.3V signals at its inputs and sends 5V signals to 5V-tolerant pins on the µC.
good case: The sensor does not work (as expected) because the 3.3V signals are too low, but neither end takes any damage.
bad case: The sensor sends a 5V output signal to a non-5V-tolerant µC (input) pin and damages the µC and possibly the sensor by excessive current.
Check and make sure that the sensor's inputs can operate with 3.3V signals, and that the µC's inputs can handle the (likely 5V) signals from the sensor.
$endgroup$
$begingroup$
It looks like voltage should not be a problem at MCU input side, but seems like you are most likely right regarding input voltage for sensors, since most of them operate at ~5V (or they are most reliable at that voltage)
$endgroup$
– Creator
7 hours ago
$begingroup$
cdn1.imggmi.com/uploads/2019/5/23/…
$endgroup$
– Creator
6 hours ago
$begingroup$
@Creator "It looks like voltage should not be a problem at MCU input side" - How do you get to that conclusion? Depending on the STM MCU some or most I/O pins are 5V-tolerant, but you have to make sure to connect 5V signals only to those pins, or use some sort of level shifter (e.g. a voltage divider). Otherwise, irreversible damage will occur.
$endgroup$
– JimmyB
5 hours ago
$begingroup$
@Creator Notice that we're talking about too low "high" signal levels from MCU to sensor (3.3V instead of 5V expected), but too high "high" signal levels from sensor to MCU (5V instead of maximum permissible 3.3V).
$endgroup$
– JimmyB
5 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "135"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Creator is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f439961%2fusing-arduino-sensors-with-an-stm32%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Yes, of course you can use those sensors. The sensors are not Arduino exclusive, just look up the datasheets to the parts and you should have no problem using them.
To make it easier, you can get an STM32 Nucleo board, which has the same header pin configuration as an Arduino for quick and easy prototyping.
$endgroup$
$begingroup$
Thanx for quick answer. I had in mind STM32F103C8T6 blue pill, because of low pricing and some protoboard for prototyping, but I got your point. So, bottom line is that sensors in the list I mentioned, matches smt32 gpio and can use all of them with stm32?
$endgroup$
– Creator
8 hours ago
$begingroup$
Yes, it'll be fine. As long as you pay attention to where your leads are going. If doing I2C, hook up SDA and SCL on your sensor board to SDA and SCL on your STM32 board. The sensors will work on any microcontroller, the only reason those are sold as 'Arduino sensors' is because they will have a library in the Arduino IDE. This means ready made example code, but it isn't that difficult to translate most of it over to STM32
$endgroup$
– MCG
8 hours ago
1
$begingroup$
Upvoted your answer too, and thanks for your comment, I will add it.
$endgroup$
– Michel Keijzers
8 hours ago
1
$begingroup$
@MichelKeijzers no problem! It made sense to add it to your answer rather than mine!
$endgroup$
– MCG
7 hours ago
add a comment |
$begingroup$
Yes, of course you can use those sensors. The sensors are not Arduino exclusive, just look up the datasheets to the parts and you should have no problem using them.
To make it easier, you can get an STM32 Nucleo board, which has the same header pin configuration as an Arduino for quick and easy prototyping.
$endgroup$
$begingroup$
Thanx for quick answer. I had in mind STM32F103C8T6 blue pill, because of low pricing and some protoboard for prototyping, but I got your point. So, bottom line is that sensors in the list I mentioned, matches smt32 gpio and can use all of them with stm32?
$endgroup$
– Creator
8 hours ago
$begingroup$
Yes, it'll be fine. As long as you pay attention to where your leads are going. If doing I2C, hook up SDA and SCL on your sensor board to SDA and SCL on your STM32 board. The sensors will work on any microcontroller, the only reason those are sold as 'Arduino sensors' is because they will have a library in the Arduino IDE. This means ready made example code, but it isn't that difficult to translate most of it over to STM32
$endgroup$
– MCG
8 hours ago
1
$begingroup$
Upvoted your answer too, and thanks for your comment, I will add it.
$endgroup$
– Michel Keijzers
8 hours ago
1
$begingroup$
@MichelKeijzers no problem! It made sense to add it to your answer rather than mine!
$endgroup$
– MCG
7 hours ago
add a comment |
$begingroup$
Yes, of course you can use those sensors. The sensors are not Arduino exclusive, just look up the datasheets to the parts and you should have no problem using them.
To make it easier, you can get an STM32 Nucleo board, which has the same header pin configuration as an Arduino for quick and easy prototyping.
$endgroup$
Yes, of course you can use those sensors. The sensors are not Arduino exclusive, just look up the datasheets to the parts and you should have no problem using them.
To make it easier, you can get an STM32 Nucleo board, which has the same header pin configuration as an Arduino for quick and easy prototyping.
answered 8 hours ago
MCGMCG
7,55932152
7,55932152
$begingroup$
Thanx for quick answer. I had in mind STM32F103C8T6 blue pill, because of low pricing and some protoboard for prototyping, but I got your point. So, bottom line is that sensors in the list I mentioned, matches smt32 gpio and can use all of them with stm32?
$endgroup$
– Creator
8 hours ago
$begingroup$
Yes, it'll be fine. As long as you pay attention to where your leads are going. If doing I2C, hook up SDA and SCL on your sensor board to SDA and SCL on your STM32 board. The sensors will work on any microcontroller, the only reason those are sold as 'Arduino sensors' is because they will have a library in the Arduino IDE. This means ready made example code, but it isn't that difficult to translate most of it over to STM32
$endgroup$
– MCG
8 hours ago
1
$begingroup$
Upvoted your answer too, and thanks for your comment, I will add it.
$endgroup$
– Michel Keijzers
8 hours ago
1
$begingroup$
@MichelKeijzers no problem! It made sense to add it to your answer rather than mine!
$endgroup$
– MCG
7 hours ago
add a comment |
$begingroup$
Thanx for quick answer. I had in mind STM32F103C8T6 blue pill, because of low pricing and some protoboard for prototyping, but I got your point. So, bottom line is that sensors in the list I mentioned, matches smt32 gpio and can use all of them with stm32?
$endgroup$
– Creator
8 hours ago
$begingroup$
Yes, it'll be fine. As long as you pay attention to where your leads are going. If doing I2C, hook up SDA and SCL on your sensor board to SDA and SCL on your STM32 board. The sensors will work on any microcontroller, the only reason those are sold as 'Arduino sensors' is because they will have a library in the Arduino IDE. This means ready made example code, but it isn't that difficult to translate most of it over to STM32
$endgroup$
– MCG
8 hours ago
1
$begingroup$
Upvoted your answer too, and thanks for your comment, I will add it.
$endgroup$
– Michel Keijzers
8 hours ago
1
$begingroup$
@MichelKeijzers no problem! It made sense to add it to your answer rather than mine!
$endgroup$
– MCG
7 hours ago
$begingroup$
Thanx for quick answer. I had in mind STM32F103C8T6 blue pill, because of low pricing and some protoboard for prototyping, but I got your point. So, bottom line is that sensors in the list I mentioned, matches smt32 gpio and can use all of them with stm32?
$endgroup$
– Creator
8 hours ago
$begingroup$
Thanx for quick answer. I had in mind STM32F103C8T6 blue pill, because of low pricing and some protoboard for prototyping, but I got your point. So, bottom line is that sensors in the list I mentioned, matches smt32 gpio and can use all of them with stm32?
$endgroup$
– Creator
8 hours ago
$begingroup$
Yes, it'll be fine. As long as you pay attention to where your leads are going. If doing I2C, hook up SDA and SCL on your sensor board to SDA and SCL on your STM32 board. The sensors will work on any microcontroller, the only reason those are sold as 'Arduino sensors' is because they will have a library in the Arduino IDE. This means ready made example code, but it isn't that difficult to translate most of it over to STM32
$endgroup$
– MCG
8 hours ago
$begingroup$
Yes, it'll be fine. As long as you pay attention to where your leads are going. If doing I2C, hook up SDA and SCL on your sensor board to SDA and SCL on your STM32 board. The sensors will work on any microcontroller, the only reason those are sold as 'Arduino sensors' is because they will have a library in the Arduino IDE. This means ready made example code, but it isn't that difficult to translate most of it over to STM32
$endgroup$
– MCG
8 hours ago
1
1
$begingroup$
Upvoted your answer too, and thanks for your comment, I will add it.
$endgroup$
– Michel Keijzers
8 hours ago
$begingroup$
Upvoted your answer too, and thanks for your comment, I will add it.
$endgroup$
– Michel Keijzers
8 hours ago
1
1
$begingroup$
@MichelKeijzers no problem! It made sense to add it to your answer rather than mine!
$endgroup$
– MCG
7 hours ago
$begingroup$
@MichelKeijzers no problem! It made sense to add it to your answer rather than mine!
$endgroup$
– MCG
7 hours ago
add a comment |
$begingroup$
As MCG already mentions, you can use in principle any sensor that also can be used by Arduino. The main issue is if you want to use libraries. For the Arduino, there are for almost any sensor a library available, for the STM32 this is much less the case. Writing a library can take quite some time (depending on the complexity of the sensor communication).
The Nucleo board can help if the sensor is placed on a board that can be pushed on top of an Arduino; otherwise you need to use separate wires anyway.
Another way that could be worthwhile checking, is STM32Arduino, which is a project to make some STM32's compatible with Arduino, and can be programmed like an Arduino, but not all libraries are compatible.
See also MCG's comment below and check the following helpful starting point for STM32Duino: getting-started-with-stm32-development-board-stm32f103c8.
In most cases, Arduino is the most easiest solution, mostly because of the existence of a large library support, however, the Arduino also has some big advantages: very less SRAM, mostly bigger in size than STM32 boards, no (easy) debugging, very less peripherals.
Another problem with Arduino libraries (and probably STM32 libraries too), is to check if multiple (different) libraries work together; you get into problems when e.g. they use both the same timer.
$endgroup$
1
$begingroup$
I was just about to edit my answer to mention the STM32/Arduino compatibility, but no need now you mention it here! In fact, there is a page on how to set up the exact same board OP is using to the Arduino IDE here:circuitdigest.com/microcontroller-projects/… which may be useful to add to your answer. +1 from me too for the mention of the Arduino compatibility!
$endgroup$
– MCG
8 hours ago
$begingroup$
Thanx, I have already checked links you sent me before. So basically, library repos is small when it comes to SMT32. What about some another MCU sensor libraries, is it better support for ESP32 or NodeMCU (I saw they are both programmable via Arduino IDE and C language)? Or in general, what would be your suggestions guys, in the case that I need ARM based platform (obviously because of performance), which is programmable via Arduino IDE in C/C++ and which support larger library set for sensors?
$endgroup$
– Creator
7 hours ago
$begingroup$
I added some more comments, you also could check Arduino Due, but also there not all Arduino libraries will work ... first make a list of possible models you can use (which meet your performance), than check on which of those platforms your needed libraries will work and make a decision based on those.
$endgroup$
– Michel Keijzers
4 hours ago
add a comment |
$begingroup$
As MCG already mentions, you can use in principle any sensor that also can be used by Arduino. The main issue is if you want to use libraries. For the Arduino, there are for almost any sensor a library available, for the STM32 this is much less the case. Writing a library can take quite some time (depending on the complexity of the sensor communication).
The Nucleo board can help if the sensor is placed on a board that can be pushed on top of an Arduino; otherwise you need to use separate wires anyway.
Another way that could be worthwhile checking, is STM32Arduino, which is a project to make some STM32's compatible with Arduino, and can be programmed like an Arduino, but not all libraries are compatible.
See also MCG's comment below and check the following helpful starting point for STM32Duino: getting-started-with-stm32-development-board-stm32f103c8.
In most cases, Arduino is the most easiest solution, mostly because of the existence of a large library support, however, the Arduino also has some big advantages: very less SRAM, mostly bigger in size than STM32 boards, no (easy) debugging, very less peripherals.
Another problem with Arduino libraries (and probably STM32 libraries too), is to check if multiple (different) libraries work together; you get into problems when e.g. they use both the same timer.
$endgroup$
1
$begingroup$
I was just about to edit my answer to mention the STM32/Arduino compatibility, but no need now you mention it here! In fact, there is a page on how to set up the exact same board OP is using to the Arduino IDE here:circuitdigest.com/microcontroller-projects/… which may be useful to add to your answer. +1 from me too for the mention of the Arduino compatibility!
$endgroup$
– MCG
8 hours ago
$begingroup$
Thanx, I have already checked links you sent me before. So basically, library repos is small when it comes to SMT32. What about some another MCU sensor libraries, is it better support for ESP32 or NodeMCU (I saw they are both programmable via Arduino IDE and C language)? Or in general, what would be your suggestions guys, in the case that I need ARM based platform (obviously because of performance), which is programmable via Arduino IDE in C/C++ and which support larger library set for sensors?
$endgroup$
– Creator
7 hours ago
$begingroup$
I added some more comments, you also could check Arduino Due, but also there not all Arduino libraries will work ... first make a list of possible models you can use (which meet your performance), than check on which of those platforms your needed libraries will work and make a decision based on those.
$endgroup$
– Michel Keijzers
4 hours ago
add a comment |
$begingroup$
As MCG already mentions, you can use in principle any sensor that also can be used by Arduino. The main issue is if you want to use libraries. For the Arduino, there are for almost any sensor a library available, for the STM32 this is much less the case. Writing a library can take quite some time (depending on the complexity of the sensor communication).
The Nucleo board can help if the sensor is placed on a board that can be pushed on top of an Arduino; otherwise you need to use separate wires anyway.
Another way that could be worthwhile checking, is STM32Arduino, which is a project to make some STM32's compatible with Arduino, and can be programmed like an Arduino, but not all libraries are compatible.
See also MCG's comment below and check the following helpful starting point for STM32Duino: getting-started-with-stm32-development-board-stm32f103c8.
In most cases, Arduino is the most easiest solution, mostly because of the existence of a large library support, however, the Arduino also has some big advantages: very less SRAM, mostly bigger in size than STM32 boards, no (easy) debugging, very less peripherals.
Another problem with Arduino libraries (and probably STM32 libraries too), is to check if multiple (different) libraries work together; you get into problems when e.g. they use both the same timer.
$endgroup$
As MCG already mentions, you can use in principle any sensor that also can be used by Arduino. The main issue is if you want to use libraries. For the Arduino, there are for almost any sensor a library available, for the STM32 this is much less the case. Writing a library can take quite some time (depending on the complexity of the sensor communication).
The Nucleo board can help if the sensor is placed on a board that can be pushed on top of an Arduino; otherwise you need to use separate wires anyway.
Another way that could be worthwhile checking, is STM32Arduino, which is a project to make some STM32's compatible with Arduino, and can be programmed like an Arduino, but not all libraries are compatible.
See also MCG's comment below and check the following helpful starting point for STM32Duino: getting-started-with-stm32-development-board-stm32f103c8.
In most cases, Arduino is the most easiest solution, mostly because of the existence of a large library support, however, the Arduino also has some big advantages: very less SRAM, mostly bigger in size than STM32 boards, no (easy) debugging, very less peripherals.
Another problem with Arduino libraries (and probably STM32 libraries too), is to check if multiple (different) libraries work together; you get into problems when e.g. they use both the same timer.
edited 5 hours ago
answered 8 hours ago
Michel KeijzersMichel Keijzers
7,43893473
7,43893473
1
$begingroup$
I was just about to edit my answer to mention the STM32/Arduino compatibility, but no need now you mention it here! In fact, there is a page on how to set up the exact same board OP is using to the Arduino IDE here:circuitdigest.com/microcontroller-projects/… which may be useful to add to your answer. +1 from me too for the mention of the Arduino compatibility!
$endgroup$
– MCG
8 hours ago
$begingroup$
Thanx, I have already checked links you sent me before. So basically, library repos is small when it comes to SMT32. What about some another MCU sensor libraries, is it better support for ESP32 or NodeMCU (I saw they are both programmable via Arduino IDE and C language)? Or in general, what would be your suggestions guys, in the case that I need ARM based platform (obviously because of performance), which is programmable via Arduino IDE in C/C++ and which support larger library set for sensors?
$endgroup$
– Creator
7 hours ago
$begingroup$
I added some more comments, you also could check Arduino Due, but also there not all Arduino libraries will work ... first make a list of possible models you can use (which meet your performance), than check on which of those platforms your needed libraries will work and make a decision based on those.
$endgroup$
– Michel Keijzers
4 hours ago
add a comment |
1
$begingroup$
I was just about to edit my answer to mention the STM32/Arduino compatibility, but no need now you mention it here! In fact, there is a page on how to set up the exact same board OP is using to the Arduino IDE here:circuitdigest.com/microcontroller-projects/… which may be useful to add to your answer. +1 from me too for the mention of the Arduino compatibility!
$endgroup$
– MCG
8 hours ago
$begingroup$
Thanx, I have already checked links you sent me before. So basically, library repos is small when it comes to SMT32. What about some another MCU sensor libraries, is it better support for ESP32 or NodeMCU (I saw they are both programmable via Arduino IDE and C language)? Or in general, what would be your suggestions guys, in the case that I need ARM based platform (obviously because of performance), which is programmable via Arduino IDE in C/C++ and which support larger library set for sensors?
$endgroup$
– Creator
7 hours ago
$begingroup$
I added some more comments, you also could check Arduino Due, but also there not all Arduino libraries will work ... first make a list of possible models you can use (which meet your performance), than check on which of those platforms your needed libraries will work and make a decision based on those.
$endgroup$
– Michel Keijzers
4 hours ago
1
1
$begingroup$
I was just about to edit my answer to mention the STM32/Arduino compatibility, but no need now you mention it here! In fact, there is a page on how to set up the exact same board OP is using to the Arduino IDE here:circuitdigest.com/microcontroller-projects/… which may be useful to add to your answer. +1 from me too for the mention of the Arduino compatibility!
$endgroup$
– MCG
8 hours ago
$begingroup$
I was just about to edit my answer to mention the STM32/Arduino compatibility, but no need now you mention it here! In fact, there is a page on how to set up the exact same board OP is using to the Arduino IDE here:circuitdigest.com/microcontroller-projects/… which may be useful to add to your answer. +1 from me too for the mention of the Arduino compatibility!
$endgroup$
– MCG
8 hours ago
$begingroup$
Thanx, I have already checked links you sent me before. So basically, library repos is small when it comes to SMT32. What about some another MCU sensor libraries, is it better support for ESP32 or NodeMCU (I saw they are both programmable via Arduino IDE and C language)? Or in general, what would be your suggestions guys, in the case that I need ARM based platform (obviously because of performance), which is programmable via Arduino IDE in C/C++ and which support larger library set for sensors?
$endgroup$
– Creator
7 hours ago
$begingroup$
Thanx, I have already checked links you sent me before. So basically, library repos is small when it comes to SMT32. What about some another MCU sensor libraries, is it better support for ESP32 or NodeMCU (I saw they are both programmable via Arduino IDE and C language)? Or in general, what would be your suggestions guys, in the case that I need ARM based platform (obviously because of performance), which is programmable via Arduino IDE in C/C++ and which support larger library set for sensors?
$endgroup$
– Creator
7 hours ago
$begingroup$
I added some more comments, you also could check Arduino Due, but also there not all Arduino libraries will work ... first make a list of possible models you can use (which meet your performance), than check on which of those platforms your needed libraries will work and make a decision based on those.
$endgroup$
– Michel Keijzers
4 hours ago
$begingroup$
I added some more comments, you also could check Arduino Due, but also there not all Arduino libraries will work ... first make a list of possible models you can use (which meet your performance), than check on which of those platforms your needed libraries will work and make a decision based on those.
$endgroup$
– Michel Keijzers
4 hours ago
add a comment |
$begingroup$
May work for some, but definitely not for all.
Notice that the Arduino operates at 5V supply and I/O voltages, while the STM32 uses 3.3V!
While many of the STM32's I/O pins may be 5V-tolerant for input (see datasheet), they cannot output 5V signals which many Arduino-targeted sensor( board)s are built for.
So,
best case: The sensor is ok with 3.3V signals at its inputs and sends 5V signals to 5V-tolerant pins on the µC.
good case: The sensor does not work (as expected) because the 3.3V signals are too low, but neither end takes any damage.
bad case: The sensor sends a 5V output signal to a non-5V-tolerant µC (input) pin and damages the µC and possibly the sensor by excessive current.
Check and make sure that the sensor's inputs can operate with 3.3V signals, and that the µC's inputs can handle the (likely 5V) signals from the sensor.
$endgroup$
$begingroup$
It looks like voltage should not be a problem at MCU input side, but seems like you are most likely right regarding input voltage for sensors, since most of them operate at ~5V (or they are most reliable at that voltage)
$endgroup$
– Creator
7 hours ago
$begingroup$
cdn1.imggmi.com/uploads/2019/5/23/…
$endgroup$
– Creator
6 hours ago
$begingroup$
@Creator "It looks like voltage should not be a problem at MCU input side" - How do you get to that conclusion? Depending on the STM MCU some or most I/O pins are 5V-tolerant, but you have to make sure to connect 5V signals only to those pins, or use some sort of level shifter (e.g. a voltage divider). Otherwise, irreversible damage will occur.
$endgroup$
– JimmyB
5 hours ago
$begingroup$
@Creator Notice that we're talking about too low "high" signal levels from MCU to sensor (3.3V instead of 5V expected), but too high "high" signal levels from sensor to MCU (5V instead of maximum permissible 3.3V).
$endgroup$
– JimmyB
5 hours ago
add a comment |
$begingroup$
May work for some, but definitely not for all.
Notice that the Arduino operates at 5V supply and I/O voltages, while the STM32 uses 3.3V!
While many of the STM32's I/O pins may be 5V-tolerant for input (see datasheet), they cannot output 5V signals which many Arduino-targeted sensor( board)s are built for.
So,
best case: The sensor is ok with 3.3V signals at its inputs and sends 5V signals to 5V-tolerant pins on the µC.
good case: The sensor does not work (as expected) because the 3.3V signals are too low, but neither end takes any damage.
bad case: The sensor sends a 5V output signal to a non-5V-tolerant µC (input) pin and damages the µC and possibly the sensor by excessive current.
Check and make sure that the sensor's inputs can operate with 3.3V signals, and that the µC's inputs can handle the (likely 5V) signals from the sensor.
$endgroup$
$begingroup$
It looks like voltage should not be a problem at MCU input side, but seems like you are most likely right regarding input voltage for sensors, since most of them operate at ~5V (or they are most reliable at that voltage)
$endgroup$
– Creator
7 hours ago
$begingroup$
cdn1.imggmi.com/uploads/2019/5/23/…
$endgroup$
– Creator
6 hours ago
$begingroup$
@Creator "It looks like voltage should not be a problem at MCU input side" - How do you get to that conclusion? Depending on the STM MCU some or most I/O pins are 5V-tolerant, but you have to make sure to connect 5V signals only to those pins, or use some sort of level shifter (e.g. a voltage divider). Otherwise, irreversible damage will occur.
$endgroup$
– JimmyB
5 hours ago
$begingroup$
@Creator Notice that we're talking about too low "high" signal levels from MCU to sensor (3.3V instead of 5V expected), but too high "high" signal levels from sensor to MCU (5V instead of maximum permissible 3.3V).
$endgroup$
– JimmyB
5 hours ago
add a comment |
$begingroup$
May work for some, but definitely not for all.
Notice that the Arduino operates at 5V supply and I/O voltages, while the STM32 uses 3.3V!
While many of the STM32's I/O pins may be 5V-tolerant for input (see datasheet), they cannot output 5V signals which many Arduino-targeted sensor( board)s are built for.
So,
best case: The sensor is ok with 3.3V signals at its inputs and sends 5V signals to 5V-tolerant pins on the µC.
good case: The sensor does not work (as expected) because the 3.3V signals are too low, but neither end takes any damage.
bad case: The sensor sends a 5V output signal to a non-5V-tolerant µC (input) pin and damages the µC and possibly the sensor by excessive current.
Check and make sure that the sensor's inputs can operate with 3.3V signals, and that the µC's inputs can handle the (likely 5V) signals from the sensor.
$endgroup$
May work for some, but definitely not for all.
Notice that the Arduino operates at 5V supply and I/O voltages, while the STM32 uses 3.3V!
While many of the STM32's I/O pins may be 5V-tolerant for input (see datasheet), they cannot output 5V signals which many Arduino-targeted sensor( board)s are built for.
So,
best case: The sensor is ok with 3.3V signals at its inputs and sends 5V signals to 5V-tolerant pins on the µC.
good case: The sensor does not work (as expected) because the 3.3V signals are too low, but neither end takes any damage.
bad case: The sensor sends a 5V output signal to a non-5V-tolerant µC (input) pin and damages the µC and possibly the sensor by excessive current.
Check and make sure that the sensor's inputs can operate with 3.3V signals, and that the µC's inputs can handle the (likely 5V) signals from the sensor.
edited 5 hours ago
answered 7 hours ago
JimmyBJimmyB
3,0881417
3,0881417
$begingroup$
It looks like voltage should not be a problem at MCU input side, but seems like you are most likely right regarding input voltage for sensors, since most of them operate at ~5V (or they are most reliable at that voltage)
$endgroup$
– Creator
7 hours ago
$begingroup$
cdn1.imggmi.com/uploads/2019/5/23/…
$endgroup$
– Creator
6 hours ago
$begingroup$
@Creator "It looks like voltage should not be a problem at MCU input side" - How do you get to that conclusion? Depending on the STM MCU some or most I/O pins are 5V-tolerant, but you have to make sure to connect 5V signals only to those pins, or use some sort of level shifter (e.g. a voltage divider). Otherwise, irreversible damage will occur.
$endgroup$
– JimmyB
5 hours ago
$begingroup$
@Creator Notice that we're talking about too low "high" signal levels from MCU to sensor (3.3V instead of 5V expected), but too high "high" signal levels from sensor to MCU (5V instead of maximum permissible 3.3V).
$endgroup$
– JimmyB
5 hours ago
add a comment |
$begingroup$
It looks like voltage should not be a problem at MCU input side, but seems like you are most likely right regarding input voltage for sensors, since most of them operate at ~5V (or they are most reliable at that voltage)
$endgroup$
– Creator
7 hours ago
$begingroup$
cdn1.imggmi.com/uploads/2019/5/23/…
$endgroup$
– Creator
6 hours ago
$begingroup$
@Creator "It looks like voltage should not be a problem at MCU input side" - How do you get to that conclusion? Depending on the STM MCU some or most I/O pins are 5V-tolerant, but you have to make sure to connect 5V signals only to those pins, or use some sort of level shifter (e.g. a voltage divider). Otherwise, irreversible damage will occur.
$endgroup$
– JimmyB
5 hours ago
$begingroup$
@Creator Notice that we're talking about too low "high" signal levels from MCU to sensor (3.3V instead of 5V expected), but too high "high" signal levels from sensor to MCU (5V instead of maximum permissible 3.3V).
$endgroup$
– JimmyB
5 hours ago
$begingroup$
It looks like voltage should not be a problem at MCU input side, but seems like you are most likely right regarding input voltage for sensors, since most of them operate at ~5V (or they are most reliable at that voltage)
$endgroup$
– Creator
7 hours ago
$begingroup$
It looks like voltage should not be a problem at MCU input side, but seems like you are most likely right regarding input voltage for sensors, since most of them operate at ~5V (or they are most reliable at that voltage)
$endgroup$
– Creator
7 hours ago
$begingroup$
cdn1.imggmi.com/uploads/2019/5/23/…
$endgroup$
– Creator
6 hours ago
$begingroup$
cdn1.imggmi.com/uploads/2019/5/23/…
$endgroup$
– Creator
6 hours ago
$begingroup$
@Creator "It looks like voltage should not be a problem at MCU input side" - How do you get to that conclusion? Depending on the STM MCU some or most I/O pins are 5V-tolerant, but you have to make sure to connect 5V signals only to those pins, or use some sort of level shifter (e.g. a voltage divider). Otherwise, irreversible damage will occur.
$endgroup$
– JimmyB
5 hours ago
$begingroup$
@Creator "It looks like voltage should not be a problem at MCU input side" - How do you get to that conclusion? Depending on the STM MCU some or most I/O pins are 5V-tolerant, but you have to make sure to connect 5V signals only to those pins, or use some sort of level shifter (e.g. a voltage divider). Otherwise, irreversible damage will occur.
$endgroup$
– JimmyB
5 hours ago
$begingroup$
@Creator Notice that we're talking about too low "high" signal levels from MCU to sensor (3.3V instead of 5V expected), but too high "high" signal levels from sensor to MCU (5V instead of maximum permissible 3.3V).
$endgroup$
– JimmyB
5 hours ago
$begingroup$
@Creator Notice that we're talking about too low "high" signal levels from MCU to sensor (3.3V instead of 5V expected), but too high "high" signal levels from sensor to MCU (5V instead of maximum permissible 3.3V).
$endgroup$
– JimmyB
5 hours ago
add a comment |
Creator is a new contributor. Be nice, and check out our Code of Conduct.
Creator is a new contributor. Be nice, and check out our Code of Conduct.
Creator is a new contributor. Be nice, and check out our Code of Conduct.
Creator is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Electrical Engineering Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f439961%2fusing-arduino-sensors-with-an-stm32%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown