The Vas
UNITED STATES OF AMERICA • + Follow
Edit Project
Description
ADC2PWM PCB
ADC2PWM
Usage example is replacing a flowmeter with a pressure sensor in a coffee maker.
Code
FW
C/C++
#include <Arduino.h>
#define PWM_PIN PB1
#define ADC_PIN 1 // PB2
void setup() {
// Set the PWM pin as output
DDRB |= _BV(PWM_PIN);
// Configure Timer/Counter0
TCCR0A = 0x00;
TCCR0A |= _BV(WGM00) | _BV(COM0A0)| _BV(COM0B1);
TCCR0B = 0x00;
TCCR0B |= _BV(CS02); // Set the PWM frequency to 122 Hz
TCNT0 = 0;
OCR0B = 0;
// ADC configuration
ADMUX = _BV(MUX0); // Select ADC input channel 1 (PB2)
ADCSRA = _BV(ADEN) | // Enable ADC
_BV(ADPS2) | // Set prescaler to 64 (125kHz with 8MHz clock)
_BV(ADPS1);
}
void loop() {
// Start ADC conversion
ADCSRA |= _BV(ADSC);
// Wait for conversion to complete
while (ADCSRA & _BV(ADSC));
// Read ADC value (10-bit value)
uint16_t adcValue = ADC;
// Scale ADC value to match OCR1A range (0 to OCR1C)
uint8_t pwmValue = adcValue >> 2;
OCR0B = pwmValue;
}
Nov 13,2024
459 views
ADC2PWM PCB
ADC2PWM
Usage example is replacing a flowmeter with a pressure sensor in a coffee maker.
459
0
0
Published: Nov 13,2024
Standard PCB
Download Gerber file 2
Purchase
Donation Received ($)
PCBWay Donate 10% cost To Author
Only PCB
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
Copy this HTML into your page to embed a link to order this shared project
Copy
Under the
Attribution-NonCommercial (CC BY-NC)
License.
Topic
- Comments(0)
- Likes(0)
Upload photo
You can only upload 5 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000
It looks like you have not written anything. Please add a comment and try again.
You can upload up to 5 images!
Image size should not exceed 2MB!
File format not supported!
View More
View More
VOTING
0 votes
- 0 USER VOTES
0.00
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Design
1/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Usability
2/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Creativity
3/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Content
4/4
More by The Vas
-
ToFnLED v1
ToF sensor and RGB LED controlled via I2C bus are placed on a small board for use in espresso coffee...
-
XJK1310-BT
Adding Bluetooth to XJK1310 scales.IMPORTANT: PCB thickness must be 1.0 mm.
-
CleverBoard
A specialized control board based on ESP32-C6.NOTE: The design isn't currently verified, no FW avail...
-
BT for CK2150
Add Bluetooth to CK2150 scales
-
Generic AC dimmer
Generic AC dimmer with zero-cross detector.LCSC BOM and Centroid are in Gerber ZIP
-
ADC2PWM PCB
ADC2PWMUsage example is replacing a flowmeter with a pressure sensor in a coffee maker.
-
FPC scales cable adapter
5 pin JST adapter for Dual HX711 scales board with FPC connector
-
GaggiaBoard_V2.1
GaggiaBoard_V2.1Gerber zip contains LCSC BOM and Centroid file
-
Dual HX711 scales board with FPC connector
Compact dual HX711 board for electronic scales with FPC connector.Gerber zip contains LCSC BOM and C...
-
GaggiaBoard_V3
GaggiaBoard_V3Gerber zip contains LCSC BOM and Centroid fileWARNING!Most of SMD components are place...
-
Dual HX711 scales board
Compact dual HX711 board for electronic scales.Allows common or separate VCC and VDD, as well as com...
You may also like
-
-
AEL-2011 Power Supply Module
320 0 1 -
AEL-2011 50W Power Amplifier
292 0 1 -
-
-
Custom Mechanical Keyboard
562 0 0 -
Tester for Touch Screen Digitizer without using microcontroller
228 2 2 -
Audio reactive glow LED wristband/bracelet with NFC / RFID-Tags
233 0 1 -
-
-







