Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Datalogger that can read PWM input and store in microSD card

Status
Not open for further replies.

IvanTan

New Member
Hi there! I am looking for a datalogging device that is small (Arduino Uno/ Nano size), automotive grade, and can store PWM input into a microSD card.

I am trying to read and store PWM data from a fuel level sensor.

Does anyone have any ideas? Any help would be greatly appreciated!
 
Any of the ESP8266 or ESP32 boards, plus a micro-sd card board - you may well be able to source one of them with an SD card already on board.

Or a nano and micro-sd card, but the ESP's are a lot more powerful, particularly the ESP32.

Done a bit of searching, here's an ESP32 with an SD socket on board.


There's also a VERY tiny Arduino based serial logger, which you could reprogram to do what you want, but there's no easy access to the programming pins.
 
Hi Nigel,

Thank you so much for the rapid reply!

The ESP32 looks really promising. Not only can I use it to read and store PWM, I could also potentially access it over wifi to pull the data :)

Was having trouble looking for a suitable device and this would make things a lot easier!

Yours faithfully,
Ivan Tan
 
Hi Nigel,

Thank you so much for the rapid reply!

The ESP32 looks really promising. Not only can I use it to read and store PWM, I could also potentially access it over wifi to pull the data :)

Was having trouble looking for a suitable device and this would make things a lot easier!

Yours faithfully,
Ivan Tan

Even easier would be a raspberry pi zero W. WiFi and full Linux computer for $10 to $15 each (depending on vendor). Or a full raspberry pi for $35 - connect hdmi monitor, keyboard, mouse and SD (or USB drive). All kinds of fun options. The best option depends on your current level of experience in whatever you've been doing to this point. All raspberry Pis also have plenty of external pins and excellent timing options for counting cpu cycles (or microseconds) for measuring your PWM time measurements.
 
Wow a raspberry pi zero w could work too! I'll have to compare this against project requirements to assess if we can use it.

Thank you for the suggestion!
 
Thanks for the recommendation! That could work, but I feel that a microcontroller that can actually process the data may be a better solution. I'll be sticking with the ESP32 WROOM
 
Hi there! I am looking for a datalogging device that is small (Arduino Uno/ Nano size), automotive grade, and can store PWM input into a microSD card.

I am trying to read and store PWM data from a fuel level sensor.

Does anyone have any ideas? Any help would be greatly appreciated!

You have already been given some good ideas. There is a very wide range of controllers that you can use and putting together a nice little logger is not all that difficult. [shameless plug] A few days ago, I wrote up a little data logger using a MKR WiFi 1010 / NANO 33 IOT and a SensorTag https://create.arduino.cc/projecthub/DrGee/yadl-yet-another-data-logger-5ab66f It was actually a re-do from one I built more than two years ago using a now defunct controller.

I think that once you get the details of what you want to record and how often and what precision of time stamping you need and so on and so forth, you can decide which controllers might be particularly advantageous.

Good luck with it keep us posted.
 
Hi guys, thank you for all your help thus far!

I tried to use an ESP32 dev kit with the 5v fuel level sensor and fried the board :(

I realised that I had damaged the board by feeding the 5v PWM output from the sensor to one of the GPIO DAC pins on the board (GPIO pin 26) , which is not 5v tolerant.

I am now looking at the following options. These are arranged in order of preference:

1) Find a microcontroller/ system-on-chip with 5v tolerant GPIO pins and with built in wifi

2) Find a microcontroller/ system-on-chip with 5v tolerant GPIO pins and with a wifi shield

3) Continue to use the ESP32 but use a level shifter/ resistor to bring the 5v PWM output from the sensor to 3.3v (which the ESP32 can tolerate). Least preferred amongst all the options as the level shifter/ resistor introduces additional complexity.

I would like to keep entire setup small and compact (around the size of the ESP32 dev kit would be nice!) and of automotive grade (can tolerate temperatures from -40 to +85 deg C).

Does anyone have recommendations as to what I could use?

I have done some searching myself but have not managed to find 5v tolerant boards with wifi capability. The particle photon is 5v tolerant and has built in wifi but I don't like that its IDE is web-based.

All suggestions will be greatly appreciated!
 
Can you turn on a pullup and use a reverse biased diode so the pwm signal can only pull the esp pin low?

Mike.
 
3) Continue to use the ESP32 but use a level shifter/ resistor to bring the 5v PWM output from the sensor to 3.3v (which the ESP32 can tolerate). Least preferred amongst all the options as the level shifter/ resistor introduces additional complexity.

It's hardly as if two resistors is complicated? - or just one resistor if the inputs have protection diodes (as PIC inputs do).
 
Hi guys, thank you for your help so far!

I've spent some time searching and have managed to find one 5v tolerant board with wifi so far: the Espruino https://www.espruino.com/WiFi.

However, our team feels that it its too expensive and may not be easy to programme, since it runs Java.

In light of there being few options for 5v boards with wifi to choose from, my team has decided to go with the ESP32 DevkitC + level shifter route instead.

We've decided on the logic level converter (LLC) from Sparkfun (https://www.sparkfun.com/products/12009?_ga=2.29430071.9452288.1578581922-580743905.1571318123).

After reading the hookup guide, here is how I would like to connect the LLC to the sensor and ESP32 DevkitC:

3v3 pin of ESP32 DevkitC --> LV on LLC
GND of ESP32 DevkitC --> GND on LLC
DAC on ESP32 DevkitC --> LV1 on LLC

5v from battery pack (also connected in parallel to 5v sensor)--> HV on LLC
GND of of battery pack (also connected in parallel to 5v sensor) -->GND on LLC
PWM output of 5v sensor --> HV1 on LLC

I've also attached a rough circuit diagram for your reference.

May I check with you guys if the circuit will work? Instead of using a 6v battery pack and 5v voltage regulator, we may also use a 5v power bank attached to the ESP32 DevkitC via Microusb.

Thank you!

Mike I'm not sure how to use a pullup + reverse diode and but will research and may use it as a last resort.
 

Attachments

  • Prototype_rig.jpg
    Prototype_rig.jpg
    132.5 KB · Views: 177
@Mike I'm not sure how to use a pullup + reverse diode and but will research and may use it as a last resort.
The idea is simple, ESP pin has internal pullup turned on, a diode connects ESP pin to external source with diode to ESP. The diode can only conduct to pull the pin low. When the external voltage is higher then the ESP pin just sees it's own 3.3V pullup. However, this only saves 1 component over a simple resistive divider.
Mike.
 
Thank you for the explanation, Mike :) Our team would like to explore using the LLC first. We'll look into the internal pullup + reverse diode as an alternative if the LLC concept doesn't work, or is as not as reliable as we'd like.
 
Why not try the cheapest simplest route first? All you need is one 1N4148. Or two resistors.
Least preferred amongst all the options as the level shifter/ resistor introduces additional complexity.
From this, I assumed that "additional complexity" (LLC) was to be avoided.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top